Exemplo n.º 1
0
    def setup(self):
        self.SetLexer(stc.STC_LEX_CONTAINER)
        self.SetStyleBits(7)
        self.Bind(wx.stc.EVT_STC_STYLENEEDED, self.OnStyling)

        #self.SetProperty("asp.default.language", "1")
        #self.SetProperty("fold", "0")
        from styles.html import style_control, keywords
        from styles import py

        style_control(self, faces)
        py.style_control(self, faces, self.OFFSET_CURLY)

        # === Dummy controls as lexers ===
        self.dummyHtml = wx.stc.StyledTextCtrl(self)
        self.dummyHtml.SetLayoutCache(wx.stc.STC_CACHE_DOCUMENT)
        self.dummyHtml.Show(False)
        self.dummyHtml.SetLexer(wx.stc.STC_LEX_HTML)
        self.dummyHtml.SetKeyWords(0, keywords())

        self.dummyW2Pt = wx.stc.StyledTextCtrl(self)
        self.dummyW2Pt.SetLayoutCache(wx.stc.STC_CACHE_DOCUMENT)
        self.dummyW2Pt.Show(False)
        self.dummyW2Pt.SetLexer(wx.stc.STC_LEX_PYTHON)
        self.dummyW2Pt.SetKeyWords(0, py.keywords())
Exemplo n.º 2
0
    def setup(self):
        self.SetLexer(stc.STC_LEX_PYTHON)
        self.SetProperty("fold", "1")
        self.SetProperty("tab.timmy.whinge.level", "1")
        from styles.py import style_control, keywords
        style_control(self, faces)

        self.SetKeyWords(0, keywords())

        self.SetIndent(4)               # Proscribed indent size for wx
        self.SetIndentationGuides(False) # Show indent guides
        self.SetBackSpaceUnIndents(True)# Backspace unindents rather than delete 1 space
        self.SetTabIndents(True)        # Tab key indents
        self.SetTabWidth(4)             # Proscribed tab size for wx
        self.SetUseTabs(False)          # Use spaces rather than tabs, or
                                        # TabTimmy will complain!    
        self.SetWordChars('abcdefghijklmnopqrstuvwxyz'
                            'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
                            '0123456789._')