當前位置: 首頁>>代碼示例>>Python>>正文


Python Transform.populate_transform_menu方法代碼示例

本文整理匯總了Python中Transform.populate_transform_menu方法的典型用法代碼示例。如果您正苦於以下問題:Python Transform.populate_transform_menu方法的具體用法?Python Transform.populate_transform_menu怎麽用?Python Transform.populate_transform_menu使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Transform的用法示例。


在下文中一共展示了Transform.populate_transform_menu方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: __init__

# 需要導入模塊: import Transform [as 別名]
# 或者: from Transform import populate_transform_menu [as 別名]
	def __init__(self, parent=None):
		global highlightTypes

		super(MainWindow, self).__init__(parent)
		self.setWindowTitle("Binary Ninja")

		action_table = {}
		highlightNames = highlightTypes.keys()
		highlightNames.sort()

		self.fileMenu = QMenu("&File", self)
		new_menu = self.fileMenu.addMenu("&New")
		new_binary_action = new_menu.addAction("&Binary data", self.new)
		new_binary_action.setShortcut(QKeySequence(Qt.CTRL + Qt.Key_N))
		for name in highlightNames:
			cls = highlightTypes[name]
			new_menu.addAction(name, self.create_new_callback(cls))
		open_action = self.fileMenu.addAction("&Open...", self.open)
		open_action.setShortcut(QKeySequence(Qt.CTRL + Qt.Key_O))
		save_action = self.fileMenu.addAction("&Save", self.save)
		save_action.setShortcut(QKeySequence(Qt.CTRL + Qt.Key_S))
		self.fileMenu.addAction("Save &As...", self.saveAs)
		close_action = self.fileMenu.addAction("&Close", self.closeTab)
		close_action.setShortcut(QKeySequence(Qt.CTRL + Qt.Key_W))
		self.fileMenu.addSeparator()
		self.fileMenu.addAction("&Preferences...", self.preferences)
		self.fileMenu.addSeparator()
		self.fileMenu.addAction("&Quit", self.quit)
		self.menuBar().addMenu(self.fileMenu)

		self.editMenu = QMenu("&Edit", self)
		undo_action = self.editMenu.addAction("&Undo", self.undo)
		undo_action.setShortcut(QKeySequence(Qt.CTRL + Qt.Key_Z))
		redo_action = self.editMenu.addAction("&Redo", self.redo)
		redo_action.setShortcut(QKeySequence(Qt.CTRL + Qt.SHIFT + Qt.Key_Z))
		self.editMenu.addSeparator()
		select_all_action = self.editMenu.addAction("Select &all", self.selectAll)
		select_all_action.setShortcut(QKeySequence(Qt.CTRL + Qt.Key_A))
		self.editMenu.addAction("Select &none", self.selectNone)
		self.editMenu.addSeparator()
		cut_action = self.editMenu.addAction("C&ut", self.cut)
		cut_action.setShortcut(QKeySequence(Qt.CTRL + Qt.Key_X))
		copy_action = self.editMenu.addAction("&Copy", self.copy)
		copy_action.setShortcuts([QKeySequence(Qt.CTRL + Qt.Key_C), QKeySequence(Qt.CTRL + Qt.SHIFT + Qt.Key_C)])
		paste_action = self.editMenu.addAction("&Paste", self.paste)
		paste_action.setShortcuts([QKeySequence(Qt.CTRL + Qt.Key_V), QKeySequence(Qt.CTRL + Qt.SHIFT + Qt.Key_V)])
		self.editMenu.addSeparator()
		populate_copy_as_menu(self.editMenu.addMenu("Copy &as"), self, action_table)
		copy_address_action = self.editMenu.addAction("Copy address", self.copy_address)
		copy_address_action.setShortcut(QKeySequence(Qt.CTRL + Qt.SHIFT + Qt.Key_A))
		populate_paste_from_menu(self.editMenu.addMenu("Paste &from"), self, action_table)
		Transform.populate_transform_menu(self.editMenu.addMenu("&Transform"), self, action_table)
		self.editMenu.addSeparator()
		assemble_action = self.editMenu.addAction("Assemble...", self.assemble)
		assemble_action.setShortcut(QKeySequence(Qt.CTRL + Qt.ALT + Qt.Key_A))
		follow_ptr_action = self.editMenu.addAction("Follow pointer", self.follow_pointer)
		follow_ptr_action.setShortcut(QKeySequence(Qt.CTRL + Qt.Key_Asterisk))
		self.editMenu.addSeparator()
		find_action = self.editMenu.addAction("Find...", self.find)
		find_action.setShortcut(QKeySequence(Qt.CTRL + Qt.Key_F))
		find_next_action = self.editMenu.addAction("Find next", self.find_next)
		find_next_action.setShortcut(QKeySequence(Qt.Key_F3))
		self.menuBar().addMenu(self.editMenu)

		self.viewMenu = QMenu("&View", self)
		self.viewMenu.addAction("&Single view", self.split_single)
		horiz_split_action = self.viewMenu.addAction("Split &horizontally", self.split_horizontal)
		horiz_split_action.setShortcut(QKeySequence(Qt.CTRL + Qt.SHIFT + Qt.Key_T))
		vert_split_action = self.viewMenu.addAction("Split &vertically", self.split_vertical)
		vert_split_action.setShortcut(QKeySequence(Qt.CTRL + Qt.SHIFT + Qt.Key_Y))
		self.viewMenu.addSeparator()
		move_pane_action = self.viewMenu.addAction("&Move tab to other pane", self.split_move)
		move_pane_action.setShortcut(QKeySequence(Qt.CTRL + Qt.SHIFT + Qt.Key_M))
		self.viewMenu.addSeparator()
		next_tab_action = self.viewMenu.addAction("&Next tab", self.next_tab)
		prev_tab_action = self.viewMenu.addAction("&Previous tab", self.prev_tab)
		if sys.platform == 'darwin':
			next_tab_action.setShortcut(QKeySequence(Qt.META + Qt.Key_Tab))
			prev_tab_action.setShortcut(QKeySequence(Qt.META + Qt.SHIFT + Qt.Key_Tab))
		else:
			next_tab_action.setShortcut(QKeySequence(Qt.CTRL + Qt.Key_Tab))
			prev_tab_action.setShortcut(QKeySequence(Qt.CTRL + Qt.SHIFT + Qt.Key_Tab))
		other_pane_action = self.viewMenu.addAction("Select &other pane", self.other_pane)
		other_pane_action.setShortcut(QKeySequence(Qt.ALT + Qt.Key_QuoteLeft))
		self.viewMenu.addSeparator()
		syntax_menu = self.viewMenu.addMenu("&Syntax highlighting")
		syntax_menu.addAction("None", self.highlight_none)
		for name in highlightNames:
			cls = highlightTypes[name]
			syntax_menu.addAction(name, self.create_highlight_callback(cls))
		self.menuBar().addMenu(self.viewMenu)

		self.toolsMenu = QMenu("&Tools", self)
		python_console_action = self.toolsMenu.addAction("&Python console", self.python_console)
		python_console_action.setShortcuts([QKeySequence(Qt.CTRL + Qt.Key_QuoteLeft), QKeySequence(Qt.Key_QuoteLeft)])
		if os.name != "nt":
			python_exec_action = self.toolsMenu.addAction("&Run Python script", self.python_run)
			python_exec_action.setShortcuts([QKeySequence(Qt.Key_F5), QKeySequence(Qt.CTRL + Qt.Key_R)])
			self.toolsMenu.addSeparator()
			shell_action = self.toolsMenu.addAction("&Shell", self.shell)
#.........這裏部分代碼省略.........
開發者ID:techvoltage,項目名稱:binaryninja-python,代碼行數:103,代碼來源:binja.py


注:本文中的Transform.populate_transform_menu方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。