Example #1
0
 def __init__(self, name, parent, id, property_window, klass='wxPanel',
              show=True, style=wx.TAB_TRAVERSAL):
     TopLevelBase.__init__(self, name, klass, parent, id,
                           property_window, show=show, has_title=False)
     PanelBase.__init__(self, style)
     self.base = 'wxPanel'
     self.skip_on_size = False
Example #2
0
 def create_properties(self):
     TopLevelBase.create_properties(self)
     prop = self.properties
     panel = wx.ScrolledWindow(self.notebook, -1, style=wx.TAB_TRAVERSAL)
     prop['title'].display(panel)
     prop['icon'].display(panel)
     prop['centered'].display(panel)
     prop['sizehints'].display(panel)
     prop['menubar'].display(panel)
     prop['toolbar'].display(panel)
     try:
         sbprop = prop['statusbar']
         sbprop.display(panel)
     except KeyError:
         sbprop = None
     prop['style'].display(panel)
     
     szr = wx.BoxSizer(wx.VERTICAL)
     szr.Add(prop['title'].panel, 0, wx.EXPAND)
     szr.Add(prop['icon'].panel, 0, wx.EXPAND)
     szr.Add(prop['centered'].panel, 0, wx.EXPAND)
     szr.Add(prop['sizehints'].panel, 0, wx.EXPAND)
     szr.Add(prop['menubar'].panel, 0, wx.EXPAND)
     szr.Add(prop['toolbar'].panel, 0, wx.EXPAND)
     if sbprop:
         szr.Add(sbprop.panel, 0, wx.EXPAND)
     szr.Add(prop['style'].panel, 0, wx.EXPAND)
     panel.SetAutoLayout(True)
     panel.SetSizer(szr)
     szr.Fit(panel)
     self.notebook.AddPage(panel, 'Widget')
     w, h = panel.GetClientSizeTuple()
     panel.SetScrollbars(5, 5, int(math.ceil(w/5.0)), int(math.ceil(h/5.0)))
Example #3
0
    def create_properties(self):
        TopLevelBase.create_properties(self)
        prop = self.properties
        panel = wx.ScrolledWindow(self.notebook, -1, style=wx.TAB_TRAVERSAL)
        prop['title'].display(panel)
        prop['icon'].display(panel)
        prop['centered'].display(panel)
        prop['sizehints'].display(panel)
        prop['menubar'].display(panel)
        prop['toolbar'].display(panel)
        try:
            sbprop = prop['statusbar']
            sbprop.display(panel)
        except KeyError:
            sbprop = None
        prop['style'].display(panel)

        szr = wx.BoxSizer(wx.VERTICAL)
        szr.Add(prop['title'].panel, 0, wx.EXPAND)
        szr.Add(prop['icon'].panel, 0, wx.EXPAND)
        szr.Add(prop['centered'].panel, 0, wx.EXPAND)
        szr.Add(prop['sizehints'].panel, 0, wx.EXPAND)
        szr.Add(prop['menubar'].panel, 0, wx.EXPAND)
        szr.Add(prop['toolbar'].panel, 0, wx.EXPAND)
        if sbprop:
            szr.Add(sbprop.panel, 0, wx.EXPAND)
        szr.Add(prop['style'].panel, 0, wx.EXPAND)
        panel.SetAutoLayout(True)
        panel.SetSizer(szr)
        szr.Fit(panel)
        self.notebook.AddPage(panel, 'Widget')
        w, h = panel.GetClientSizeTuple()
        panel.SetScrollbars(5, 5, int(math.ceil(w / 5.0)),
                            int(math.ceil(h / 5.0)))
Example #4
0
 def finish_widget_creation(self, level):
     # add menu, status and tool bar
     TopLevelBase.finish_widget_creation(self, level)
     if not self.properties['size'].is_active():
         self.widget.SetSize((400, 300))
     if wx.Platform == '__WXMSW__':
         self.widget.CenterOnScreen()
Example #5
0
 def remove(self, *args):
     if self.menubar:
         self.menubar = self.menubar.remove(gtk_do_nothing=True)
     if self.statusbar:
         self.statusbar = self.statusbar.remove(do_nothing=True)
     if self.toolbar:
         self.toolbar = self.toolbar.remove(do_nothing=True)
     TopLevelBase.remove(self, *args)
Example #6
0
 def remove(self, *args):
     if self.menubar:
         self.menubar = self.menubar.remove(gtk_do_nothing=True)
     if self.statusbar:
         self.statusbar = self.statusbar.remove(do_nothing=True)
     if self.toolbar:
         self.toolbar = self.toolbar.remove(do_nothing=True)
     TopLevelBase.remove(self, *args)
Example #7
0
    def __init__(self, name, parent, id, title, style=wx.DEFAULT_DIALOG_STYLE, klass='wxDialog'):
        TopLevelBase.__init__(self, name, klass, parent, id, title=title)
        self.properties["base"].set('wxDialog')
        EditStylesMixin.__init__(self)

        # initialise instance properties
        self.icon      = np.FileNamePropertyD("", default_value="")
        self.centered  = np.CheckBoxProperty(False)
        self.sizehints = np.CheckBoxProperty(False)
Example #8
0
 def __init__(self,
              name,
              parent,
              id,
              klass='wxPanel',
              style='wxTAB_TRAVERSAL'):
     TopLevelBase.__init__(self, name, klass, parent, id)
     PanelBase.__init__(self, style)
     self.skip_on_size = False
Example #9
0
 def remove(self, *args):
     # remove menu, status and tool bar
     if self.menubar:
         self._menubar = self._menubar.remove(gtk_do_nothing=True)
     if self.statusbar:
         self._statusbar = self._statusbar.remove(do_nothing=True)
     if self.toolbar:
         self._toolbar = self._toolbar.remove(do_nothing=True)
     TopLevelBase.remove(self, *args)
Example #10
0
    def properties_changed(self, modified):
        if not modified or "icon" in modified and self.widget: self._set_widget_icon()

        if not modified or "menubar" in modified:   self._set_menu_bar()
        if not modified or "statusbar" in modified: self._set_status_bar()
        if not modified or "toolbar" in modified:   self._set_tool_bar()

        TopLevelBase.properties_changed(self, modified)
        EditStylesMixin.properties_changed(self, modified)
Example #11
0
 def finish_widget_creation(self, level):
     # add menu, status and tool bar
     TopLevelBase.finish_widget_creation(self, level)
     if not self.properties['size'].is_active():
         self.widget.SetSize((400, 300))
     if wx.Platform == '__WXMSW__':
         self.widget.CenterOnScreen()
     if self.check_prop_truth("menubar")   and self._menubar.widget:   self.widget.SetMenuBar(self._menubar.widget)
     if self.check_prop_truth("statusbar") and self._statusbar.widget: self.widget.SetStatusBar(self._statusbar.widget)
     if self.check_prop_truth("toolbar")   and self._toolbar.widget:   self.widget.SetToolBar(self._toolbar.widget)
Example #12
0
    def _properties_changed(self, modified, actions):
        if not modified or "scrollable" in modified:
            if self.scrollable:
                self.WX_CLASS = "wxScrolledWindow"
            else:
                self.WX_CLASS = "wxPanel"
        if not modified or "name" in modified:
            if self.widget:
                self.widget.GetParent().SetTitle(misc.design_title(self.name))

        PanelBase._properties_changed(self, modified, actions)
        TopLevelBase._properties_changed(self, modified, actions)
Example #13
0
 def finish_widget_creation(self):
     TopLevelBase.finish_widget_creation(self)
     if not self.properties['size'].is_active():
         #if self.sizer: self.sizer.fit_parent()
         #else:
         self.widget.SetSize((400, 300))
     if wx.Platform == '__WXMSW__':
         self.widget.CenterOnScreen()
     if self.menubar and self.menubar.widget:
         self.widget.SetMenuBar(self.menubar.widget)
     if self.statusbar and self.statusbar.widget:
         self.widget.SetStatusBar(self.statusbar.widget)
     if self.toolbar and self.toolbar.widget:
         self.widget.SetToolBar(self.toolbar.widget)
Example #14
0
    def properties_changed(self, modified):
        if not modified or "scrollable" in modified:
            if self.scrollable:
                # 2003-06-26 ALB: change the "class name", to allow code generation
                # for a wxScrolledWindow (see Node.write and common.class_names usage in xml_parse.py)
                self._classname = 'EditTopLevelScrolledWindow'
            else:
                self._classname = self.__class__.__name__
        if not modified or "name" in modified:
            if self.widget:
                self.widget.GetParent().SetTitle(misc.design_title(self.name))

        PanelBase.properties_changed(self, modified)
        TopLevelBase.properties_changed(self, modified)
Example #15
0
    def __init__(self, name, parent, klass, title, style=wx.DEFAULT_FRAME_STYLE): #XXX style is not used
        TopLevelBase.__init__(self, name, parent, klass, title)
        EditStylesMixin.__init__(self)
        self.properties["style"].set(style)

        # initialise instance properties
        self.icon      = np.BitmapPropertyD("")
        self.centered  = np.CheckBoxProperty(False, default_value=False)
        self.sizehints = np.CheckBoxProperty(False, default_value=False)

        self.menubar   = BarProperty("MenuBar")
        self.toolbar   = BarProperty("ToolBar")
        if "statusbar" in self.PROPERTIES:  # not for MDIChildFrame
            self.statusbar = BarProperty("StatusBar")
Example #16
0
 def finish_widget_creation(self):
     TopLevelBase.finish_widget_creation(self)
     if not self.properties['size'].is_active():
         #if self.sizer: self.sizer.fit_parent()
         #else:
         self.widget.SetSize((400, 300))
     if wx.Platform == '__WXMSW__':
         self.widget.CenterOnScreen()
     if self.menubar and self.menubar.widget:
         self.widget.SetMenuBar(self.menubar.widget)
     if self.statusbar and self.statusbar.widget:
         self.widget.SetStatusBar(self.statusbar.widget)
     if self.toolbar and self.toolbar.widget:
         self.widget.SetToolBar(self.toolbar.widget)
Example #17
0
    def __init__(self,
                 name,
                 parent,
                 klass,
                 title,
                 style=wx.DEFAULT_DIALOG_STYLE):
        TopLevelBase.__init__(self, name, parent, klass, title)
        EditStylesMixin.__init__(self)
        self.properties["style"].set(style)

        # initialise instance properties
        self.icon = np.BitmapPropertyD("")
        self.affirmative = AffirmativePropertyD("", default_value="OK")
        self.escape = AffirmativePropertyD("", default_value="CANCEL")
        self.centered = np.CheckBoxProperty(False, default_value=False)
        self.sizehints = np.CheckBoxProperty(False, default_value=False)
Example #18
0
    def properties_changed(self, modified):
        if not modified or "icon" in modified and self.widget:
            self._set_widget_icon()

        if not modified or "menubar" in modified: self._set_menu_bar()
        if not modified or "statusbar" in modified: self._set_status_bar()
        if not modified or "toolbar" in modified: self._set_tool_bar()

        if modified:
            intersection = {"menubar", "statusbar",
                            "toolbar"}.intersection(modified)
            if intersection and self.properties[
                    intersection.pop()].previous_value is not None:
                # previous value is not None -> triggered by user
                misc.rebuild_tree(widget=self, recursive=False, focus=False)

        TopLevelBase.properties_changed(self, modified)
        EditStylesMixin.properties_changed(self, modified)
Example #19
0
    def __init__(self, name, parent, id, title, style=wx.DEFAULT_FRAME_STYLE, klass='wxFrame'): #XXX style is not used
        TopLevelBase.__init__(self, name, klass, parent, id, title=title)
        self.base = 'wxFrame'
        EditStylesMixin.__init__(self)
        self.properties["style"].set(style)

        # initialise instance properties
        self.icon      = np.BitmapPropertyD("")
        self.centered  = np.CheckBoxProperty(False, default_value=False)
        self.sizehints = np.CheckBoxProperty(False, default_value=False)
        self.menubar   = np.CheckBoxProperty(False, default_value=False)
        self.toolbar   = np.CheckBoxProperty(False, default_value=False)
        if "statusbar" in self.PROPERTIES:
            self.statusbar = np.CheckBoxProperty(False, default_value=False)
            self._statusbar = None
        else:
            self.statusbar = None
        self._menubar = self._toolbar = None  # these properties will hold the EditMenubar instances etc.
Example #20
0
 def create_properties(self):
     TopLevelBase.create_properties(self)
     panel = wx.ScrolledWindow(self.notebook, -1, style=wx.TAB_TRAVERSAL)
     szr = wx.BoxSizer(wx.VERTICAL)
     self.properties['title'].display(panel)
     self.properties['icon'].display(panel)
     self.properties['centered'].display(panel)
     self.properties['style'].display(panel)
     szr.Add(self.properties['title'].panel, 0, wx.EXPAND)
     szr.Add(self.properties['icon'].panel, 0, wx.EXPAND)
     szr.Add(self.properties['centered'].panel, 0, wx.EXPAND)
     szr.Add(self.properties['style'].panel, 0, wx.EXPAND)
     panel.SetAutoLayout(True)
     panel.SetSizer(szr)
     szr.Fit(panel)
     self.notebook.AddPage(panel, 'Widget')
     w, h = panel.GetClientSizeTuple()
     panel.SetScrollbars(5, 5, int(math.ceil(w/5.0)), int(math.ceil(h/5.0)))
Example #21
0
 def create_properties(self):
     TopLevelBase.create_properties(self)
     panel = wx.ScrolledWindow(self.notebook, -1, style=wx.TAB_TRAVERSAL)
     szr = wx.BoxSizer(wx.VERTICAL)
     self.properties['title'].display(panel)
     self.properties['icon'].display(panel)
     self.properties['centered'].display(panel)
     self.properties['style'].display(panel)
     szr.Add(self.properties['title'].panel, 0, wx.EXPAND)
     szr.Add(self.properties['icon'].panel, 0, wx.EXPAND)
     szr.Add(self.properties['centered'].panel, 0, wx.EXPAND)
     szr.Add(self.properties['style'].panel, 0, wx.EXPAND)
     panel.SetAutoLayout(True)
     panel.SetSizer(szr)
     szr.Fit(panel)
     self.notebook.AddPage(panel, 'Widget')
     w, h = panel.GetClientSizeTuple()
     panel.SetScrollbars(5, 5, int(math.ceil(w / 5.0)),
                         int(math.ceil(h / 5.0)))
Example #22
0
 def __init__(self,
              name,
              parent,
              id,
              property_window,
              klass='wxPanel',
              show=True,
              style=wx.TAB_TRAVERSAL):
     TopLevelBase.__init__(self,
                           name,
                           klass,
                           parent,
                           id,
                           property_window,
                           show=show,
                           has_title=False)
     PanelBase.__init__(self, style)
     self.base = 'wxPanel'
     self.skip_on_size = False
Example #23
0
    def __init__(self, name, parent, id, title, property_window,
                 style=wx.DEFAULT_FRAME_STYLE, show=True, klass='wxFrame'):
        TopLevelBase.__init__(self, name, klass, parent, id,
                              property_window, show=show, title=title)
        self.base = 'wxFrame'
        self.style = style
        self.statusbar = None
        self.icon = ''
        self.access_functions['statusbar'] = (self.get_statusbar,
                                              self.set_statusbar)
        self.menubar = None
        self.access_functions['menubar'] = (self.get_menubar, self.set_menubar)
        self.toolbar = None
        self.access_functions['toolbar'] = (self.get_toolbar, self.set_toolbar)

        self.access_functions['style'] = (self.get_style, self.set_style)

        self.access_functions['icon'] = (self.get_icon, self.set_icon)
        prop = self.properties
        style_labels = ['#section#' + _('Style'), 'wxDEFAULT_FRAME_STYLE',
                        'wxICONIZE', 'wxCAPTION',
                        'wxMINIMIZE', 'wxMINIMIZE_BOX', 'wxMAXIMIZE',
                        'wxMAXIMIZE_BOX', 'wxSTAY_ON_TOP', 'wxSYSTEM_MENU',
                        'wxSIMPLE_BORDER', 'wxRESIZE_BORDER',
                        'wxFRAME_TOOL_WINDOW', 'wxFRAME_NO_TASKBAR',
                        'wxFRAME_FLOAT_ON_PARENT',
                        'wxNO_BORDER',
                        'wxNO_FULL_REPAINT_ON_RESIZE',
                        'wxFULL_REPAINT_ON_RESIZE',
                        'wxTAB_TRAVERSAL', 'wxCLIP_CHILDREN']
        self.style_pos = [wx.DEFAULT_FRAME_STYLE,
                          wx.ICONIZE, wx.CAPTION, wx.MINIMIZE,
                          wx.MINIMIZE_BOX, wx.MAXIMIZE, wx.MAXIMIZE_BOX,
                          wx.STAY_ON_TOP, wx.SYSTEM_MENU, wx.SIMPLE_BORDER,
                          wx.RESIZE_BORDER, wx.FRAME_TOOL_WINDOW,
                          wx.FRAME_NO_TASKBAR, wx.FRAME_FLOAT_ON_PARENT,
                          wx.NO_BORDER,
                          wx.NO_FULL_REPAINT_ON_RESIZE,
                          wx.FULL_REPAINT_ON_RESIZE,
                          wx.TAB_TRAVERSAL, wx.CLIP_CHILDREN]
        if misc.check_wx_version(2, 5):
            style_labels.insert(5, 'wxCLOSE_BOX')
            self.style_pos.insert(4, wx.CLOSE_BOX)
        prop['style'] = CheckListProperty(self, 'style', None, style_labels)
        # menubar property
        prop['menubar'] = CheckBoxProperty(self, 'menubar', None,
                                           _('Has MenuBar'))
        # statusbar property
        prop['statusbar'] = CheckBoxProperty(self, 'statusbar', None,
                                             _('Has StatusBar'))
        # toolbar property
        prop['toolbar'] = CheckBoxProperty(self, 'toolbar', None,
                                           _('Has ToolBar'))
        # icon property
        prop['icon'] = FileDialogProperty(self, 'icon', None,
                                          style=wx.OPEN|wx.FILE_MUST_EXIST,
                                          can_disable=True, label=_("icon"))
        # centered property
        self.centered = False
        self.access_functions['centered'] = (self.get_centered,
                                             self.set_centered)
        prop['centered'] = CheckBoxProperty(self, 'centered', None,
                                            label=_("centered"))
        # size hints property
        self.sizehints = False
        self.access_functions['sizehints'] = (self.get_sizehints,
                                              self.set_sizehints)
        prop['sizehints'] = CheckBoxProperty(self, 'sizehints', None,
                                             label=_('Set Size Hints'))
Example #24
0
 def get_properties(self, without=set()):
     # return list of properties to be written to XML file
     if not self.scrollable: without.add("scroll_rate")
     return TopLevelBase.get_properties(self, without)
Example #25
0
    def __init__(self,
                 name,
                 parent,
                 id,
                 title,
                 property_window,
                 style=wx.DEFAULT_DIALOG_STYLE,
                 show=True,
                 klass='wxDialog'):
        TopLevelBase.__init__(self,
                              name,
                              klass,
                              parent,
                              id,
                              property_window,
                              show=show,
                              title=title)
        self.base = 'wxDialog'

        self.style = style
        prop = self.properties
        # style property
        self.access_functions['style'] = (self.get_style, self.set_style)
        style_labels = ('#section#' + _('Style'), 'wxDEFAULT_DIALOG_STYLE',
                        'wxDIALOG_MODAL', 'wxCAPTION', 'wxRESIZE_BORDER',
                        'wxSYSTEM_MENU')
        if misc.check_wx_version(2, 5):
            style_labels += ('wxCLOSE_BOX', 'wxMAXIMIZE_BOX', 'wxMINIMIZE_BOX')
        style_labels += ('wxTHICK_FRAME', 'wxSTAY_ON_TOP', 'wxNO_3D',
                         'wxDIALOG_NO_PARENT', 'wxNO_FULL_REPAINT_ON_RESIZE',
                         'wxFULL_REPAINT_ON_RESIZE', 'wxCLIP_CHILDREN')
        #note that the tooltips are only for wxPython>=2.5
        self.tooltips = (
            _("Equivalent to a combination of wxCAPTION, wxCLOSE_BOX and wxSYSTEM_MENU (the last one is not used under Unix)"
              ), _("NO DESCRIPTION"), _("Puts a caption on the dialog box."),
            _("Display a resizeable frame around the window."),
            _("Display a system menu."),
            _("Displays a close box on the frame."),
            _("Displays a maximize box on the dialog."),
            _("Displays a minimize box on the dialog."),
            _("Display a thick frame around the window."),
            _("The dialog stays on top of all other windows."),
            _("Under Windows, specifies that the child controls should not have 3D borders unless specified in the control."
              ),
            _("By default, a dialog created with a NULL parent window will be given the application's top level window as parent. Use this style to prevent this from happening and create an orphan dialog. This is not recommended for modal dialogs."
              ), _("NO DESCRIPTION"), _("NO DESCRIPTION"), _("NO DESCRIPTION"))
        self.style_pos = (wx.DEFAULT_DIALOG_STYLE, wx.DIALOG_MODAL, wx.CAPTION,
                          wx.RESIZE_BORDER, wx.SYSTEM_MENU)
        if misc.check_wx_version(2, 5):
            self.style_pos += (wx.CLOSE_BOX, wx.MAXIMIZE_BOX, wx.MINIMIZE_BOX)
        self.style_pos += (wx.THICK_FRAME, wx.STAY_ON_TOP, wx.NO_3D,
                           wx.DIALOG_NO_PARENT, wx.NO_FULL_REPAINT_ON_RESIZE,
                           wx.FULL_REPAINT_ON_RESIZE, wx.CLIP_CHILDREN)
        prop['style'] = CheckListProperty(self,
                                          'style',
                                          None,
                                          style_labels,
                                          tooltips=self.tooltips)
        # icon property
        self.icon = ""
        self.access_functions['icon'] = (self.get_icon, self.set_icon)
        prop['icon'] = FileDialogProperty(self,
                                          'icon',
                                          None,
                                          style=wx.OPEN | wx.FILE_MUST_EXIST,
                                          can_disable=True,
                                          label=_("icon"))
        # centered property
        self.centered = False
        self.access_functions['centered'] = (self.get_centered,
                                             self.set_centered)
        prop['centered'] = CheckBoxProperty(self,
                                            'centered',
                                            None,
                                            label=_("centered"))
        # size hints property
        self.sizehints = False
        self.access_functions['sizehints'] = (self.get_sizehints,
                                              self.set_sizehints)
        prop['sizehints'] = CheckBoxProperty(self,
                                             'sizehints',
                                             None,
                                             label=_('Set Size Hints'))
Example #26
0
    def __init__(self,
                 name,
                 parent,
                 id,
                 title,
                 property_window,
                 style=wx.DEFAULT_FRAME_STYLE,
                 show=True,
                 klass='wxFrame'):
        TopLevelBase.__init__(self,
                              name,
                              klass,
                              parent,
                              id,
                              property_window,
                              show=show,
                              title=title)
        self.base = 'wxFrame'
        self.style = style
        self.statusbar = None
        self.icon = ''
        self.access_functions['statusbar'] = (self.get_statusbar,
                                              self.set_statusbar)
        self.menubar = None
        self.access_functions['menubar'] = (self.get_menubar, self.set_menubar)
        self.toolbar = None
        self.access_functions['toolbar'] = (self.get_toolbar, self.set_toolbar)

        self.access_functions['style'] = (self.get_style, self.set_style)

        self.access_functions['icon'] = (self.get_icon, self.set_icon)
        prop = self.properties
        style_labels = [
            '#section#' + _('Style'), 'wxDEFAULT_FRAME_STYLE', 'wxICONIZE',
            'wxCAPTION', 'wxMINIMIZE', 'wxMINIMIZE_BOX', 'wxMAXIMIZE',
            'wxMAXIMIZE_BOX', 'wxSTAY_ON_TOP', 'wxSYSTEM_MENU',
            'wxSIMPLE_BORDER', 'wxRESIZE_BORDER', 'wxFRAME_TOOL_WINDOW',
            'wxFRAME_NO_TASKBAR', 'wxFRAME_FLOAT_ON_PARENT', 'wxNO_BORDER',
            'wxNO_FULL_REPAINT_ON_RESIZE', 'wxFULL_REPAINT_ON_RESIZE',
            'wxTAB_TRAVERSAL', 'wxCLIP_CHILDREN'
        ]
        self.style_pos = [
            wx.DEFAULT_FRAME_STYLE, wx.ICONIZE, wx.CAPTION, wx.MINIMIZE,
            wx.MINIMIZE_BOX, wx.MAXIMIZE, wx.MAXIMIZE_BOX, wx.STAY_ON_TOP,
            wx.SYSTEM_MENU, wx.SIMPLE_BORDER, wx.RESIZE_BORDER,
            wx.FRAME_TOOL_WINDOW, wx.FRAME_NO_TASKBAR,
            wx.FRAME_FLOAT_ON_PARENT, wx.NO_BORDER,
            wx.NO_FULL_REPAINT_ON_RESIZE, wx.FULL_REPAINT_ON_RESIZE,
            wx.TAB_TRAVERSAL, wx.CLIP_CHILDREN
        ]
        if misc.check_wx_version(2, 5):
            style_labels.insert(5, 'wxCLOSE_BOX')
            self.style_pos.insert(4, wx.CLOSE_BOX)
        prop['style'] = CheckListProperty(self, 'style', None, style_labels)
        # menubar property
        prop['menubar'] = CheckBoxProperty(self, 'menubar', None,
                                           _('Has MenuBar'))
        # statusbar property
        prop['statusbar'] = CheckBoxProperty(self, 'statusbar', None,
                                             _('Has StatusBar'))
        # toolbar property
        prop['toolbar'] = CheckBoxProperty(self, 'toolbar', None,
                                           _('Has ToolBar'))
        # icon property
        prop['icon'] = FileDialogProperty(self,
                                          'icon',
                                          None,
                                          style=wx.OPEN | wx.FILE_MUST_EXIST,
                                          can_disable=True,
                                          label=_("icon"))
        # centered property
        self.centered = False
        self.access_functions['centered'] = (self.get_centered,
                                             self.set_centered)
        prop['centered'] = CheckBoxProperty(self,
                                            'centered',
                                            None,
                                            label=_("centered"))
        # size hints property
        self.sizehints = False
        self.access_functions['sizehints'] = (self.get_sizehints,
                                              self.set_sizehints)
        prop['sizehints'] = CheckBoxProperty(self,
                                             'sizehints',
                                             None,
                                             label=_('Set Size Hints'))
Example #27
0
    def _properties_changed(self, modified, actions):
        if not modified or "icon" in modified and self.widget:
            self._set_widget_icon()

        TopLevelBase._properties_changed(self, modified, actions)
        EditStylesMixin._properties_changed(self, modified, actions)
Example #28
0
 def __init__(self, name, parent, id, title, property_window,
              style=wx.DEFAULT_DIALOG_STYLE, show=True, klass='wxDialog'):
     TopLevelBase.__init__(self, name, klass, parent, id,
                           property_window, show=show, title=title)
     self.base = 'wxDialog'
     
     self.style = style
     prop = self.properties
     # style property
     self.access_functions['style'] = (self.get_style, self.set_style)
     style_labels = ('#section#' + _('Style'), 'wxDEFAULT_DIALOG_STYLE',
                     'wxDIALOG_MODAL', 'wxCAPTION',
                     'wxRESIZE_BORDER', 'wxSYSTEM_MENU')
     style_labels += ('wxCLOSE_BOX', 'wxMAXIMIZE_BOX', 'wxMINIMIZE_BOX')
     style_labels += ('wxTHICK_FRAME',
                      'wxSTAY_ON_TOP', 'wxNO_3D', 'wxDIALOG_NO_PARENT',
                      'wxNO_FULL_REPAINT_ON_RESIZE',
                      'wxFULL_REPAINT_ON_RESIZE',
                      'wxCLIP_CHILDREN')
     #note that the tooltips are only for wxPython>=2.5
     self.tooltips = (_("Equivalent to a combination of wxCAPTION, "
                        "wxCLOSE_BOX and wxSYSTEM_MENU "
                        "(the last one is not used under Unix)"),
                      _("NO DESCRIPTION"),
                      _("Puts a caption on the dialog box."),
                      _("Display a resizeable frame around the window."),
                      _("Display a system menu."),
                      _("Displays a close box on the frame."),
                      _("Displays a maximize box on the dialog."),
                      _("Displays a minimize box on the dialog."),
                      _("Display a thick frame around the window."),
                      _("The dialog stays on top of all other windows."),
                      _("Under Windows, specifies that the child controls should "
                        "not have 3D borders unless specified in the control."),
                      _("By default, a dialog created with a NULL parent window "
                        "will be given the application's top level window as parent. "
                        "Use this style to prevent this from happening and create "
                        "an orphan dialog. "
                        "This is not recommended for modal dialogs."),
                      _("NO DESCRIPTION"),
                      _("NO DESCRIPTION"),
                      _("NO DESCRIPTION"))
     self.style_pos = (wx.DEFAULT_DIALOG_STYLE,
                       wx.DIALOG_MODAL, wx.CAPTION, wx.RESIZE_BORDER,
                       wx.SYSTEM_MENU)
     self.style_pos += (wx.CLOSE_BOX, wx.MAXIMIZE_BOX, wx.MINIMIZE_BOX)
     self.style_pos += (wx.THICK_FRAME, wx.STAY_ON_TOP, wx.NO_3D,
                        wx.DIALOG_NO_PARENT, wx.NO_FULL_REPAINT_ON_RESIZE,
                        wx.FULL_REPAINT_ON_RESIZE,
                        wx.CLIP_CHILDREN)
     prop['style'] = CheckListProperty(self, 'style', None, style_labels,
                                       tooltips=self.tooltips)
     # icon property
     self.icon = ""
     self.access_functions['icon'] = (self.get_icon, self.set_icon)
     prop['icon'] = FileDialogProperty(self, 'icon', None,
                                       style=wx.OPEN|wx.FILE_MUST_EXIST,
                                       can_disable=True, label=_("icon"))
     # centered property
     self.centered = False
     self.access_functions['centered'] = (self.get_centered,
                                          self.set_centered)
     prop['centered'] = CheckBoxProperty(self, 'centered', None,
                                         label=_("centered"))
     # size hints property
     self.sizehints = False
     self.access_functions['sizehints'] = (self.get_sizehints,
                                           self.set_sizehints)
     prop['sizehints'] = CheckBoxProperty(self, 'sizehints', None,
                                          label=_('Set Size Hints'))
Example #29
0
 def finish_widget_creation(self):
     TopLevelBase.finish_widget_creation(self)
     if not self.properties['size'].is_active():
         self.widget.SetSize((400, 300))
Example #30
0
 def finish_widget_creation(self):
     TopLevelBase.finish_widget_creation(self)
     if not self.properties['size'].is_active():
         self.widget.SetSize((400, 300))    
Example #31
0
 def track_contained_name(self, old_name=None, new_name=None):
     TopLevelBase.track_contained_name(self, old_name, new_name)
     self.properties["affirmative"].track_name(old_name, new_name)
     self.properties["escape"].track_name(old_name, new_name)