本文整理汇总了Python中action.Action.helptext方法的典型用法代码示例。如果您正苦于以下问题:Python Action.helptext方法的具体用法?Python Action.helptext怎么用?Python Action.helptext使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类action.Action
的用法示例。
在下文中一共展示了Action.helptext方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: _initToolbarbuttons
# 需要导入模块: from action import Action [as 别名]
# 或者: from action.Action import helptext [as 别名]
def _initToolbarbuttons(self):
""" Sets up and connects buttons related to the toolbar """
rotateLeftAction = Action(text=u"Rotate counterclockwise", icon="gui/icons/rotate_countercw.png")
rotateRightAction = Action(text=u"Rotate clockwise", icon="gui/icons/rotate_clockwise.png")
zoomInAction = Action(text=u"Zoom in", icon="gui/icons/zoom_in.png")
zoomOutAction = Action(text=u"Zoom out", icon="gui/icons/zoom_out.png")
zoomResetAction = Action(text=u"Reset zoom", icon="gui/icons/zoom_default.png")
screenshotAction = Action(text=u"Take screenshot", icon="gui/icons/take_screenshot.png")
rotateLeftAction.helptext = u"Rotate counterclockwise by 90 degrees"
rotateRightAction.helptext = u"Rotate clockwise by 90 degrees"
zoomInAction.helptext = u"Zoom in (CTRL + Mousewheel up)"
zoomOutAction.helptext = u"Zoom out (CTRL + Mousewheel down)"
zoomResetAction.helptext = u"Reset zoom to default level"
screenshotAction.helptext = u"Take screenshot (F7)"
action.activated.connect(self._rotateCounterClockwise, sender=rotateLeftAction)
action.activated.connect(self._rotateClockwise, sender=rotateRightAction)
action.activated.connect(self._zoomIn, sender=zoomInAction)
action.activated.connect(self._zoomOut, sender=zoomOutAction)
action.activated.connect(self._resetZoom, sender=zoomResetAction)
action.activated.connect(self._captureScreen, sender=screenshotAction)
self._viewGroup = ActionGroup(name=u"View group")
self._viewGroup.addAction(rotateLeftAction)
self._viewGroup.addAction(rotateRightAction)
self._viewGroup.addAction(zoomInAction)
self._viewGroup.addAction(zoomOutAction)
self._viewGroup.addAction(zoomResetAction)
self._viewGroup.addAction(screenshotAction)
self._toolbar.addAction(self._viewGroup)
self._toolbar.adaptLayout()
示例2: __init__
# 需要导入模块: from action import Action [as 别名]
# 或者: from action.Action import helptext [as 别名]
def __init__(self):
self.editor = scripts.editor.getEditor()
self.engine = self.editor.getEngine()
self._map = None
self._layer = None
self._mapdlg = None
self._layerdlg = None
self._cameradlg = None
self._filebrowser = None
self._importbrowser = None
self._savebrowser = None
newAction = Action(u"New map", "gui/icons/new_map.png")
loadAction = Action(u"Open", "gui/icons/load_map.png")
closeAction = Action(u"Close", "gui/icons/close_map.png")
saveAction = Action(u"Save", "gui/icons/save_map.png")
saveAsAction = Action(u"Save as", "gui/icons/save_mapas.png")
saveAllAction = Action(u"Save all", "gui/icons/save_allmaps.png")
importFileAction = Action(u"Import file", "gui/icons/import_file.png")
importDirAction = Action(u"Import directory", "gui/icons/import_dir.png")
newAction.helptext = u"Create new map"
loadAction.helptext = u"Open existing map"
closeAction.helptext = u"Close map"
saveAction.helptext = u"Save map"
saveAsAction.helptext = u"Save map as"
saveAllAction.helptext = u"Save all opened maps"
importFileAction.helptext = u"Imports an object file"
importDirAction.helptext = u"Recursively imports all objects from a directory"
action.activated.connect(self.showMapWizard, sender=newAction)
action.activated.connect(self.showLoadDialog, sender=loadAction)
action.activated.connect(self.closeCurrentMap, sender=closeAction)
action.activated.connect(self.save, sender=saveAction)
action.activated.connect(self.saveAs, sender=saveAsAction)
action.activated.connect(self.editor.saveAll, sender=saveAllAction)
self._importFileCallback = cbwa(self.showImportDialog, self.importFile, False)
self._importDirCallback = cbwa(self.showImportDialog, self.importDir, True)
action.activated.connect(self._importFileCallback, sender=importFileAction)
action.activated.connect(self._importDirCallback, sender=importDirAction)
eventlistener = self.editor.getEventListener()
eventlistener.getKeySequenceSignal(fife.Key.N, ["ctrl"]).connect(self.showMapWizard)
eventlistener.getKeySequenceSignal(fife.Key.O, ["ctrl"]).connect(self.showLoadDialog)
eventlistener.getKeySequenceSignal(fife.Key.W, ["ctrl"]).connect(self.closeCurrentMap)
eventlistener.getKeySequenceSignal(fife.Key.S, ["ctrl"]).connect(self.save)
eventlistener.getKeySequenceSignal(fife.Key.S, ["ctrl", "shift"]).connect(self.editor.saveAll)
fileGroup = ActionGroup()
fileGroup.addAction(newAction)
fileGroup.addAction(loadAction)
fileGroup.addSeparator()
fileGroup.addAction(closeAction)
fileGroup.addSeparator()
fileGroup.addAction(saveAction)
fileGroup.addAction(saveAsAction)
fileGroup.addAction(saveAllAction)
fileGroup.addSeparator()
fileGroup.addAction(importFileAction)
fileGroup.addAction(importDirAction)
self.editor.getToolBar().insertAction(fileGroup, 0)
self.editor.getToolBar().insertSeparator(None, 1)
self.editor._file_menu.insertAction(fileGroup, 0)
self.editor._file_menu.insertSeparator(None, 1)