From: Alex T. <ale...@us...> - 2006-06-13 16:01:41
|
Update of /cvsroot/pythoncard/PythonCard/tools/oneEditor In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27115 Modified Files: tabcodeEditor.py Log Message: Fix failures to save config with "view" settings, and to set these for each page. Fix problem that reading menu resource was over-riding what was set in the config file. Fix setting right-edge indicator for each page. Index: tabcodeEditor.py =================================================================== RCS file: /cvsroot/pythoncard/PythonCard/tools/oneEditor/tabcodeEditor.py,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** tabcodeEditor.py 26 May 2006 11:32:50 -0000 1.16 --- tabcodeEditor.py 13 Jun 2006 16:01:15 -0000 1.17 *************** *** 175,178 **** --- 175,181 ---- wx.FutureCall(1, self.SetSize, (w, h - 1)) wx.FutureCall(1, self.SetSize, (w, h)) + # although we loaded config above, the menu checked setting will be overwritten + # when the menu resource is read in - so repeat it later ... + wx.FutureCall(1, self.loadConfig) *************** *** 384,404 **** self.fileHistory.AddFileToHistory(h) if 'view_white_space' in self.config: - self.currentDocument.SetViewWhiteSpace(self.config['view_white_space']) self.menuBar.setChecked('menuViewWhitespace', self.config['view_white_space']) if 'indentation_guides' in self.config: - self.currentDocument.SetIndentationGuides(self.config['indentation_guides']) self.menuBar.setChecked('menuViewIndentationGuides', self.config['indentation_guides']) if 'right_edge_guide' in self.config: - self.currentDocument.SetEdgeMode(self.config['right_edge_guide']) self.menuBar.setChecked('menuViewRightEdgeIndicator', self.config['right_edge_guide']) if 'view_EOL' in self.config: - self.currentDocument.SetViewEOL(self.config['view_EOL']) self.menuBar.setChecked('menuViewEndOfLineMarkers', self.config['view_EOL']) if 'line_numbers' in self.config: - self.currentDocument.lineNumbersVisible = self.config['line_numbers'] self.menuBar.setChecked('menuViewLineNumbers', self.config['line_numbers']) if 'folding' in self.config: - self.currentDocument.codeFoldingVisible = self.config['folding'] self.menuBar.setChecked('menuViewCodeFolding', self.config['folding']) if 'macros' in self.config: --- 387,405 ---- self.fileHistory.AddFileToHistory(h) if 'view_white_space' in self.config: self.menuBar.setChecked('menuViewWhitespace', self.config['view_white_space']) if 'indentation_guides' in self.config: self.menuBar.setChecked('menuViewIndentationGuides', self.config['indentation_guides']) if 'right_edge_guide' in self.config: self.menuBar.setChecked('menuViewRightEdgeIndicator', self.config['right_edge_guide']) if 'view_EOL' in self.config: self.menuBar.setChecked('menuViewEndOfLineMarkers', self.config['view_EOL']) if 'line_numbers' in self.config: self.menuBar.setChecked('menuViewLineNumbers', self.config['line_numbers']) + if self.config['line_numbers'] == 0: + self.menuBar.setChecked('menuViewLineNumbers', False) + if 'folding' in self.config: self.menuBar.setChecked('menuViewCodeFolding', self.config['folding']) + self.setConfigPerPage() if 'macros' in self.config: *************** *** 424,427 **** --- 425,444 ---- except: self.config = {} + + def setConfigPerPage(self): + if not self.currentDocument: + return + if 'view_white_space' in self.config: + self.currentDocument.SetViewWhiteSpace(self.config['view_white_space']) + if 'indentation_guides' in self.config: + self.currentDocument.SetIndentationGuides(self.config['indentation_guides']) + if 'right_edge_guide' in self.config: + self.currentDocument.SetEdgeMode(self.config['right_edge_guide']) + if 'view_EOL' in self.config: + self.currentDocument.SetViewEOL(self.config['view_EOL']) + if 'line_numbers' in self.config: + self.currentDocument.lineNumbersVisible = self.config['line_numbers'] + if 'folding' in self.config: + self.currentDocument.codeFoldingVisible = self.config['folding'] def saveConfig(self): *************** *** 568,572 **** size = self.pages[-1].size wx.CallAfter(self.pages[-1].SetSize, size) ! def openFile(self, path): # need a new tab page in notebook if --- 585,590 ---- size = self.pages[-1].size wx.CallAfter(self.pages[-1].SetSize, size) ! wx.CallAfter(self.setConfigPerPage) ! def openFile(self, path): # need a new tab page in notebook if *************** *** 588,591 **** --- 606,610 ---- wx.CallAfter(win.openFile, path) wx.CallAfter(self.setResourceFile) + wx.CallAfter(self.setConfigPerPage) *************** *** 915,919 **** else: for page in self.pages: ! page.document.SetEdgeMode(stc.STC_EDGE_NONE) def on_menuViewEndOfLineMarkers_select(self, event): --- 934,938 ---- else: for page in self.pages: ! page.components.document.SetEdgeMode(stc.STC_EDGE_NONE) def on_menuViewEndOfLineMarkers_select(self, event): |