本文整理匯總了Python中outwiker.gui.stcstyle.StcStyle.checkColorString方法的典型用法代碼示例。如果您正苦於以下問題:Python StcStyle.checkColorString方法的具體用法?Python StcStyle.checkColorString怎麽用?Python StcStyle.checkColorString使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類outwiker.gui.stcstyle.StcStyle
的用法示例。
在下文中一共展示了StcStyle.checkColorString方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: LoadState
# 需要導入模塊: from outwiker.gui.stcstyle import StcStyle [as 別名]
# 或者: from outwiker.gui.stcstyle.StcStyle import checkColorString [as 別名]
def LoadState(self):
# Показывать ли номера строк?
self.lineNumbers = configelements.BooleanElement (self.__config.lineNumbers, self.lineNumbersCheckBox)
# Шрифт для редактора
fontOption = FontOption (self.__config.fontName,
self.__config.fontSize,
self.__config.fontIsBold,
self.__config.fontIsItalic)
self.fontEditor = configelements.FontElement (fontOption, self.fontPicker)
# Размер табуляции
self.tabWidth = configelements.IntegerElement (self.__config.tabWidth,
self.tabWidthSpin,
self.MIN_TAB_WIDTH,
self.MAX_TAB_WIDTH)
if self.__config.homeEndKeys.value == 0:
self.homeEndCombo.SetSelection (0)
else:
self.homeEndCombo.SetSelection (1)
if StcStyle.checkColorString (self.__config.fontColor.value):
self.fontColorPicker.SetColour (self.__config.fontColor.value)
else:
self.fontColorPicker.SetColour (wx.Color (0, 0, 0))
if StcStyle.checkColorString (self.__config.backColor.value):
self.backColorPicker.SetColour (self.__config.backColor.value)
else:
self.backColorPicker.SetColour (wx.Color (255, 255, 255))
示例2: testCheckColorString
# 需要導入模塊: from outwiker.gui.stcstyle import StcStyle [as 別名]
# 或者: from outwiker.gui.stcstyle.StcStyle import checkColorString [as 別名]
def testCheckColorString (self):
self.assertTrue (StcStyle.checkColorString (u"#000000"))
self.assertTrue (StcStyle.checkColorString (u" #000000 "))
self.assertTrue (StcStyle.checkColorString (u"#AA00FF"))
self.assertTrue (StcStyle.checkColorString (u"#aa00ff"))
self.assertFalse (StcStyle.checkColorString (u"AA00FF"))
self.assertFalse (StcStyle.checkColorString (u"#AA00FF0"))
self.assertFalse (StcStyle.checkColorString (u"#AA00GG"))
self.assertFalse (StcStyle.checkColorString (u"#A0F"))