Esempio n. 1
0
    def __init__(self):
        self.menu = MenuBar()

        subMenu = MenuBar(True)
        subMenu.addNewItem("<code>Code</code>", True, None, self)
        subMenu.addNewItem("<strike>Strikethrough</strike>", True, None, self)
        subMenu.addNewItem("<u>Underlined</u>", True, None, self)

        menu0 = MenuBar(True)
        menu0.addNewItem("<b>Bold</b>", True, None, self)
        menu0.addNewItem("<i>Italicized</i>", True, None, self)
        menu0.addNewItem("More &#187;", True, None, subMenu)
        menu1 = MenuBar(True)
        menu1.addNewItem("<font color='#FF0000'><b>Apple</b></font>", True,
                         None, self)
        menu1.addNewItem("<font color='#FFFF00'><b>Banana</b></font>", True,
                         None, self)
        menu1.addNewItem("<font color='#FFFFFF'><b>Coconut</b></font>", True,
                         None, self)
        menu1.addNewItem("<font color='#8B4513'><b>Donut</b></font>", True,
                         None, self)
        menu2 = MenuBar(True)
        menu2.addNewItem("Bling", False, None, self)
        menu2.addNewItem("Ginormous", False, None, self)
        menu2.addNewItem("<code>w00t!</code>", True, True, self)

        self.menu.addItem(MenuItem("Style", False, None, menu0))
        self.menu.addItem(MenuItem("Fruit", False, None, menu1))
        self.menu.addItem(MenuItem("Term", False, None, menu2))

        self.menu.setWidth("100%")

        self.setWidget(self.menu)
Esempio n. 2
0
	def __init__(self, plugin, window):
		self._window = window
		self._plugin = plugin
		self.menu = MenuItem()
		try:
			self.menu.create_menu(window)
		except CoreError as e:
			ExceptionDialog(repr(e))
Esempio n. 3
0
class PastebinWindowHelper:

	def __init__(self, plugin, window):
		self._window = window
		self._plugin = plugin
		self.menu = MenuItem()
		try:
			self.menu.create_menu(window)
		except CoreError as e:
			ExceptionDialog(repr(e))
		
	def deactivate(self):
		self.menu.remove_menu()
		self._window = None
		self._plugin = None
		
	def update_ui(self):
		pass