本文整理汇总了Python中outwiker.gui.hotkeyparser.HotKeyParser.toString方法的典型用法代码示例。如果您正苦于以下问题:Python HotKeyParser.toString方法的具体用法?Python HotKeyParser.toString怎么用?Python HotKeyParser.toString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类outwiker.gui.hotkeyparser.HotKeyParser
的用法示例。
在下文中一共展示了HotKeyParser.toString方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: testToString
# 需要导入模块: from outwiker.gui.hotkeyparser import HotKeyParser [as 别名]
# 或者: from outwiker.gui.hotkeyparser.HotKeyParser import toString [as 别名]
def testToString(self):
self.assertEqual(HotKeyParser.toString(HotKey("A")), "A")
self.assertEqual(HotKeyParser.toString(HotKey("F1")), "F1")
self.assertEqual(HotKeyParser.toString(HotKey("A", ctrl=True)),
"Ctrl+A")
self.assertEqual(HotKeyParser.toString(HotKey("A", shift=True)),
"Shift+A")
self.assertEqual(HotKeyParser.toString(HotKey("A", alt=True)),
"Alt+A")
self.assertEqual(HotKeyParser.toString(
HotKey("A", ctrl=True, alt=True)),
"Ctrl+Alt+A")
self.assertEqual(HotKeyParser.toString(
HotKey("A", ctrl=True, shift=True)),
"Ctrl+Shift+A")
self.assertEqual(HotKeyParser.toString(
HotKey("A", alt=True, shift=True)),
"Shift+Alt+A")
self.assertEqual(HotKeyParser.toString(
HotKey("A", ctrl=True, alt=True, shift=True)),
"Ctrl+Shift+Alt+A")
示例2: _getToolbarItemTitle
# 需要导入模块: from outwiker.gui.hotkeyparser import HotKeyParser [as 别名]
# 或者: from outwiker.gui.hotkeyparser.HotKeyParser import toString [as 别名]
def _getToolbarItemTitle (self, strid):
hotkey = self.getHotKey (strid)
title = self.getTitle (strid)
if hotkey == None:
return title
return u"{0} ({1})".format (title, HotKeyParser.toString (hotkey))
示例3: _getMenuItemTitle
# 需要导入模块: from outwiker.gui.hotkeyparser import HotKeyParser [as 别名]
# 或者: from outwiker.gui.hotkeyparser.HotKeyParser import toString [as 别名]
def _getMenuItemTitle (self, strid):
hotkey = self.getHotKey (strid)
title = self.getTitle (strid)
if hotkey is None:
return title
return u"{0}\t{1}".format (title, HotKeyParser.toString (hotkey))
示例4: _assertMenuItemExists
# 需要导入模块: from outwiker.gui.hotkeyparser import HotKeyParser [as 别名]
# 或者: from outwiker.gui.hotkeyparser.HotKeyParser import toString [as 别名]
def _assertMenuItemExists (self, menu, title, hotkey):
"""
Проверить, что в меню есть элемент с заголовком (title + '\t' + hotkey)
"""
menuItemId = menu.FindItem (title)
self.assertNotEqual (menuItemId, wx.NOT_FOUND)
menuItem = menu.FindItemById (menuItemId)
if hotkey != None:
self.assertEqual (menuItem.GetItemLabel(), title + "\t" + HotKeyParser.toString (hotkey))
else:
self.assertEqual (menuItem.GetItemLabel(), title)
示例5: testHotKeysDefaultToolBar
# 需要导入模块: from outwiker.gui.hotkeyparser import HotKeyParser [as 别名]
# 或者: from outwiker.gui.hotkeyparser.HotKeyParser import toString [as 别名]
def testHotKeysDefaultToolBar (self):
action = TestAction()
hotkey = HotKey ("T", ctrl=True)
toolbar = self.wnd.toolbars[self.wnd.PLUGINS_TOOLBAR_STR]
image = "../test/images/save.png"
self.actionController.register (action, hotkey=hotkey)
self.assertEqual (self.actionController.getHotKey (action.stringId), hotkey)
self.actionController.appendToolbarButton (action.stringId,
toolbar,
image)
self.assertEqual (self._getToolItemLabel (toolbar, action.stringId),
u"{0} ({1})".format (action.title, HotKeyParser.toString (hotkey) ) )
示例6: _prepareToWrite
# 需要导入模块: from outwiker.gui.hotkeyparser import HotKeyParser [as 别名]
# 或者: from outwiker.gui.hotkeyparser.HotKeyParser import toString [as 别名]
def _prepareToWrite (self, value):
return u"" if value == None else HotKeyParser.toString (value)