Changeset 5972

Show
Ignore:
Timestamp:
09/01/2010 05:15:43 AM (1 year ago)
Author:
ed
Message:

Removed trailing whitespace in these files. No coding/logic changes.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/dabo/ui/uiwx/dDialog.py

    r5968 r5972  
    3737 
    3838        preClass = wx.PreDialog 
    39         fm.dFormMixin.__init__(self, preClass, parent, properties=properties,  
     39        fm.dFormMixin.__init__(self, preClass, parent, properties=properties, 
    4040                *args, **kwargs) 
    4141 
     
    7676    def showModal(self): 
    7777        """Show the dialog modally.""" 
    78         ## pkm: We had to override this, because the default in dPemMixin doesn't  
     78        ## pkm: We had to override this, because the default in dPemMixin doesn't 
    7979        ##      actually result in a modal dialog. 
    8080        self.Modal = True 
     
    9797    def show(self): 
    9898        # Call _afterShow() once immediately, and then once after the dialog is visible, which 
    99         # will correct minor mistakes such as the height of wordwrapped labels not being  
     99        # will correct minor mistakes such as the height of wordwrapped labels not being 
    100100        # accounted for. If we only called it after the dialog was already shown, then we 
    101101        # risk the dialog being too jumpy. 
     
    106106            return {wx.ID_OK: kons.DLG_OK, wx.ID_CANCEL: kons.DLG_CANCEL}.get(ret, ret) 
    107107        return self.Show(True) 
    108          
     108 
    109109 
    110110 
    111111    def _addControls(self): 
    112         """Any controls that need to be added to the dialog  
     112        """Any controls that need to be added to the dialog 
    113113        can be added in this method in framework classes, or 
    114114        in addControls() in instances. 
     
    190190    def _setModal(self, val): 
    191191        self._modal = val 
    192      
     192 
    193193 
    194194    def _getShowStat(self): 
     
    202202 
    203203    Borderless = property(_getBorderless, _setBorderless, None, 
    204             _("""Must be passed at construction time. When set to True, the dialog displays  
     204            _("""Must be passed at construction time. When set to True, the dialog displays 
    205205            without a title bar or borders  (bool)""")) 
    206206 
     
    213213    Modal = property(_getModal, _setModal, None, 
    214214            _("Determines if the dialog is shown modal (default) or modeless.  (bool)")) 
    215      
     215 
    216216 
    217217    DynamicAutoSize = makeDynamicProperty(AutoSize) 
     
    222222 
    223223class dStandardButtonDialog(dDialog): 
    224     """Creates a dialog with standard buttons and associated functionality. You can  
    225     choose the buttons that display by passing True for any of the following  
     224    """Creates a dialog with standard buttons and associated functionality. You can 
     225    choose the buttons that display by passing True for any of the following 
    226226    properties: 
    227      
     227 
    228228        OK 
    229229        Cancel 
     
    235235    you must specify them all; in other words, OK is only assumed if nothing is specified. 
    236236    Then add your custom controls in the addControls() hook method, and respond to 
    237     the pressing of the standard buttons in the run*() handlers, where * is the name of the  
    238     associated property (e.g., runOK(), runOo(), etc.). You can query the Accepted property  
    239     to find out if the user pressed "OK" or "Yes"; if neither of these was pressed,  
     237    the pressing of the standard buttons in the run*() handlers, where * is the name of the 
     238    associated property (e.g., runOK(), runOo(), etc.). You can query the Accepted property 
     239    to find out if the user pressed "OK" or "Yes"; if neither of these was pressed, 
    240240    Accepted will be False. 
    241241    """ 
     
    271271        no = self._no 
    272272        help = self._help 
    273         if (ok is None and cancel is None and yes is None and  
     273        if (ok is None and cancel is None and yes is None and 
    274274                no is None and help is None): 
    275275            ok = True 
    276          
     276 
    277277        flags = 0 
    278278        if ok: 
     
    333333        # Force the escape button to be set appropriately: 
    334334        self.CancelOnEscape = self.CancelOnEscape 
    335              
     335 
    336336        # Wx rearranges the order of the buttons per platform conventions, but 
    337337        # doesn't rearrange the tab order for us. So, we do it manually: 
     
    376376 
    377377    ################################################ 
    378     #    Handlers for the standard buttons.  
     378    #    Handlers for the standard buttons. 
    379379    ################################################ 
    380     # Note that onOK() and  
    381     # onCancel() are the names of the old event handlers, and  
     380    # Note that onOK() and 
     381    # onCancel() are the names of the old event handlers, and 
    382382    # code has been written to use these. So as not to break this 
    383383    # older code, we issue a deprecation warning and call the 
     
    388388            self.onOK() 
    389389        except TypeError: 
    390             warnings.warn(_("The onOK() handler is deprecated. Use the runOK() method instead"),  
     390            warnings.warn(_("The onOK() handler is deprecated. Use the runOK() method instead"), 
    391391                Warning) 
    392392            self.onOK(None) 
     
    402402            self.onCancel() 
    403403        except TypeError: 
    404             warnings.warn(_("The onCancel() handler is deprecated. Use the runCancel() method instead"),  
     404            warnings.warn(_("The onCancel() handler is deprecated. Use the runCancel() method instead"), 
    405405                Warning) 
    406406            self.onCancel(None) 
     
    408408            # New code should not have onCancel 
    409409            pass 
    410          
     410 
    411411        if self.runCancel() is not False: 
    412412            self.EndModal(kons.DLG_CANCEL) 
     
    436436    ################################################ 
    437437 
    438      
     438 
    439439    def addControls(self): 
    440         """Use this method to add controls to the dialog. The standard buttons will be added  
     440        """Use this method to add controls to the dialog. The standard buttons will be added 
    441441        after this method runs, so that they appear at the bottom of the dialog. 
    442442        """ 
    443443        pass 
    444      
    445      
     444 
     445 
    446446    def addControlSequence(self, seq): 
    447         """This takes a sequence of 3-tuples or 3-lists, and adds controls  
     447        """This takes a sequence of 3-tuples or 3-lists, and adds controls 
    448448        to the dialog as a grid of labels and data controls. The first element of 
    449449        the list/tuple is the prompt, the second is the data type, and the third 
     
    470470        self.Sizer.insert(self.LastPositionInSizer, gs, "x") 
    471471        self.layout() 
    472          
    473          
     472 
     473 
    474474    def _getAccepted(self): 
    475         return self._accepted       
     475        return self._accepted 
    476476 
    477477    def _setAccepted(self, val): 
    478478        self._accepted = val 
    479      
    480      
     479 
     480 
    481481    def _getButtonSizer(self): 
    482482        return getattr(self, "stdButtonSizer", None) 
     
    509509    def _getHelpButton(self): 
    510510        return self.btnHelp 
    511          
     511 
    512512 
    513513    def _getOKButton(self): 
    514514        return self.btnOK 
    515          
     515 
    516516 
    517517    def _getNoButton(self): 
    518518        return self.btnNo 
    519          
     519 
    520520 
    521521    def _getYesButton(self): 
    522522        return self.btnYes 
    523          
     523 
    524524 
    525525    Accepted = property(_getAccepted, _setAccepted, None, 
     
    534534    CancelButton = property(_getCancelButton, None, None, 
    535535            _("Reference to the Cancel button on the form, if present  (dButton or None).")) 
    536      
     536 
    537537    CancelOnEscape = property(_getCancelOnEscape, _setCancelOnEscape, None, 
    538             _("""When True (default), pressing the Escape key will perform the same action  
    539             as clicking the Cancel button. If no Cancel button is present but there is a No button,  
    540             the No behavior will be executed. If neither button is present, the default button's  
     538            _("""When True (default), pressing the Escape key will perform the same action 
     539            as clicking the Cancel button. If no Cancel button is present but there is a No button, 
     540            the No behavior will be executed. If neither button is present, the default button's 
    541541            action will be executed  (bool)""")) 
    542542 
    543543    HelpButton = property(_getHelpButton, None, None, 
    544544            _("Reference to the Help button on the form, if present  (dButton or None).")) 
    545      
     545 
    546546    NoButton = property(_getNoButton, None, None, 
    547547            _("Reference to the No button on the form, if present  (dButton or None).")) 
    548      
     548 
    549549    OKButton = property(_getOKButton, None, None, 
    550550            _("Reference to the OK button on the form, if present  (dButton or None).")) 
    551      
     551 
    552552    YesButton = property(_getYesButton, None, None, 
    553553            _("Reference to the Yes button on the form, if present  (dButton or None).")) 
    554      
    555      
     554 
     555 
    556556 
    557557class dOkCancelDialog(dStandardButtonDialog): 
     
    606606        self.Bottom = min(self.Bottom, maxH-5) 
    607607        super(_FloatDialog, self).show() 
    608          
     608 
    609609 
    610610    def _getAbove(self): 
  • trunk/dabo/ui/uiwx/dForm.py

    r5971 r5972  
    1818    """Creates a bizobj-aware form. 
    1919 
    20     dForm knows how to handle one or more dBizobjs, providing proxy methods  
     20    dForm knows how to handle one or more dBizobjs, providing proxy methods 
    2121    like next(), last(), save(), and requery(). 
    2222    """ 
     
    2424        self.bizobjs = {} 
    2525        self._primaryBizobj = None 
    26          
     26 
    2727        # If this is True, a panel will be automatically added to the 
    2828        # form and sized to fill the form. 
     
    3333#       else: 
    3434#           self.mkPanel = self._extractKey((kwargs, properties), "panel", False) 
    35          
     35 
    3636        # Use this for timing queries and other long- 
    3737        # running events 
     
    4242        # or a requery is about to happen. 
    4343        self._checkForChanges = True 
    44          
     44 
    4545        fm.dFormMixin.__init__(self, preClass, parent, properties, attProperties, *args, **kwargs) 
    4646 
     
    4949#           # applied at that point. 
    5050#           self.mainPanel.BackColor = self.BackColor 
    51          
     51 
    5252        # Used to override some cases where the status 
    5353        # text should be displayed despite other processes 
     
    6161        if "UseSizers" in props and not hasattr(self, "UseSizers"): 
    6262            del props["UseSizers"] 
    63          
    64          
     63 
     64 
    6565    def _afterInit(self): 
    6666        self.Sizer = dabo.ui.dSizer("vertical") 
     
    7373        if self.RequeryOnLoad: 
    7474            dabo.ui.callAfter(self.requery) 
    75      
    76      
     75 
     76 
    7777    def _beforeClose(self, evt=None): 
    7878        """ See if there are any pending changes in the form, if the 
    79         form is set for checking for this. If everything's OK, call the  
     79        form is set for checking for this. If everything's OK, call the 
    8080        hook method. 
    8181        """ 
     
    8787            ret = super(BaseForm, self)._beforeClose(evt) 
    8888        return ret 
    89          
    90          
     89 
     90 
    9191    def notifyUser(self, msg, title=None, severe=False, exception=None): 
    9292        """ Displays an alert messagebox for the user. You can customize 
     
    105105 
    106106    def update(self, interval=None): 
    107         """Updates the contained controls with current values from the source.  
     107        """Updates the contained controls with current values from the source. 
    108108 
    109109        This method is called repeatedly from many different places during 
     
    112112        can change that to suit your app needs by passing a different interval 
    113113        in milliseconds. 
    114          
    115         Sometimes, though, you want to force immediate execution of the  
     114 
     115        Sometimes, though, you want to force immediate execution of the 
    116116        update. In these cases, pass an interval of 0 to this method, which 
    117117        means don't wait; execute now. 
     
    125125    def __update(self): 
    126126        super(BaseForm, self).update() 
    127          
    128          
     127 
     128 
    129129    def confirmChanges(self, bizobjs=None): 
    130130        """Ask the user if they want to save changes, discard changes, or cancel. 
     
    132132        The user will be queried if the form's CheckForChanges property is True, and 
    133133        if there are any pending changes on the form's bizobjs as specified in either 
    134         the 'bizobjs' parameter, or, if no parameter is sent, the return value of  
     134        the 'bizobjs' parameter, or, if no parameter is sent, the return value of 
    135135        getBizobjsToCheck(). 
    136136 
    137137        If all the above are True, the dialog will be presented. "Yes" will cause 
    138         all changes to be saved. "No" will discard any changes before proceeding  
     138        all changes to be saved. "No" will discard any changes before proceeding 
    139139        with the operation that caused confirmChanges() to be called in the first 
    140140        place (e.g. a requery() or the form being closed). "Cancel" will not save 
    141141        any changes, but also cancel the requery or form close. 
    142          
     142 
    143143        See also: getBizobjsToCheck() method, CheckForChanges property. 
    144144        """ 
     
    153153            bizList = bizobjs 
    154154        changedBizList = [] 
    155          
     155 
    156156        for biz in bizList: 
    157157            if biz and biz.isAnyChanged(): 
    158158                changedBizList.append(biz) 
    159              
     159 
    160160        if changedBizList: 
    161161            queryMessage = self.getConfirmChangesQueryMessage(changedBizList) 
     
    172172                        self.cancel(dataSource=biz.DataSource) 
    173173        return True 
    174      
     174 
    175175 
    176176    def getConfirmChangesQueryMessage(self, changedBizList): 
     
    178178 
    179179        The default is to return "Do you wish to save your changes?". Subclasses 
    180         can override with whatever message they want, possibly iterating the  
     180        can override with whatever message they want, possibly iterating the 
    181181        changed bizobj list to introspect the exact changes made to construct the 
    182182        message. 
     
    188188        """Return the list of bizobj's to check for changes during confirmChanges(). 
    189189 
    190         The default behavior is to simply check the primary bizobj, however there  
    191         may be cases in subclasses where a different bizobj may be checked, or even  
    192         several. In those cases, override   this method and return a list of the  
     190        The default behavior is to simply check the primary bizobj, however there 
     191        may be cases in subclasses where a different bizobj may be checked, or even 
     192        several. In those cases, override   this method and return a list of the 
    193193        required bizobjs. 
    194194        """ 
    195195        return (self.PrimaryBizobj, ) 
    196          
    197          
     196 
     197 
    198198    def addBizobj(self, bizobj): 
    199199        """ Add a bizobj to this form. 
    200200 
    201         Make the bizobj the form's primary bizobj if it is the first bizobj to  
     201        Make the bizobj the form's primary bizobj if it is the first bizobj to 
    202202        be added. For convenience, return the bizobj to the caller 
    203203        """ 
     
    224224            # Running in preview or some other non-live mode 
    225225            return 
    226         return self._moveRecordPointer(bizobj.moveToRowNumber, dataSource=bizobj,  
     226        return self._moveRecordPointer(bizobj.moveToRowNumber, dataSource=bizobj, 
    227227                rowNumber=rowNumber) 
    228228 
     
    261261            if biz.RowNumber != oldRowNum: 
    262262                # Notify listeners that the row number changed: 
    263                 dabo.ui.callAfter(self.raiseEvent, dEvents.RowNumChanged,  
     263                dabo.ui.callAfter(self.raiseEvent, dEvents.RowNumChanged, 
    264264                        newRowNumber=biz.RowNumber, oldRowNumber=oldRowNum, 
    265265                        bizobj=biz) 
     
    328328        self._moveRecordPointer(bizobj.next, dataSource) 
    329329        self.afterNext() 
    330          
     330 
    331331 
    332332    def filter(self, dataSource=None, fld=None, expr=None, op="="): 
     
    356356            return 
    357357        self._moveRecordPointer(bizobj.removeFilter, dataSource) 
    358          
     358 
    359359 
    360360    def removeFilters(self, dataSource=None): 
     
    366366            return 
    367367        self._moveRecordPointer(bizobj.removeFilters, dataSource) 
    368          
     368 
    369369 
    370370    def save(self, dataSource=None): 
     
    386386            else: 
    387387                bizobj.save() 
    388                  
     388 
    389389            self.setStatusText(_("Changes to %s saved.") % ( 
    390390                    self.SaveAllRows and "all records" or "current record",)) 
    391                      
     391 
    392392        except dException.ConnectionLostException, e: 
    393393            msg = self._connectionLostMsg(ustr(e)) 
     
    399399            self.setStatusText(_("Nothing to save!")) 
    400400            return True 
    401              
     401 
    402402        except (dException.BusinessRuleViolation, dException.DBQueryException), e: 
    403403            self.setStatusText(_("Save failed.")) 
     
    410410        self.refresh() 
    411411        return True 
    412      
    413      
     412 
     413 
    414414    def cancel(self, dataSource=None, ignoreNoRecords=None): 
    415415        """ Ask the bizobj to cancel its changes. 
     
    482482            self.stopWatch.Pause() 
    483483            elapsed = round(self.stopWatch.Time()/1000.0, 3) 
    484              
     484 
    485485            self.update() 
    486486#           del busy 
     
    525525        self.refresh() 
    526526        return ret 
    527          
     527 
    528528 
    529529    def delete(self, dataSource=None, message=None, prompt=True): 
     
    541541 
    542542        self.activeControlValid() 
    543          
     543 
    544544        if not bizobj.RowCount > 0: 
    545545            # Nothing to delete! 
    546546            self.setStatusText(_("Nothing to delete!")) 
    547547            return 
    548              
     548 
    549549        err = self.beforeDelete() 
    550550        if err: 
     
    604604        self.update() 
    605605        self.refresh() 
    606          
     606 
    607607 
    608608    def new(self, dataSource=None): 
     
    614614            return 
    615615        self.activeControlValid() 
    616          
     616 
    617617        err = self.beforeNew() 
    618618        if err: 
    619619            self.notifyUser(err) 
    620             return      
     620            return 
    621621 
    622622        try: 
    623623            bizobj.new() 
    624624        except dException.dException, e: 
    625             self.notifyUser(_("Add new record failed with response:\n\n%s") % e,  
     625            self.notifyUser(_("Add new record failed with response:\n\n%s") % e, 
    626626                    severe=True, exception=e) 
    627627 
     
    635635        self.update() 
    636636        self.refresh() 
    637          
     637 
    638638 
    639639    def afterNew(self): pass 
     
    648648        """ Set the SQL for the bizobj.""" 
    649649        self.getBizobj(dataSource).setSQL(sql) 
    650          
     650 
    651651 
    652652    def _connectionLostMsg(self, err): 
     
    658658 
    659659    def getBizobj(self, dataSource=None, parentBizobj=None): 
    660         """ Return the bizobj with the passed dataSource. If no  
     660        """ Return the bizobj with the passed dataSource. If no 
    661661        dataSource is passed, getBizobj() will return the primary bizobj. 
    662662        """ 
    663663        if not parentBizobj and not dataSource: 
    664664            return self.PrimaryBizobj 
    665          
     665 
    666666        if not parentBizobj and self.bizobjs.has_key(dataSource): 
    667667            return self.bizobjs[dataSource] 
    668          
     668 
    669669        if isinstance(dataSource, dabo.biz.dBizobj): 
    670670            return dataSource 
     
    675675            # controls 
    676676            return self 
    677          
     677 
    678678        # See if it is the RegID of a registered control 
    679679        reg = self.getObjectByRegID(dataSource) 
     
    702702            # if we got here, none were found 
    703703            return None 
    704              
     704 
    705705 
    706706    def onFirst(self, evt): self.first() 
     
    770770 
    771771    def validateField(self, ctrl): 
    772         """Call the bizobj for the control's DataSource. If the control's  
    773         value is rejected for field validation reasons, a  
     772        """Call the bizobj for the control's DataSource. If the control's 
     773        value is rejected for field validation reasons, a 
    774774        BusinessRuleViolation exception will be raised, and the form 
    775775        can then respond to this. 
     
    808808    def onFieldValidationFailed(self, ctrl, ds, df, val, err): 
    809809        """Basic handling of field-level validation failure. You should 
    810         override it with your own code to handle this failure  
     810        override it with your own code to handle this failure 
    811811        appropriately for your application. 
    812812        """ 
     
    814814        dabo.ui.callAfter(ctrl.setFocus) 
    815815        self._fieldValidationControl = ctrl 
    816          
    817      
     816 
     817 
    818818    def onFieldValidationPassed(self, ctrl, ds, df, val): 
    819         """Basic handling when field-level validation succeeds.  
    820         You should override it with your own code to handle this event  
     819        """Basic handling when field-level validation succeeds. 
     820        You should override it with your own code to handle this event 
    821821        appropriately for your application. 
    822822        """ 
    823823        pass 
    824          
    825      
     824 
     825 
    826826    # Property get/set/del functions follow. 
    827827    def _getCheckForChanges(self): 
    828828        return self._checkForChanges 
    829              
     829 
    830830    def _setCheckForChanges(self, value): 
    831831        self._checkForChanges = bool(value) 
    832          
     832 
    833833 
    834834    def _getPrimaryBizobj(self): 
     
    847847                self._primaryBizobj = bo 
    848848        return bo 
    849          
     849 
    850850    def _setPrimaryBizobj(self, bizOrDataSource): 
    851851        if isinstance(bizOrDataSource, dabo.biz.dBizobj): 
     
    878878        except AttributeError: 
    879879            return True 
    880              
     880 
    881881    def _setSaveAllRows(self, value): 
    882882        self._SaveAllRows = bool(value) 
     
    884884 
    885885    # Property definitions: 
    886     CheckForChanges = property(_getCheckForChanges, _setCheckForChanges, None,  
     886    CheckForChanges = property(_getCheckForChanges, _setCheckForChanges, None, 
    887887            _("""Specifies whether the user is prompted to save or discard changes. (bool) 
    888888 
    889889            If True (the default), when operations such as requery() or the closing 
    890890            of the form are about to occur, the user will be presented with a dialog 
    891             box asking whether to save changes, discard changes, or cancel the  
     891            box asking whether to save changes, discard changes, or cancel the 
    892892            operation that led to the dialog being presented.""") ) 
    893893 
    894     PrimaryBizobj = property(_getPrimaryBizobj, _setPrimaryBizobj, None,  
     894    PrimaryBizobj = property(_getPrimaryBizobj, _setPrimaryBizobj, None, 
    895895            _("Reference to the primary bizobj for this form  (dBizobj)") ) 
    896896 
    897897    RequeryOnLoad = property(_getRequeryOnLoad, _setRequeryOnLoad, None, 
    898             _("""Specifies whether an automatic requery happens when the  
     898            _("""Specifies whether an automatic requery happens when the 
    899899            form is loaded.  (bool)""")) 
    900900 
    901     SaveAllRows = property(_getSaveAllRows, _setSaveAllRows, None,  
     901    SaveAllRows = property(_getSaveAllRows, _setSaveAllRows, None, 
    902902            _("Specifies whether dataset is row- or table-buffered. (bool)") ) 
    903903 
     
    955955    def _getVisible(self): 
    956956        return self.IsShown() 
    957      
     957 
    958958    def _setVisible(self, val): 
    959959        if self._constructed(): 
     
    984984            _("Specifies whether the form is shown or hidden.  (bool)") ) 
    985985 
    986      
     986 
    987987 
    988988class dToolForm(BaseForm, wx.MiniFrame): 
     
    993993        style = kwargs.get("style", 0) 
    994994        kwargs["style"] = style | wx.RESIZE_BORDER | wx.CAPTION | wx.MINIMIZE_BOX | \ 
    995                 wx.MAXIMIZE_BOX | wx.CLOSE_BOX      
     995                wx.MAXIMIZE_BOX | wx.CLOSE_BOX 
    996996        kwargs["TinyTitleBar"] = True 
    997997        kwargs["ShowStatusBar"] = False 
     
    10151015        preClass = wx.PreFrame 
    10161016        BaseForm.__init__(self, preClass, parent, properties, attProperties, *args, **kwargs) 
    1017      
     1017 
    10181018    def Show(self, show=True, *args, **kwargs): 
    10191019        self._gtk_show_fix(show) 
     
    10281028    def onDeactivate(self, evt): 
    10291029        print _("Deactivate") 
    1030                      
     1030 
    10311031class _dBorderlessForm_test(dBorderlessForm): 
    10321032    def afterInit(self): 
     
    10361036        self.btn.bindEvent(dEvents.Hit, self.close) 
    10371037        dabo.ui.callAfter(self.setSize) 
    1038      
     1038 
    10391039    def setSize(self): 
    10401040        self.Width, self.Height = self.btn.Width+60, self.btn.Height+60 
    10411041        self.layout() 
    10421042        self.Centered = True 
    1043          
    1044          
    1045                      
     1043 
     1044 
     1045 
    10461046if __name__ == "__main__": 
    10471047    import test 
  • trunk/dabo/ui/uiwx/dFormMain.py

    r5050 r5972  
    1313    def __init__(self, preClass, parent=None, properties=None, *args, **kwargs): 
    1414        fm.dFormMixin.__init__(self, preClass, parent, properties, *args, **kwargs) 
    15      
     15 
    1616 
    1717    def _beforeClose(self, evt=None): 
     
    2121            frm = forms2close[0] 
    2222            # This will allow forms to veto closing (i.e., user doesn't 
    23             # want to save pending changes).  
     23            # want to save pending changes). 
    2424            if frm.close() == False: 
    2525                # The form stopped the closing process. The user 
    26                 # must deal with this form (save changes, etc.)  
     26                # must deal with this form (save changes, etc.) 
    2727                # before the app can exit. 
    2828                frm.bringToFront() 
     
    3131                forms2close.remove(frm) 
    3232 
    33      
     33 
    3434 
    3535 
  • trunk/dabo/ui/uiwx/dFormMixin.py

    r5970 r5972  
    1717 
    1818class dFormMixin(pm.dPemMixin): 
    19     def __init__(self, preClass, parent=None, properties=None, attProperties=None,  
     19    def __init__(self, preClass, parent=None, properties=None, attProperties=None, 
    2020            src=None, *args, **kwargs): 
    2121        self._cxnName = "" 
     
    2727        self._drawSizerChildren = False 
    2828        self._statusBarClass = dabo.ui.dStatusBar 
    29          
     29 
    3030        # Extract the menu definition file, if any 
    31         self._menuBarFile = self._extractKey((properties, attProperties, kwargs),  
     31        self._menuBarFile = self._extractKey((properties, attProperties, kwargs), 
    3232                "MenuBarFile", "") 
    3333        if self._menuBarFile: 
    3434            self._menuBarClass = self._menuBarFile 
    35          
     35 
    3636        if False and parent: 
    3737            ## pkm 3/10/05: I like it better now without the float on parent option 
     
    5858        # When in designer mode, we need to turn off various behaviors. 
    5959        self._designerMode = False 
    60         # Default behavior used to be for the form to set the status bar text with the  
     60        # Default behavior used to be for the form to set the status bar text with the 
    6161        # current record position. Now we only turn it on for data apps. 
    6262        self._autoUpdateStatusText = False 
     
    7272        self._fieldValidationControl = None 
    7373 
    74         super(dFormMixin, self).__init__(preClass, parent, properties,  
     74        super(dFormMixin, self).__init__(preClass, parent, properties, 
    7575                attProperties, *args, **kwargs) 
    7676 
    7777        dabo.ui.callAfter(self._createStatusBar) 
    78         self._createToolBar()   
    79         if not self._designerMode:  
     78        self._createToolBar() 
     79        if not self._designerMode: 
    8080            self.restoreSizeAndPosition() 
    8181 
    8282 
    8383    def _getInitPropertiesList(self): 
    84         additional = ["BorderResizable", "FloatOnParent", "ShowCloseButton", "ShowInTaskBar",  
     84        additional = ["BorderResizable", "FloatOnParent", "ShowCloseButton", "ShowInTaskBar", 
    8585                "ShowMaxButton", "ShowMinButton", "ShowSystemMenu", "StayOnTop", "TinyTitleBar"] 
    8686        original = list(super(dFormMixin, self)._getInitPropertiesList()) 
    8787        return tuple(original + additional) 
    88          
     88 
    8989 
    9090    def _afterInit(self): 
     
    109109        if app is not None: 
    110110            app.uiForms.add(self) 
    111          
     111 
    112112        # Centering information 
    113113        self._normLeft = self.Left 
     
    126126        # If there are custom menu hotkey bindings, re-set them 
    127127        wx.CallAfter(self._restoreMenuPrefs) 
    128          
     128 
    129129        super(dFormMixin, self)._afterInit() 
    130130 
    131131        ## pkm 2010-08-03: The below results in smoother, nicer forms (no menu flickering or 
    132         ##                 other weird artifacts like page tabs partially disappearing),  
    133         ##                 however there are reports of python.exe maxing out the CPU and the  
    134         ##                 process needing to be killed by the user. My testing was with  
     132        ##                 other weird artifacts like page tabs partially disappearing), 
     133        ##                 however there are reports of python.exe maxing out the CPU and the 
     134        ##                 process needing to be killed by the user. My testing was with 
    135135        ##                 Python 2.5.4 / wx 2.8.11.0 / Windows Vista. Perhaps we just need to 
    136136        ##                 play around with where we make this call, or set double buffered off 
    137137        ##                 every now and then with a timer or something... 
    138138        ##self.SetDoubleBuffered(True) 
    139      
    140      
     139 
     140 
    141141    def _initEvents(self): 
    142142        super(dFormMixin, self)._initEvents() 
     
    147147        self.bindEvent(dEvents.Paint, self.__onPaint) 
    148148        self.bindEvent(dEvents.Idle, self.__onIdle) 
    149      
    150          
     149 
     150 
    151151    def __onWxClose(self, evt): 
    152152        self.raiseEvent(dEvents.Close, evt) 
    153153        if evt.CanVeto(): 
    154154            evt.Veto() 
    155          
    156          
     155 
     156 
    157157    def __onWxActivate(self, evt): 
    158158        """ Raise the Dabo Activate or Deactivate appropriately.""" 
     
    172172            # Clear it 
    173173            self._fieldValidationControl = None 
    174              
    175              
     174 
     175 
    176176    def Maximize(self, maximize=True, *args, **kwargs): 
    177177        # On Mac MDI Child Frames, Maximize(False) erroneously maximizes. Not sure 
     
    186186    def SetPosition(self, val): 
    187187        # On Windows MDI Child frames when the main form has a toolbar, setting the 
    188         # top position results in a position too low by the height of the toolbar.  
     188        # top position results in a position too low by the height of the toolbar. 
    189189        left, top = val 
    190190        tb = None 
     
    194194                and self.MDI \ 
    195195                and tb: 
    196             top -= tb.Height  
     196            top -= tb.Height 
    197197        super(dFormMixin, self).SetPosition((left, top)) 
    198198 
     
    209209    def _createStatusBar(self): 
    210210        modal = getattr(self, "Modal", False) 
    211         if (self and self.ShowStatusBar  
     211        if (self and self.ShowStatusBar 
    212212                and self.StatusBar is None 
    213213                and not isinstance (self, wx.Dialog) 
     
    222222            self.Application.clearActiveForm(self) 
    223223 
    224      
     224 
    225225    def __onPaint(self, evt): 
    226226        if self.Application: 
     
    228228        else: 
    229229            self.__needOutlineRedraw = False 
    230      
    231      
     230 
     231 
    232232    def __onIdle(self, evt): 
    233233        if self.__needOutlineRedraw or self._alwaysDrawSizerOutlines: 
     
    235235                sz.drawOutline(self, recurse=self._recurseOutlinedSizers, 
    236236                        drawChildren=self._drawSizerChildren) 
    237      
    238      
     237 
     238 
    239239    def __onClose(self, evt): 
    240240        app = self.Application 
    241241 
    242         if not self._designerMode:  
     242        if not self._designerMode: 
    243243            self.saveSizeAndPosition() 
    244244 
     
    250250            # Run the cleanup code. 
    251251            self.closing() 
    252          
     252 
    253253        self._isClosed = True 
    254254        if self._isModal: 
     
    256256 
    257257        # On the Mac, this next line prevents Bus Errors when closing a form. 
    258         self.Visible = False    
     258        self.Visible = False 
    259259 
    260260        if app is not None: 
     
    265265        """ Force the control-with-focus to fire its KillFocus code. 
    266266 
    267         The bizobj will only get its field updated during the control's  
     267        The bizobj will only get its field updated during the control's 
    268268        KillFocus code. This function effectively commands that update to 
    269269        happen before it would have otherwise occurred. 
     
    284284        can change that to suit your app needs by passing a different interval 
    285285        in milliseconds. 
    286          
    287         Sometimes, though, you want to force immediate execution of the  
     286 
     287        Sometimes, though, you want to force immediate execution of the 
    288288        refresh. In these cases, pass an interval of 0 to this method, which 
    289289        means don't wait; execute now. 
     
    349349            for pth in relPath.split("."): 
    350350                try: 
    351                     menuItem = [ch for ch in menuItem.Children  
     351                    menuItem = [ch for ch in menuItem.Children 
    352352                            if hasattr(ch, "Caption") 
    353353                            and cleanMenuCaption(ch.Caption) == pth][0] 
     
    360360                    menuItem.HotKey = hk 
    361361 
    362      
     362 
    363363    def _gtk_show_fix(self, show=True): 
    364364        # On Gtk, in wxPython 2.8.1.1 at least, the form will get re-shown at its 
     
    378378        """Shows the form in a modal fashion. Other forms can still be 
    379379        activated, but all controls are disabled. 
    380         NOTE: wxPython does not currently support this. DO NOT USE  
     380        NOTE: wxPython does not currently support this. DO NOT USE 
    381381        this method. 
    382382        """ 
    383383        raise dException.FeatureNotSupportedException( 
    384384                _("The underlying UI toolkit does not support modal forms. Use a dDialog instead.")) 
    385          
    386          
     385 
     386 
    387387    def release(self): 
    388388        """ Instead of just destroying the object, make sure that 
     
    396396        the beforeClose methods will be called, and these will have 
    397397        an opportunity to conditionally block the form from closing. 
    398         If force=True, the form is closed without any chance of  
     398        If force=True, the form is closed without any chance of 
    399399        preventing it. 
    400400        """ 
     
    416416        if self: 
    417417            self.Destroy() 
    418          
     418 
    419419 
    420420    def _beforeClose(self, evt=None): 
    421421        """ See if there are any pending changes in the form, if the 
    422         form is set for checking for this. If everything's OK, call the  
     422        form is set for checking for this. If everything's OK, call the 
    423423        hook method. 
    424424        """ 
     
    427427        ret = self.beforeClose(evt) 
    428428        return ret 
    429          
    430          
     429 
     430 
    431431    def beforeClose(self, evt): 
    432         """ Hook method. Returning False will prevent the form from  
     432        """ Hook method. Returning False will prevent the form from 
    433433        closing. Gives you a chance to determine the status of the form 
    434434        to see if changes need to be saved, etc. 
    435435        """ 
    436436        return True 
    437          
    438          
     437 
     438 
    439439    def closing(self): 
    440440        """ Stub method to be customized in subclasses. At this point, 
    441441        the form is going to close. If you need to do something that might 
    442         prevent the form from closing, code it in the beforeClose()  
     442        prevent the form from closing, code it in the beforeClose() 
    443443        method instead. 
    444444        """ 
    445445        pass 
    446          
     446 
    447447 
    448448    def afterSetMenuBar(self): 
     
    455455 
    456456        Every form maintains an internal menu of actions appropriate to itself. 
    457         For instance, a dForm with a primary bizobj will maintain a menu with  
    458         'requery', 'save', 'next', etc. choices.  
    459  
    460         This function sets up the internal menu, which can optionally be  
     457        For instance, a dForm with a primary bizobj will maintain a menu with 
     458        'requery', 'save', 'next', etc. choices. 
     459 
     460        This function sets up the internal menu, which can optionally be 
    461461        inserted into the mainForm's menu bar during SetFocus. 
    462462        """ 
    463463        menu = dMenu.dMenu() 
    464464        return menu 
    465      
    466      
     465 
     466 
    467467    def onEditUndo(self, evt): 
    468468        """If you want your form to respond to the Undo menu item in 
    469         the Edit menu that is installed in the Dabo base menu, override  
     469        the Edit menu that is installed in the Dabo base menu, override 
    470470        this method, and either return nothing, or return something other 
    471471        than False. 
    472472        """ 
    473473        return False 
    474          
    475          
     474 
     475 
    476476    def onEditRedo(self, evt): 
    477477        """If you want your form to respond to the Redo menu item in 
    478         the Edit menu that is installed in the Dabo base menu, override  
     478        the Edit menu that is installed in the Dabo base menu, override 
    479479        this method, and either return nothing, or return something other 
    480480        than False. 
    481481        """ 
    482482        return False 
    483          
    484          
     483 
     484 
    485485    def restoreSizeAndPosition(self): 
    486486        """ Restore the saved window geometry for this form. 
    487487 
    488         Ask dApp for the last saved setting of height, width, left, and top,  
     488        Ask dApp for the last saved setting of height, width, left, and top, 
    489489        and set those properties on this form. 
    490490        """ 
     
    506506        if state not in ("Minimized", "Maximized", "Normal", "FullScreen"): 
    507507            state = self.WindowState 
    508              
     508 
    509509        if state == "Minimized": 
    510510            state = "Normal" 
     
    550550                    app.setUserSetting("%s.width" % name, width) 
    551551                    app.setUserSetting("%s.height" % name, height) 
    552                  
     552 
    553553 
    554554    def setStatusText(self, *args): 
    555555        """Moved functionality to the StatusText property setter.""" 
    556556        self._setStatusText(*args) 
    557          
    558      
     557 
     558 
    559559    def layout(self): 
    560560        """ Wrap the wx sizer layout call. """ 
     
    567567        if self.Application.Platform == "Win": 
    568568            self.refresh() 
    569      
    570      
     569 
     570 
    571571    def registerObject(self, obj): 
    572572        """Stores a reference to the passed object using the RegID key 
    573         property of the object for later retrieval. You may reference the  
     573        property of the object for later retrieval. You may reference the 
    574574        object as if it were a child object of this form; i.e., by using simple 
    575         dot notation, with the RegID as the 'name' of the object.       
     575        dot notation, with the RegID as the 'name' of the object. 
    576576        """ 
    577577        if hasattr(obj, "RegID"): 
     
    587587            else: 
    588588                self.__dict__[id] = obj 
    589          
    590      
     589 
     590 
    591591    def getObjectByRegID(self, id): 
    592         """Given a RegID value, this will return a reference to the  
     592        """Given a RegID value, this will return a reference to the 
    593593        associated object, if any. If not, returns None. 
    594594        """ 
     
    597597        else: 
    598598            return None 
    599      
    600      
     599 
     600 
    601601    def _appendToMenu(self, menu, caption, function, bitmap=wx.NullBitmap, menuId=-1): 
    602602        return menu.append(caption, OnHit=function, bmp=bitmap) 
    603603 
    604604 
    605     def appendToolBarButton(self, name, pic, toggle=False, tip="", help="",  
     605    def appendToolBarButton(self, name, pic, toggle=False, tip="", help="", 
    606606            *args, **kwargs): 
    607         return self.ToolBar.appendButton(name, pic, toggle=toggle, tip=tip,  
     607        return self.ToolBar.appendButton(name, pic, toggle=toggle, tip=tip, 
    608608                help=help, *args, **kwargs) 
    609609 
     
    611611    def fillPreferenceDialog(self, dlg): 
    612612        """This method is called with a reference to the pref dialog. It can be overridden 
    613         in subclasses to add application-specific content to the pref dialog. To add a  
     613        in subclasses to add application-specific content to the pref dialog. To add a 
    614614        new page to the dialog, call the dialog's addCategory() method, passing the caption 
    615         for that page. It will return a reference to the newly-created page, to which you  
     615        for that page. It will return a reference to the newly-created page, to which you 
    616616        then add your controls. 
    617617        """ 
     
    620620 
    621621    def _setAbsoluteFontZoom(self, amt): 
    622         """Let the default behavior run, but then save the font zoom level to  
    623         the user preferences file. The loading of the saved pref happens in  
    624         the individual control (dPemMixinBase) so that the restoration of the  
    625         control's font zoom isn't dependent on the control being created at  
     622        """Let the default behavior run, but then save the font zoom level to 
     623        the user preferences file. The loading of the saved pref happens in 
     624        the individual control (dPemMixinBase) so that the restoration of the 
     625        control's font zoom isn't dependent on the control being created at 
    626626        form load time. 
    627627        """ 
    628628        self.super(amt) 
    629629        if self.Application and self.SaveRestorePosition: 
    630             self.Application.setUserSetting("%s.fontzoom"  
     630            self.Application.setUserSetting("%s.fontzoom" 
    631631                    % self.getAbsoluteName(), self._currFontZoom) 
    632632 
    633633    def _restoreFontZoom(self): 
    634634        if self.Application: 
    635             self._currFontZoom = self.Application.getUserSetting("%s.fontzoom"  
     635            self._currFontZoom = self.Application.getUserSetting("%s.fontzoom" 
    636636                    % self.getAbsoluteName(), 0) 
    637637 
     
    663663        # whether or not it is a member of this form. 
    664664        return getattr(self, "_activeControl", None) 
    665          
     665 
    666666    def _setActiveControl(self, val): 
    667667        val.setFocus() 
    668668 
    669      
     669 
    670670    def _getAutoUpdateStatusText(self): 
    671671        return self._autoUpdateStatusText 
     
    677677    def _getBorderResizable(self): 
    678678        return (self.MDI or self._hasWindowStyleFlag(wx.RESIZE_BORDER)) 
    679          
     679 
    680680    def _setBorderResizable(self, value): 
    681681        self._delWindowStyleFlag(wx.RESIZE_BORDER) 
     
    690690            v = self._centered = False 
    691691        return v 
    692          
     692 
    693693    def _setCentered(self, val): 
    694694        if self._constructed(): 
     
    809809        else: 
    810810            self._properties["MenuBar"] = val 
    811              
     811 
    812812 
    813813    def _getMenuBarClass(self): 
     
    820820    def _setMenuBarClass(self, val): 
    821821        self._menuBarClass = val 
    822          
     822 
    823823 
    824824    def _getMenuBarFile(self): 
     
    838838            val = self._saveRestorePosition = not isinstance(self, dabo.ui.dDialog) 
    839839        return val 
    840      
     840 
    841841    def _setSaveRestorePosition(self, val): 
    842842        self._saveRestorePosition = val 
     
    845845    def _getShowCaption(self): 
    846846        return self._hasWindowStyleFlag(wx.CAPTION) 
    847          
     847 
    848848    def _setShowCaption(self, value): 
    849849        self._delWindowStyleFlag(wx.CAPTION) 
     
    854854    def _getShowCloseButton(self): 
    855855        return self._hasWindowStyleFlag(wx.CLOSE_BOX) 
    856          
     856 
    857857    def _setShowCloseButton(self, value): 
    858858        self._delWindowStyleFlag(wx.CLOSE_BOX) 
     
    872872    def _getShowMaxButton(self): 
    873873        return self._hasWindowStyleFlag(wx.MAXIMIZE_BOX) 
    874          
     874 
    875875    def _setShowMaxButton(self, value): 
    876876        self._delWindowStyleFlag(wx.MAXIMIZE_BOX) 
    877877        if value: 
    878878            self._addWindowStyleFlag(wx.MAXIMIZE_BOX) 
    879              
     879 
    880880 
    881881    def _getShowMenuBar(self): 
     
    892892    def _getShowMinButton(self): 
    893893        return self._hasWindowStyleFlag(wx.MINIMIZE_BOX) 
    894          
     894 
    895895    def _setShowMinButton(self, value): 
    896896        self._delWindowStyleFlag(wx.MINIMIZE_BOX) 
     
    904904        except AttributeError: 
    905905            ret = self._showStatusBar = True 
    906         return ret  
    907          
     906        return ret 
     907 
    908908    def _setShowStatusBar(self, val): 
    909909        self._showStatusBar = bool(val) 
    910          
    911          
     910 
     911 
    912912    def _getShowSystemMenu(self): 
    913913        return self._hasWindowStyleFlag(wx.SYSTEM_MENU) 
    914          
     914 
    915915    def _setShowSystemMenu(self, value): 
    916916        self._delWindowStyleFlag(wx.SYSTEM_MENU) 
    917917        if value: 
    918918            self._addWindowStyleFlag(wx.SYSTEM_MENU) 
    919              
    920              
     919 
     920 
    921921    def _getShowToolBar(self): 
    922922        try: 
     
    926926            ret = self._showToolBar = False 
    927927        return ret 
    928          
     928 
    929929    def _setShowToolBar(self, val): 
    930         self._showToolBar = bool(val)   
     930        self._showToolBar = bool(val) 
    931931 
    932932 
     
    985985 
    986986    def _setStatusText(self, val, _callAfter=True): 
    987         """ Set the text of the status bar. Dabo will decide whether to  
     987        """ Set the text of the status bar. Dabo will decide whether to 
    988988        send the text to the main frame or this frame. This matters with MDI 
    989989        versus non-MDI forms. 
     
    10021002            statusBar = None 
    10031003 
    1004         if statusBar:   
     1004        if statusBar: 
    10051005            sb = controllingFrame.GetStatusBar() 
    10061006            sb.SetStatusText(val) 
    10071007            statusBar.Update() 
    1008              
     1008 
    10091009 
    10101010    def _getStayOnTop(self): 
     
    10291029    def _getTinyTitleBar(self): 
    10301030        return self._hasWindowStyleFlag(wx.FRAME_TOOL_WINDOW) 
    1031          
     1031 
    10321032    def _setTinyTitleBar(self, value): 
    10331033        self._delWindowStyleFlag(wx.FRAME_TOOL_WINDOW) 
    10341034        if value: 
    10351035            self._addWindowStyleFlag(wx.FRAME_TOOL_WINDOW) 
    1036              
     1036 
    10371037 
    10381038    def _getToolBar(self): 
     
    10421042            # We are probably a dialog or some other form that doesn't support ToolBars. 
    10431043            return None 
    1044          
     1044 
    10451045    def _setToolBar(self, val): 
    10461046        self.SetToolBar(val) 
    1047      
     1047 
    10481048    def _getWindowState(self): 
    10491049        try: 
     
    10871087 
    10881088    # property definitions follow: 
    1089     ActiveControl = property(_getActiveControl, _setActiveControl, None,  
     1089    ActiveControl = property(_getActiveControl, _setActiveControl, None, 
    10901090            _("Contains a reference to the active control on the form, or None.")) 
    1091      
     1091 
    10921092    AutoUpdateStatusText = property(_getAutoUpdateStatusText, _setAutoUpdateStatusText, None, 
    10931093            _("Does this form update the status text with the current record position?  (bool)")) 
     
    10981098            The default is True for dForm and False for dDialog.""")) 
    10991099 
    1100     Centered = property(_getCentered, _setCentered, None,  
     1100    Centered = property(_getCentered, _setCentered, None, 
    11011101            _("Centers the form on the screen when set to True.  (bool)")) 
    11021102 
     
    11061106    CxnName = property(_getCxnName, _setCxnName, None, 
    11071107            _("Name of the connection used for data access  (str)")) 
    1108      
     1108 
    11091109    FloatingPanel = property(_getFloatingPanel, None, None, 
    1110             _("""Small modal dialog that is designed to be used for temporary displays,  
    1111             similar to context menus, but which can contain any controls.   
     1110            _("""Small modal dialog that is designed to be used for temporary displays, 
     1111            similar to context menus, but which can contain any controls. 
    11121112            (read-only) (dDialog)""")) 
    11131113 
    11141114    FloatOnParent = property(_getFloatOnParent, _setFloatOnParent, None, 
    11151115            _("Specifies whether the form stays on top of the parent or not.")) 
    1116      
    1117     Icon = property(_getIcon, _setIcon, None,  
     1116 
     1117    Icon = property(_getIcon, _setIcon, None, 
    11181118            _("""Specifies the icon for the form. 
    11191119 
     
    11261126    MDI = property(_getMDI, None, None, 
    11271127            _("""Returns True if this is a MDI (Multiple Document Interface) form.  (bool) 
    1128      
     1128 
    11291129            Otherwise, returns False if this is a SDI (Single Document Interface) form. 
    11301130            Users on Microsoft Windows seem to expect MDI, while on other platforms SDI is 
    11311131            preferred. 
    1132              
     1132 
    11331133            See also: the dabo.MDI global setting.  (bool)""")) 
    11341134 
     
    11421142            _("Path to the .mnxml file that defines this form's menu bar  (str)")) 
    11431143 
    1144     SaveRestorePosition = property(_getSaveRestorePosition,  
     1144    SaveRestorePosition = property(_getSaveRestorePosition, 
    11451145            _setSaveRestorePosition, None, 
    11461146            _("""Specifies whether the form's position and size as set by the user 
    11471147                will get saved and restored in the next session. Default is True for 
    11481148                forms and False for dialogs.""")) 
    1149          
     1149 
    11501150    ShowCaption = property(_getShowCaption, _setShowCaption, None, 
    11511151            _("Specifies whether the caption is displayed in the title bar. (bool).")) 
     
    11761176 
    11771177    SizersToOutline = property(_getSizersToOutline, _setSizersToOutline, None, 
    1178             _("""When drawing the outline of sizers, the sizer(s) to draw.  
     1178            _("""When drawing the outline of sizers, the sizer(s) to draw. 
    11791179            Default=self.Sizer  (dSizer)""")) 
    11801180 
     
    11941194            _("""Used to indicate that this is a temporary form, and that its settings 
    11951195            should not be persisted. Default=False  (bool)""")) 
    1196      
     1196 
    11971197    TinyTitleBar = property(_getTinyTitleBar, _setTinyTitleBar, None, 
    11981198            _("Specifies whether the title bar is small, like a tool window. (bool).")) 
     
    12001200    ToolBar = property(_getToolBar, _setToolBar, None, 
    12011201            _("Tool bar for this form. (dToolBar)")) 
    1202      
     1202 
    12031203    WindowState = property(_getWindowState, _setWindowState, None, 
    12041204            _("""Specifies the current state of the form. (int) 
    1205                  
     1205 
    12061206                    Normal 
    12071207                    Minimized