From 1f443284e1584947ef9007f4c8a055121effa366 Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Tue, 2 Mar 2004 23:51:23 +0000 Subject: [PATCH] Updates for STCStyleEditor git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@26039 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- wxPython/samples/StyleEditor/STCStyleEditor.py | 13 ++++++------- wxPython/samples/StyleEditor/stc-styles.rc.cfg | 2 +- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/wxPython/samples/StyleEditor/STCStyleEditor.py b/wxPython/samples/StyleEditor/STCStyleEditor.py index 9758734401..d65b8a87c7 100644 --- a/wxPython/samples/StyleEditor/STCStyleEditor.py +++ b/wxPython/samples/StyleEditor/STCStyleEditor.py @@ -679,7 +679,7 @@ class STCStyleEditDlg(wxDialog): if num == wxSTC_STYLE_DEFAULT: self.elementLb.InsertItems([name, '----Language----'], 0) self.elementLb.Append('----Standard----') - stdStart = stdPos = self.elementLb.Number() + stdStart = stdPos = self.elementLb.GetCount() else: # std styles if num >= 33 and num < 40: @@ -704,7 +704,7 @@ class STCStyleEditDlg(wxDialog): # add definitions self.elementLb.Append('----Common----') - self.commonDefsStartIdx = self.elementLb.Number() + self.commonDefsStartIdx = self.elementLb.GetCount() for common in self.commonDefs.keys(): tpe = type(self.commonDefs[common]) self.elementLb.Append('%('+common+')'+(tpe is type('') and 's' or 'd')) @@ -974,7 +974,7 @@ class STCStyleEditDlg(wxDialog): self.commonDefs[name] = commonPropDefs[prop] self.elementLb.Append('%('+name+')'+\ (type(commonPropDefs[prop]) is type('') and 's' or 'd')) - self.elementLb.SetSelection(self.elementLb.Number()-1, True) + self.elementLb.SetSelection(self.elementLb.GetCount()-1, True) self.populateCombosWithCommonDefs() self.OnElementlbListbox(None) finally: @@ -1004,7 +1004,7 @@ class STCStyleEditDlg(wxDialog): self.populateCombosWithCommonDefs() selIdx = self.elementLb.GetSelection() self.elementLb.Delete(selIdx) - if selIdx == self.elementLb.Number(): + if selIdx == self.elementLb.GetCount(): selIdx = selIdx - 1 self.elementLb.SetSelection(selIdx, True) self.OnElementlbListbox(None) @@ -1315,9 +1315,8 @@ if __name__ == '__main__': provider = wxSimpleHelpProvider() wxHelpProvider_Set(provider) - home = os.environ.get('HOME') - if home: home = os.path.join(home, '.boa') - config = os.path.abspath(os.path.join(home, 'stc-styles.rc.cfg')) + base = os.path.split(__file__)[0] + config = os.path.abspath(os.path.join(base, 'stc-styles.rc.cfg')) if 0: f = wxFrame(None, -1, 'Test frame (double click for editor)') stc = wxStyledTextCtrl(f, -1) diff --git a/wxPython/samples/StyleEditor/stc-styles.rc.cfg b/wxPython/samples/StyleEditor/stc-styles.rc.cfg index 2388d5a5ae..646cfe0622 100644 --- a/wxPython/samples/StyleEditor/stc-styles.rc.cfg +++ b/wxPython/samples/StyleEditor/stc-styles.rc.cfg @@ -1,6 +1,6 @@ common.defs.msw={'helv': 'Lucida Console', 'mono': 'Courier New', 'lnsize': 6, 'backcol': '#FFFFFF', 'size': 8} common.defs.gtk={ 'mono' : 'Courier New', 'helv' : 'Lucida Console', 'lucd' : 'Lucida Console', 'other' : 'Comic Sans MS', 'size' : 8, 'lnsize': 6, 'backcol': '#FFFFFF'} -common.styleidnames = {wxSTC_STYLE_DEFAULT: 'Style default', wxSTC_STYLE_LINENUMBER: 'Line numbers', wxSTC_STYLE_BRACELIGHT: 'Matched braces', wxSTC_STYLE_BRACEBAD: 'Unmatched brace', wxSTC_STYLE_CONTROLCHAR: 'Control characters', wxSTC_STYLE_INDENTGUIDE: 'Indent guide'} +common.styleidnames={wxSTC_STYLE_DEFAULT: 'Style default', wxSTC_STYLE_LINENUMBER: 'Line numbers', wxSTC_STYLE_BRACELIGHT: 'Matched braces', wxSTC_STYLE_BRACEBAD: 'Unmatched brace', wxSTC_STYLE_CONTROLCHAR: 'Control characters', wxSTC_STYLE_INDENTGUIDE: 'Indent guide'} [style.python] setting.python.-3= setting.python.-2=fore:#000000 -- 2.47.2