From: Kevin A. <ka...@us...> - 2004-09-25 15:05:18
|
Update of /cvsroot/pythoncard/PythonCard/tools/resourceEditor In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10537/tools/resourceEditor Modified Files: resourceEditor.py Log Message: added Show Grid Lines option to resourceEditor Index: resourceEditor.py =================================================================== RCS file: /cvsroot/pythoncard/PythonCard/tools/resourceEditor/resourceEditor.py,v retrieving revision 1.216 retrieving revision 1.217 diff -C2 -d -r1.216 -r1.217 *** resourceEditor.py 25 Sep 2004 14:27:07 -0000 1.216 --- resourceEditor.py 25 Sep 2004 15:05:08 -0000 1.217 *************** *** 141,144 **** --- 141,145 ---- self.yGridSize = 5 self.alignToGrid = self.menuBar.getChecked('menuOptionsAlignToGrid') + self.showGridLines = self.menuBar.getChecked('menuOptionsShowGridLines') path = os.path.join(self.application.applicationDirectory, 'templates', \ *************** *** 1233,1236 **** --- 1234,1241 ---- self.editingDialog = True + # unhook the grid drawing and then rebind later if necessary + if self.showGridLines: + self.panel.Unbind(wx.EVT_ERASE_BACKGROUND) + if self.editingDialog: self.menuBar.setEnabled('menuFileRun', False) *************** *** 1286,1296 **** self.panel.Disconnect(-1, -1, wx.wxEVT_ERASE_BACKGROUND) self.panel._bitmap = None - # KEA 2004-09-25 - # test drawing grid lines, this may become an option in the future - # wx.EVT_ERASE_BACKGROUND( self.panel, self.drawPanelGridLines) self.movingComponent = False self.resizingHandleTarget = None def drawPanelGridLines(self, event): dc = event.GetDC() --- 1291,1302 ---- self.panel.Disconnect(-1, -1, wx.wxEVT_ERASE_BACKGROUND) self.panel._bitmap = None self.movingComponent = False self.resizingHandleTarget = None + if self.showGridLines: + self.panel.Bind(wx.EVT_ERASE_BACKGROUND, self.drawPanelGridLines) + self.panel.Refresh() + def drawPanelGridLines(self, event): dc = event.GetDC() *************** *** 1435,1438 **** --- 1441,1452 ---- self.alignToGrid = self.menuBar.getChecked('menuOptionsAlignToGrid') + def on_menuOptionsShowGridLines_select(self, event): + self.showGridLines = self.menuBar.getChecked('menuOptionsShowGridLines') + if self.showGridLines: + self.panel.Bind(wx.EVT_ERASE_BACKGROUND, self.drawPanelGridLines) + else: + self.panel.Unbind(wx.EVT_ERASE_BACKGROUND) + self.panel.Refresh() + def getCommandLineArgs(self): args = ' ' |