Пример #1
0
    def create_properties(self):
        ManagedBase.create_properties(self)
        panel = wx.ScrolledWindow(self.notebook, -1)
        szr = wx.BoxSizer(wx.VERTICAL)
        ctor = self.properties['custom_ctor']
        ctor.display(panel)
        szr.Add(ctor.panel, 0, wx.EXPAND)
        args = self.properties['arguments']
        args.display(panel)
        szr.Add(args.panel, 1, wx.ALL|wx.EXPAND, 5)
        help_btn = wx.Button(panel, -1, _('Help on "Arguments" property'))
        text = _("""\
The 'Arguments' property behaves differently when generating
XRC code wrt C++ or python: you can use it to add custom attributes
to the resource object. To do so, arguments must have the following
format: ATTRIBUTE_NAME: ATTRIBUTE_VALUE
For instance:
    default_value: 10
is translated to:
    <default_value>10</default_value>
Invalid entries are silently ignored""")
        def show_help(event):
            wx.MessageBox(text, _('Help on "Arguments" property'),
                         wx.OK|wx.CENTRE|wx.ICON_INFORMATION)
        wx.EVT_BUTTON(help_btn, -1, show_help)
        szr.Add(help_btn, 0, wx.BOTTOM|wx.LEFT|wx.RIGHT|wx.EXPAND, 5)
        panel.SetAutoLayout(True)
        panel.SetSizer(szr)
        szr.Fit(panel)
        self.notebook.AddPage(panel, 'Widget')
        args.set_col_sizes([-1])
Пример #2
0
 def create_properties(self):
     ManagedBase.create_properties(self)
     if self.removed_p.panel: self.removed_p.panel.Hide()
     panel = wx.Panel(self.notebook, -1)
     szr = wx.BoxSizer(wx.VERTICAL)
     self.properties['attribute'].display(panel)
     szr.Add(self.properties['attribute'].panel, 0, wx.EXPAND)
     panel.SetAutoLayout(True)
     panel.SetSizer(szr)
     szr.Fit(panel)
     self.notebook.AddPage(panel, 'Widget')        
Пример #3
0
 def create_properties(self):
     ManagedBase.create_properties(self)
     panel = wx.Panel(self.notebook, -1)
     szr = wx.BoxSizer(wx.VERTICAL)
     self.properties['label'].display(panel)
     self.properties['value'].display(panel)
     szr.Add(self.properties['label'].panel, 0, wx.EXPAND)
     szr.Add(self.properties['value'].panel, 0, wx.EXPAND)
     panel.SetAutoLayout(True)
     panel.SetSizer(szr)
     szr.Fit(panel)
     self.notebook.AddPage(panel, 'Widget')
Пример #4
0
 def create_properties(self):
     ManagedBase.create_properties(self)
     panel = wx.ScrolledWindow(self.notebook, -1, style=wx.TAB_TRAVERSAL)
     prop = self.properties
     szr = wx.BoxSizer(wx.VERTICAL)
     prop['range'].display(panel)
     prop['style'].display(panel)
     szr.Add(prop['range'].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')
Пример #5
0
 def create_properties(self):
     ManagedBase.create_properties(self)
     panel = wx.Panel(self.notebook, -1)
     szr = wx.BoxSizer(wx.VERTICAL)
     self.properties['choices'].display(panel)
     self.properties['selection'].display(panel)
     szr.Add(self.properties['selection'].panel, 0, wx.EXPAND)
     szr.Add(self.properties['choices'].panel, 1, wx.EXPAND)
     panel.SetAutoLayout(True)
     panel.SetSizer(szr)
     szr.Fit(panel)
     self.notebook.AddPage(panel, 'Widget')
     self.properties['choices'].set_col_sizes([-1])
Пример #6
0
Файл: grid.py Проект: nyimbi/SPE
    def create_properties(self):
        ManagedBase.create_properties(self)
        panel = wx.ScrolledWindow(self.notebook, -1, style=wx.TAB_TRAVERSAL)
        self.properties["create_grid"].display(panel)
        self.properties["columns"].display(panel)
        self.properties["rows_number"].display(panel)
        self.properties["row_label_size"].display(panel)
        self.properties["col_label_size"].display(panel)
        self.properties["enable_editing"].display(panel)
        self.properties["enable_grid_lines"].display(panel)
        self.properties["enable_col_resize"].display(panel)
        self.properties["enable_row_resize"].display(panel)
        self.properties["enable_grid_resize"].display(panel)
        self.properties["lines_color"].display(panel)
        self.properties["label_bg_color"].display(panel)
        self.properties["selection_mode"].display(panel)
        szr = wx.BoxSizer(wx.VERTICAL)
        szr.Add(self.properties["create_grid"].panel, 0, wx.EXPAND)
        szr.Add(wx.StaticLine(panel, -1), 0, wx.ALL | wx.EXPAND, 5)
        szr.Add(
            wx.StaticText(
                panel, -1, _("The following properties are " "meaningful\nonly if 'Create grid' is selected")
            ),
            0,
            wx.LEFT | wx.RIGHT | wx.EXPAND,
            10,
        )
        szr.Add(wx.StaticLine(panel, -1), 0, wx.ALL | wx.EXPAND, 5)
        szr.Add(self.properties["columns"].panel, 0, wx.ALL | wx.EXPAND, 2)
        szr.SetItemMinSize(self.properties["columns"].panel, 1, 150)
        szr.Add(self.properties["rows_number"].panel, 0, wx.EXPAND)
        szr.Add(self.properties["row_label_size"].panel, 0, wx.EXPAND)
        szr.Add(self.properties["col_label_size"].panel, 0, wx.EXPAND)
        szr.Add(self.properties["lines_color"].panel, 0, wx.EXPAND)
        szr.Add(self.properties["label_bg_color"].panel, 0, wx.EXPAND)
        szr.Add(self.properties["enable_editing"].panel, 0, wx.EXPAND)
        szr.Add(self.properties["enable_grid_lines"].panel, 0, wx.EXPAND)
        szr.Add(self.properties["enable_col_resize"].panel, 0, wx.EXPAND)
        szr.Add(self.properties["enable_row_resize"].panel, 0, wx.EXPAND)
        szr.Add(self.properties["enable_grid_resize"].panel, 0, wx.EXPAND)
        szr.Add(self.properties["selection_mode"].panel, 0, wx.ALL | wx.EXPAND, 5)
        panel.SetAutoLayout(1)
        panel.SetSizer(szr)
        szr.Fit(panel)
        w, h = panel.GetClientSize()
        self.notebook.AddPage(panel, _("Widget"))
        import math

        panel.SetScrollbars(1, 5, 1, int(math.ceil(h / 5.0)))
        self.properties["columns"].set_col_sizes([-1, 0])
Пример #7
0
 def create_properties(self):
     ManagedBase.create_properties(self)
     panel = wx.ScrolledWindow(self.notebook, -1, style=wx.TAB_TRAVERSAL)
     self.properties['no_custom_class'].display(panel)
     self.properties['tabs'].display(panel)
     sizer = wx.BoxSizer(wx.VERTICAL)
     sizer.Add(self.properties['no_custom_class'].panel, 0,
               wx.ALL|wx.EXPAND, 3)
     sizer.Add(self.properties['tabs'].panel, 1, wx.ALL|wx.EXPAND, 3)
     panel.SetAutoLayout(True)
     panel.SetSizer(sizer)
     sizer.Fit(panel)
     self.notebook.AddPage(panel, _('Widget'))
     self.properties['tabs'].set_col_sizes([-1])
Пример #8
0
 def create_properties(self):
     ManagedBase.create_properties(self)
     panel = wx.Panel(self.notebook, -1)
     szr = wx.BoxSizer(wx.VERTICAL)
     self.properties["label"].display(panel)
     self.properties["clicked"].display(panel)
     self.properties["style"].display(panel)
     szr.Add(self.properties["label"].panel, 0, wx.EXPAND)
     szr.Add(self.properties["clicked"].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"))
Пример #9
0
 def create_properties(self):
     ManagedBase.create_properties(self)
     panel = wx.Panel(self.notebook, -1)
     szr = wx.BoxSizer(wx.VERTICAL)
     self.properties['choices'].display(panel)
     self.properties['style'].display(panel)
     self.properties['selection'].display(panel)
     szr.Add(self.properties['style'].panel, 0, wx.EXPAND)
     szr.Add(self.properties['selection'].panel, 0, wx.EXPAND)
     szr.Add(self.properties['choices'].panel, 1, wx.EXPAND)
     panel.SetAutoLayout(True)
     panel.SetSizer(szr)
     szr.Fit(panel)
     self.notebook.AddPage(panel, 'Widget')
     self.properties['choices'].set_col_sizes([-1])
Пример #10
0
 def create_properties(self):
     ManagedBase.create_properties(self)
     panel = wx.ScrolledWindow(self.notebook, -1, style=wx.TAB_TRAVERSAL)
     prop = self.properties
     prop['style'].display(panel)
     szr = wx.BoxSizer(wx.VERTICAL)
     szr.Add(prop['style'].panel, 0, wx.EXPAND)
     panel.SetAutoLayout(True)
     panel.SetSizer(szr)
     szr.Fit(panel)
     w, h = panel.GetClientSize()
     self.notebook.AddPage(panel, 'Widget')
     self.property_window.Layout()
     import math
     panel.SetScrollbars(1, 5, 1, int(math.ceil(h / 5.0)))
Пример #11
0
 def create_properties(self):
     ManagedBase.create_properties(self)
     panel = wx.ScrolledWindow(self.notebook, -1, style=wx.TAB_TRAVERSAL)
     szr = wx.BoxSizer(wx.VERTICAL)
     for name in self.property_names:
         self.properties[name].display(panel)
         szr.Add(self.properties[name].panel, self.property_proportion[name],
                 wx.EXPAND)
     panel.SetAutoLayout(1)
     panel.SetSizer(szr)
     szr.Fit(panel)
     w, h = panel.GetClientSize()
     self.notebook.AddPage(panel, 'Widget')
     import math
     panel.SetScrollbars(1, 5, 1, int(math.ceil(h/5.0)))
Пример #12
0
 def create_properties(self):
     ManagedBase.create_properties(self)
     panel = wx.ScrolledWindow(self.notebook, -1, style=wx.TAB_TRAVERSAL)
     prop = self.properties
     szr = wx.BoxSizer(wx.VERTICAL)
     prop['range'].display(panel)
     prop['value'].display(panel)
     prop['style'].display(panel)
     szr.Add(prop['range'].panel, 0, wx.EXPAND)
     szr.Add(prop['value'].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'))
Пример #13
0
 def create_properties(self):
     ManagedBase.create_properties(self)
     panel = wx.ScrolledWindow(self.notebook, -1, style=wx.TAB_TRAVERSAL) 
     prop = self.properties
     prop['style'].display(panel)
     szr = wx.BoxSizer(wx.VERTICAL)
     szr.Add(prop['style'].panel, 0, wx.EXPAND)
     panel.SetAutoLayout(True)
     panel.SetSizer(szr)
     szr.Fit(panel)
     w, h = panel.GetClientSize()
     self.notebook.AddPage(panel, _('Widget'))
     self.property_window.Layout()
     import math
     panel.SetScrollbars(1, 5, 1, int(math.ceil(h/5.0)))
Пример #14
0
 def create_properties(self):
     ManagedBase.create_properties(self)
     panel = wx.ScrolledWindow(self.notebook, -1, style=wx.TAB_TRAVERSAL)
     sizer = wx.BoxSizer(wx.VERTICAL)
     self.properties['no_custom_class'].display(panel)
     self.properties['style'].display(panel)
     self.properties['sash_pos'].display(panel)
     sizer.Add(self.properties['no_custom_class'].panel, 0,
               wx.ALL | wx.EXPAND, 3)
     sizer.Add(self.properties['style'].panel, 0, wx.EXPAND)
     sizer.Add(self.properties['sash_pos'].panel, 0, wx.EXPAND)
     panel.SetAutoLayout(True)
     panel.SetSizer(sizer)
     sizer.Fit(panel)
     self.notebook.AddPage(panel, 'Widget')
Пример #15
0
 def create_properties(self):
     ManagedBase.create_properties(self)
     panel = wx.ScrolledWindow(self.notebook, -1, style=wx.TAB_TRAVERSAL)
     szr = wx.BoxSizer(wx.VERTICAL)
     for name in self.property_names:
         self.properties[name].display(panel)
         szr.Add(self.properties[name].panel,
                 self.property_proportion[name], wx.EXPAND)
     panel.SetAutoLayout(1)
     panel.SetSizer(szr)
     szr.Fit(panel)
     w, h = panel.GetClientSize()
     self.notebook.AddPage(panel, 'Widget')
     import math
     panel.SetScrollbars(1, 5, 1, int(math.ceil(h / 5.0)))
Пример #16
0
 def create_properties(self):
     ManagedBase.create_properties(self)
     panel = wx.Panel(self.notebook, -1)
     self.properties['bitmap'].display(panel)
     self.properties['disabled_bitmap'].display(panel)
     self.properties['default'].display(panel)
     self.properties['style'].display(panel)
     szr = wx.BoxSizer(wx.VERTICAL)
     szr.Add(self.properties['bitmap'].panel, 0, wx.EXPAND)
     szr.Add(self.properties['disabled_bitmap'].panel, 0, wx.EXPAND)
     szr.Add(self.properties['default'].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')
Пример #17
0
 def create_properties(self):
     ManagedBase.create_properties(self)
     panel = wx.Panel(self.notebook, -1)
     self.properties["bitmap"].display(panel)
     self.properties["disabled_bitmap"].display(panel)
     self.properties["default"].display(panel)
     self.properties["style"].display(panel)
     szr = wx.BoxSizer(wx.VERTICAL)
     szr.Add(self.properties["bitmap"].panel, 0, wx.EXPAND)
     szr.Add(self.properties["disabled_bitmap"].panel, 0, wx.EXPAND)
     szr.Add(self.properties["default"].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")
Пример #18
0
 def create_properties(self):
     ManagedBase.create_properties(self)
     panel = wx.ScrolledWindow(self.notebook, -1, style=wx.TAB_TRAVERSAL)
     self.properties['create_grid'].display(panel)
     self.properties['columns'].display(panel)
     self.properties['rows_number'].display(panel)
     self.properties['row_label_size'].display(panel)
     self.properties['col_label_size'].display(panel)
     self.properties['enable_editing'].display(panel)
     self.properties['enable_grid_lines'].display(panel)
     self.properties['enable_col_resize'].display(panel)
     self.properties['enable_row_resize'].display(panel)
     self.properties['enable_grid_resize'].display(panel)
     self.properties['lines_color'].display(panel)
     self.properties['label_bg_color'].display(panel)
     self.properties['selection_mode'].display(panel)
     szr = wx.BoxSizer(wx.VERTICAL)
     szr.Add(self.properties['create_grid'].panel, 0, wx.EXPAND)
     szr.Add(wx.StaticLine(panel, -1), 0, wx.ALL|wx.EXPAND, 5)
     szr.Add(wx.StaticText(panel, -1, _("The following properties are "
                          "meaningful\nonly if 'Create grid' is selected")),
             0, wx.LEFT|wx.RIGHT|wx.EXPAND, 10)
     szr.Add(wx.StaticLine(panel, -1), 0, wx.ALL|wx.EXPAND, 5)
     szr.Add(self.properties['columns'].panel, 0, wx.ALL|wx.EXPAND, 2)
     szr.SetItemMinSize(self.properties['columns'].panel, 1, 150)
     szr.Add(self.properties['rows_number'].panel, 0, wx.EXPAND)
     szr.Add(self.properties['row_label_size'].panel, 0, wx.EXPAND)
     szr.Add(self.properties['col_label_size'].panel, 0, wx.EXPAND)
     szr.Add(self.properties['lines_color'].panel, 0, wx.EXPAND)
     szr.Add(self.properties['label_bg_color'].panel, 0, wx.EXPAND)
     szr.Add(self.properties['enable_editing'].panel, 0, wx.EXPAND)
     szr.Add(self.properties['enable_grid_lines'].panel, 0, wx.EXPAND)
     szr.Add(self.properties['enable_col_resize'].panel, 0, wx.EXPAND)
     szr.Add(self.properties['enable_row_resize'].panel, 0, wx.EXPAND)
     szr.Add(self.properties['enable_grid_resize'].panel, 0, wx.EXPAND)
     szr.Add(self.properties['selection_mode'].panel, 0, wx.ALL|wx.EXPAND, 5)
     panel.SetAutoLayout(1)
     panel.SetSizer(szr)
     szr.Fit(panel)
     w, h = panel.GetClientSize()
     self.notebook.AddPage(panel, _('Widget'))
     import math
     panel.SetScrollbars(1, 5, 1, int(math.ceil(h/5.0)))
     self.properties['columns'].set_col_sizes([-1, 0])
Пример #19
0
 def create_properties(self):
     ManagedBase.create_properties(self)
     page = self.notebook.GetPage(1)
     wp = self.properties['width']
     hp = self.properties['height']
     wp.display(page)
     hp.display(page)
     szr = page.GetSizer()
     szr.Insert(0, hp.panel, 0, wx.EXPAND)
     szr.Insert(0, wp.panel, 0, wx.EXPAND)
     szr.Layout()
     szr.Fit(page)
     import math
     w, h = page.GetClientSize()
     page.SetScrollbars(1, 5, 1, int(math.ceil(h / 5.0)))
     common_page = self.notebook.GetPage(0)
     common_page.Hide()
     self.notebook.RemovePage(0)
     self.notebook.SetSelection(0)
Пример #20
0
    def create_properties(self):
        ManagedBase.create_properties(self)
        page = self.notebook.GetPage(1)
        wp = self.properties["width"]
        hp = self.properties["height"]
        wp.display(page)
        hp.display(page)
        szr = page.GetSizer()
        szr.Insert(0, hp.panel, 0, wx.EXPAND)
        szr.Insert(0, wp.panel, 0, wx.EXPAND)
        szr.Layout()
        szr.Fit(page)
        import math

        w, h = page.GetClientSize()
        page.SetScrollbars(1, 5, 1, int(math.ceil(h / 5.0)))
        common_page = self.notebook.GetPage(0)
        common_page.Hide()
        self.notebook.RemovePage(0)
        self.notebook.SetSelection(0)
Пример #21
0
 def create_properties(self):
     ManagedBase.create_properties(self)
     panel = wx.ScrolledWindow(self.notebook, -1, style=wx.TAB_TRAVERSAL)
     szr = wx.BoxSizer(wx.VERTICAL)
     self.properties['choices'].display(panel)
     self.properties['style'].display(panel)
     self.properties['selection'].display(panel)
     szr.Add(self.properties['style'].panel, 0, wx.EXPAND)
     szr.Add(self.properties['selection'].panel, 0, wx.EXPAND)
     ch = self.properties['choices'].panel
     ch.SetSize((ch.GetSize()[0]-20, 200))
     szr.Add(self.properties['choices'].panel, 1, wx.ALL|wx.EXPAND, 5)
     panel.SetAutoLayout(True)
     panel.SetSizer(szr)
     szr.Fit(panel)
     w, h = panel.GetSize()
     from math import ceil
     panel.SetScrollbars(5, 5, int(ceil(w/5.0)), int(ceil(h/5.0)))
     self.notebook.AddPage(panel, 'Widget')
     self.properties['choices'].set_col_sizes([-1])
Пример #22
0
 def create_properties(self):
     ManagedBase.create_properties(self)
     panel = wx.Panel(self.notebook, -1)
     self.properties['label'].display(panel)
     self.properties['stockitem'].display(panel)
     self.properties['default'].display(panel)
     self.properties['style'].display(panel)
     szr = wx.BoxSizer(wx.VERTICAL)
     szr.Add(self.properties['label'].panel, 0, wx.EXPAND)
     szr.Add(self.properties['stockitem'].panel, 0, wx.EXPAND)
     szr.Add(self.properties['default'].panel, 0, wx.EXPAND)
     szr.Add(self.properties['style'].panel, 0, wx.EXPAND)
     panel.SetAutoLayout(1)
     panel.SetSizer(szr)
     szr.Fit(panel)
     self.notebook.AddPage(panel, 'Widget')
     if self.stockitem != "None":
         s = common.app_tree.app.saved
         self.set_stockitem(self.stockitem)
         common.app_tree.app.saved = s
Пример #23
0
 def create_properties(self):
     ManagedBase.create_properties(self)
     panel = wx.Panel(self.notebook, -1)
     self.properties['label'].display(panel)
     self.properties['stockitem'].display(panel)
     self.properties['default'].display(panel)
     self.properties['style'].display(panel)
     szr = wx.BoxSizer(wx.VERTICAL)
     szr.Add(self.properties['label'].panel, 0, wx.EXPAND)
     szr.Add(self.properties['stockitem'].panel, 0, wx.EXPAND)
     szr.Add(self.properties['default'].panel, 0, wx.EXPAND)
     szr.Add(self.properties['style'].panel, 0, wx.EXPAND)
     panel.SetAutoLayout(1)
     panel.SetSizer(szr)
     szr.Fit(panel)
     self.notebook.AddPage(panel, 'Widget')
     if self.stockitem != "None":
         s = common.app_tree.app.saved
         self.set_stockitem(self.stockitem)
         common.app_tree.app.saved = s
Пример #24
0
 def create_properties(self):
     ManagedBase.create_properties(self)
     panel = wx.ScrolledWindow(self.notebook, -1, style=wx.TAB_TRAVERSAL)
     szr = wx.BoxSizer(wx.VERTICAL)
     self.properties['choices'].display(panel)
     self.properties['style'].display(panel)
     self.properties['selection'].display(panel)
     szr.Add(self.properties['style'].panel, 0, wx.EXPAND)
     szr.Add(self.properties['selection'].panel, 0, wx.EXPAND)
     ch = self.properties['choices'].panel
     ch.SetSize((ch.GetSize()[0] - 20, 200))
     szr.Add(self.properties['choices'].panel, 1, wx.ALL | wx.EXPAND, 5)
     panel.SetAutoLayout(True)
     panel.SetSizer(szr)
     szr.Fit(panel)
     w, h = panel.GetSize()
     from math import ceil
     panel.SetScrollbars(5, 5, int(ceil(w / 5.0)), int(ceil(h / 5.0)))
     self.notebook.AddPage(panel, 'Widget')
     self.properties['choices'].set_col_sizes([-1])