Changeset 4228

Show
Ignore:
Timestamp:
07/04/08 09:59:30 (2 months ago)
Author:
ed
Message:

Added the Borderless property. When True, the dialog will have no title bar or border.

Files:

Legend:

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

    r4220 r4228  
    2424        self._centered = True 
    2525        self._fit = True 
    26  
    27         defaultStyle = wx.DEFAULT_DIALOG_STYLE 
     26        self._borderless = self._extractKey((properties, kwargs), "Borderless", False) 
     27 
     28        if self._borderless: 
     29            defaultStyle = wx.STAY_ON_TOP 
     30        else: 
     31            defaultStyle = wx.DEFAULT_DIALOG_STYLE 
    2832        try: 
    2933            kwargs["style"] = kwargs["style"] | defaultStyle 
     
    132136 
    133137 
     138    def _getBorderless(self): 
     139        return self._borderless 
     140 
     141    def _setBorderless(self, val): 
     142        if self._constructed(): 
     143            raise ValueError, _("Cannot set the Borderless property once the dialog is created.") 
     144        else: 
     145            self._properties["Borderless"] = val 
     146 
     147 
    134148    def _getCaption(self): 
    135149        return self.GetTitle() 
     
    163177 
    164178    AutoSize = property(_getAutoSize, _setAutoSize, None, 
    165             "When True, the dialog resizes to fit the added controls.  (bool)") 
     179            _("When True, the dialog resizes to fit the added controls.  (bool)")) 
     180 
     181    Borderless = property(_getBorderless, _setBorderless, None, 
     182            _("""Must be passed at construction time. When set to True, the dialog displays  
     183            without a title bar or borders  (bool)""")) 
    166184 
    167185    Caption = property(_getCaption, _setCaption, None, 
    168             "The text that appears in the dialog's title bar  (str)"
     186            _("The text that appears in the dialog's title bar  (str)")
    169187 
    170188    Centered = property(_getCentered, _setCentered, None, 
    171             "Determines if the dialog is displayed centered on the screen.  (bool)"
     189            _("Determines if the dialog is displayed centered on the screen.  (bool)")
    172190 
    173191    Modal = property(_getModal, _setModal, None, 
    174             "Determines if the dialog is shown modal (default) or modeless.  (bool)"
     192            _("Determines if the dialog is shown modal (default) or modeless.  (bool)")
    175193     
    176194