| CODENOTIFIER | HelpYou are not signed inSign in |
Project: Editra
Revision: 55473
Author: CJP
Date: 05 Sep 2008 09:57:53
Changes:Fix bug where line number margin could not fit large line numbers. Also fixes overflow issue of large line numbers into bookmark margin.
Files:| ... | ...@@ -50,6 +50,9 @@ | |
| 50 | 50 | +Fix some export issues in the Style Editor |
| 51 | 51 | +Escape will properly hide the goto line control when it has focus |
| 52 | 52 | +Add missing mac icons to source bundles |
| 53 | +Bookmark margin getting over flow from line number margin when the number of | |
| 54 | lines in the document exceeds 10,000. | |
| 55 | +Full line number not being visible when lines exceed 1,000,000 | |
| 53 | 56 | |
| 54 | 57 | #-----------------------------------------------------------------------------# |
| 55 | 58 |
| ... | ...@@ -54,6 +54,7 @@ | |
| 54 | 54 | NONSPACE = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ" + \ |
| 55 | 55 | "0123456789_./\?[]{}<>!@#$%^&*():=-+\"';," |
| 56 | 56 | #-------------------------------------------------------------------------# |
| 57 | ||
| 57 | 58 | class EditraStc(wx.stc.StyledTextCtrl, ed_style.StyleMgr): |
| 58 | 59 | """Defines a styled text control for editing text |
| 59 | 60 | @summary: Subclass of wx.stc.StyledTextCtrl and L{ed_style.StyleMgr}. |
| ... | ...@@ -101,9 +102,9 @@ | |
| 101 | 102 | # Command/Settings Attributes |
| 102 | 103 | self._config = dict(autocomp=_PGET('AUTO_COMP'), |
| 103 | 104 | autoindent=_PGET('AUTO_INDENT'), |
| 104 | brackethl=_PGET("BRACKETHL"), | |
| 105 | brackethl=_PGET('BRACKETHL'), | |
| 105 | 106 | folding=_PGET('CODE_FOLD'), |
| 106 | highlight=_PGET("SYNTAX")) | |
| 107 | highlight=_PGET('SYNTAX')) | |
| 107 | 108 | |
| 108 | 109 | # Code Related Objects |
| 109 | 110 | self._code = dict(compsvc=autocomp.AutoCompService(self), |
| ... | ...@@ -925,6 +926,12 @@ | |
| 925 | 926 | @type evt: wx.stc.StyledTextEvent |
| 926 | 927 | |
| 927 | 928 | """ |
| 929 | # Adjust line number margin width to expand as needed when line | |
| 930 | # number width over fills the area. | |
| 931 | lines = self.GetLineCount() | |
| 932 | mwidth = self.GetTextExtent(str(lines))[0] | |
| 933 | self.SetMarginWidth(NUM_MARGIN, max(30, mwidth + 8)) | |
| 934 | ||
| 928 | 935 | wx.PostEvent(self.GetParent(), evt) |
| 929 | 936 | |
| 930 | 937 | def OnUpdateUI(self, evt): |