From: Kevin A. <ka...@us...> - 2004-09-28 21:24:35
|
Update of /cvsroot/pythoncard/PythonCard In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18704 Modified Files: model.py Log Message: added SplitterBackground Index: model.py =================================================================== RCS file: /cvsroot/pythoncard/PythonCard/model.py,v retrieving revision 1.189 retrieving revision 1.190 diff -C2 -d -r1.189 -r1.190 *** model.py 25 Sep 2004 15:37:40 -0000 1.189 --- model.py 28 Sep 2004 21:24:24 -0000 1.190 *************** *** 1191,1194 **** --- 1191,1250 ---- + # KEA 2004-09-28 + # it appears that if you are going to use splitters + # you can't just put them a wx.Panel within a wx.Frame + # so the SplitterBackground has no self.panel + # and the question becomes how are the various splitter + # combinations specified? + # when the PageBackground children are created, they + # will need to use the correct splitters as parents + class SplitterBackground(Background): + def _initLayout(self, aResourceList): + # should we just set self.panel = self instead?! + self.panel = None + + # KEA 2001-07-31 + # we may want to put this someplace else, but we do need access + # to the componenet list + def findFocus(self): + # the wxPython widget that has focus + widgetWX = wx.Window_FindFocus() + if widgetWX is None: + return None + else: + # KEA 2004-09-28 + # this needs to iterate through the splitters + # children correctly and my brain hurts + # too much from getting splitters working + # to fix this ;-) + for widget in self.components.itervalues(): + if widgetWX == widget: + return widget + # is this even possible? focus in another window maybe? + return None + + # these really don't have any purpose within the + # context of a SplitterBackground + # but I'll leave them here for now + + # there are probably additional references in Background to self.panel + # that also need overriding methods here + + def _getBackgroundColor(self): + return self.GetBackgroundColour() + + def _setBackgroundColor(self, aColor): + self.SetBackgroundColour(aColor) + + def _getForegroundColor(self): + return self.GetForegroundColour() + + def _setForegroundColor(self, aColor): + self.SetForegroundColour(aColor) + + backgroundColor = property(_getBackgroundColor, _setBackgroundColor, doc="backgroundColor of the background") + foregroundColor = property(_getForegroundColor, _setForegroundColor, doc="foregroundColor of the background") + + PageBackgroundEvents = ( ## ActivateEvent, |