当前位置: 首页>>代码示例>>Python>>正文


Python stcstyle.StcStyle类代码示例

本文整理汇总了Python中outwiker.gui.stcstyle.StcStyle的典型用法代码示例。如果您正苦于以下问题:Python StcStyle类的具体用法?Python StcStyle怎么用?Python StcStyle使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了StcStyle类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: LoadState

    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))
开发者ID:LihMeh,项目名称:outwiker,代码行数:33,代码来源:editorpanel.py

示例2: testParse_14

    def testParse_14 (self):
        style = StcStyle.parse (u"back:#222222,bold,,,underline")

        self.assertEqual (style.bold, True)
        self.assertEqual (style.italic, False)
        self.assertEqual (style.underline, True)
        self.assertEqual (style.fore, u"#000000")
        self.assertEqual (style.back, u"#222222")
开发者ID:LihMeh,项目名称:outwiker,代码行数:8,代码来源:stcstyleparser.py

示例3: testParse_12

    def testParse_12 (self):
        style = StcStyle.parse (u"fore:#AAAAAA,back:#222222,bold,underline")

        self.assertEqual (style.bold, True)
        self.assertEqual (style.italic, False)
        self.assertEqual (style.underline, True)
        self.assertEqual (style.fore, u"#AAAAAA")
        self.assertEqual (style.back, u"#222222")
开发者ID:LihMeh,项目名称:outwiker,代码行数:8,代码来源:stcstyleparser.py

示例4: testParse_05

    def testParse_05 (self):
        style = StcStyle.parse (u"FORE:#AAAAAA")

        self.assertEqual (style.bold, False)
        self.assertEqual (style.italic, False)
        self.assertEqual (style.underline, False)
        self.assertEqual (style.fore, u"#AAAAAA")
        self.assertEqual (style.back, u"#FFFFFF")
开发者ID:LihMeh,项目名称:outwiker,代码行数:8,代码来源:stcstyleparser.py

示例5: testParse_04

    def testParse_04(self):
        style = StcStyle.parse("fore:#AAAAAA")

        self.assertEqual(style.bold, False)
        self.assertEqual(style.italic, False)
        self.assertEqual(style.underline, False)
        self.assertEqual(style.fore, "#AAAAAA")
        self.assertEqual(style.back, "#FFFFFF")
开发者ID:Jenyay,项目名称:outwiker,代码行数:8,代码来源:test_stcstyleparser.py

示例6: testParse_03

    def testParse_03 (self):
        style = StcStyle.parse (u"fore:#000000,bold")

        self.assertEqual (style.bold, True)
        self.assertEqual (style.italic, False)
        self.assertEqual (style.underline, False)
        self.assertEqual (style.fore, u"#000000")
        self.assertEqual (style.back, u"#FFFFFF")
开发者ID:LihMeh,项目名称:outwiker,代码行数:8,代码来源:stcstyleparser.py

示例7: testParse_11

    def testParse_11(self):
        style = StcStyle.parse(" fore:#AAAAAA , back:#222222 , bold,italic , underline ")

        self.assertEqual(style.bold, True)
        self.assertEqual(style.italic, True)
        self.assertEqual(style.underline, True)
        self.assertEqual(style.fore, "#AAAAAA")
        self.assertEqual(style.back, "#222222")
开发者ID:Jenyay,项目名称:outwiker,代码行数:8,代码来源:test_stcstyleparser.py

示例8: testCheckColorString

    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"))
开发者ID:LihMeh,项目名称:outwiker,代码行数:10,代码来源:stcstyleparser.py

示例9: _loadValue

    def _loadValue(self):
        """
        Получить значение. В производных классах этот метод переопределяется
        """
        style = StcStyle.parse(self.config.get(self.section, self.param))
        if style is None:
            raise ValueError

        return style
开发者ID:Jenyay,项目名称:outwiker,代码行数:9,代码来源:config.py

示例10: testToString_06

 def testToString_06(self):
     style = StcStyle(fore="", back="", bold=True)
     self.assertEqual(style.tostr(), "bold")
开发者ID:Jenyay,项目名称:outwiker,代码行数:3,代码来源:test_stcstyleparser.py

示例11: testToString_07

 def testToString_07 (self):
     style = StcStyle(fore=u"", back=u"", bold=True, italic=True)
     self.assertEqual (style.tostr(), u"bold,italic")
开发者ID:LihMeh,项目名称:outwiker,代码行数:3,代码来源:stcstyleparser.py

示例12: testParse_invalid

 def testParse_invalid (self):
     self.assertEqual (StcStyle.parse (u"sdgsgd"), None)
     self.assertEqual (StcStyle.parse (u"fore:#AAAAAA,back:#222222,boldasdfa"), None)
开发者ID:LihMeh,项目名称:outwiker,代码行数:3,代码来源:stcstyleparser.py

示例13: testToString_05

 def testToString_05 (self):
     style = StcStyle(fore=u"#AAAAAA", back=u"#BBBBBB", bold=True)
     self.assertEqual (style.tostr(), u"fore:#AAAAAA,back:#BBBBBB,bold")
开发者ID:LihMeh,项目名称:outwiker,代码行数:3,代码来源:stcstyleparser.py

示例14: testToString_04

 def testToString_04 (self):
     style = StcStyle(bold=True, italic=True, underline=True)
     self.assertEqual (style.tostr(), u"fore:#000000,back:#FFFFFF,bold,italic,underline")
开发者ID:LihMeh,项目名称:outwiker,代码行数:3,代码来源:stcstyleparser.py

示例15: testToString_02

 def testToString_02 (self):
     style = StcStyle(bold=True)
     self.assertEqual (style.tostr(), u"fore:#000000,back:#FFFFFF,bold")
开发者ID:LihMeh,项目名称:outwiker,代码行数:3,代码来源:stcstyleparser.py


注:本文中的outwiker.gui.stcstyle.StcStyle类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。