当前位置: 首页>>代码示例>>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;未经允许,请勿转载。