Changeset 3156

Show
Ignore:
Timestamp:
06/05/07 13:55:34 (2 years ago)
Author:
ed
Message:

Changed the repr() method to default to Python's id() function for the id portion of the string; overrode the _getID() method in dPemMixin to return the wxPython GetId?() value.

Enhanced support for working with Wizards in showContainingPage().

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/dabo/dObject.py

    r3155 r3156  
    9494            # No name; use module.classname 
    9595            nm = "%s.%s" % (self.__class__.__module__, self.__class__.__name__) 
    96         try: 
    97             _id = self.GetId() 
    98         except: 
    99             _id = "?" 
     96        _id = self._getID() 
    10097        return "<%(nm)s (baseclass %(classname)s, id:%(_id)s)>" % locals() 
    101          
     98 
     99 
     100    def _getID(self): 
     101        """Defaults to the Python id() function. Objects in sub-modules, such as the various 
     102        UI toolkits, can override to substitute something more relevant to them. 
     103        """ 
     104        return id(self) 
    102105 
    103106 
  • trunk/dabo/ui/uiwx/dPemMixin.py

    r3104 r3156  
    680680 
    681681 
     682    def _getID(self): 
     683        """Override the default behavior to return the wxPython ID.""" 
     684        return self.GetId() 
     685 
     686 
    682687    def fitToSizer(self, extraWidth=0, extraHeight=0): 
    683688        """Resize the control to fit the size required by its sizer.""" 
     
    761766        paged controls to switch to the page that contains this object. 
    762767        """ 
     768        try: 
     769            frm = self.Form 
     770        except: 
     771            frm = None 
    763772        cntnr = self 
     773        iswiz = isinstance(frm, dabo.ui.dialogs.Wizard) 
     774        mtch = {True: dabo.ui.dialogs.WizardPage, False: dabo.ui.dPage}[iswiz] 
    764775        while cntnr and not isinstance(cntnr, dabo.ui.dForm): 
    765             if isinstance(cntnr, dabo.ui.dPage): 
    766                 cntnr.Parent.SelectedPage = cntnr 
     776            if isinstance(cntnr, mtch): 
     777                if iswiz: 
     778                    frm.CurrentPage = cntnr 
     779                else: 
     780                    cntnr.Parent.SelectedPage = cntnr 
    767781            cntnr = cntnr.Parent 
    768782     
     
    13551369        redraw() hook method. 
    13561370        """ 
     1371        # Clear the idle flag. 
     1372        self._needRedraw = False 
    13571373        if dc is None: 
    13581374            # First, clear any old drawing if requested 
     
    13651381        # Call the hook 
    13661382        self.redraw(dc) 
    1367         # Clear the idle flag. 
    1368         self._needRedraw = False 
    13691383#-      if self.Application.Platform == "Win": 
    13701384#-          print "REFRESH", time.time() 
     
    14721486        """ 
    14731487        return None 
     1488         
    14741489 
    14751490    def _jiggleFontSize(self): 
     
    14791494        self.FontSize -= 1 
    14801495        self.Thaw() 
     1496         
    14811497 
    14821498    def _onFontPropsChanged(self, evt):