37,15 → 37,25 |
# begin wxGlade: SettingsDialog.__init__ |
kwds["style"] = wx.DEFAULT_DIALOG_STYLE |
wx.Dialog.__init__(self, *args, **kwds) |
self.label_5_copy = wx.StaticText(self, -1, "COM Port ", style=wx.ALIGN_RIGHT) |
self.comPortCtrl_copy = wx.TextCtrl(self, -1, "") |
self.button_5_copy = wx.Button(self, wx.ID_CANCEL, "") |
self.button_6_copy = wx.Button(self, wx.ID_OK, "") |
self.button_5 = wx.Button(self, wx.ID_CANCEL, "") |
self.button_6 = wx.Button(self, wx.ID_OK, "") |
|
self.__set_properties() |
self.__do_layout() |
# end wxGlade |
|
# The first argument that is passed to the constructor is the parent |
settings = args[0].app.settings |
# Add text-boxes for all settings |
self.grid_sizer_2.SetRows(len(settings)) |
for setting in settings.iteritems(): |
lb = wx.StaticText(self, -1, setting[1].descr, style=wx.ALIGN_RIGHT) |
tb = wx.TextCtrl(self, -1, str(setting[1].value)) |
self.grid_sizer_2.Add(lb, 0, wx.ALIGN_RIGHT|wx.ALIGN_CENTER_VERTICAL, 0) |
self.grid_sizer_2.Add(tb, 0, 0, 0) |
self.sizer_5.Fit(self) |
self.Layout() |
|
def __set_properties(self): |
# begin wxGlade: SettingsDialog.__set_properties |
self.SetTitle("Settings") |
53,27 → 63,31 |
|
def __do_layout(self): |
# begin wxGlade: SettingsDialog.__do_layout |
sizer_5_copy = wx.BoxSizer(wx.VERTICAL) |
grid_sizer_3_copy = wx.GridSizer(1, 2, 0, 0) |
sizer_6_copy = wx.BoxSizer(wx.HORIZONTAL) |
grid_sizer_2_copy = wx.GridSizer(1, 2, 4, 4) |
sizer_5_copy.Add((20, 20), 0, 0, 0) |
sizer_6_copy.Add((20, 20), 0, 0, 0) |
grid_sizer_2_copy.Add(self.label_5_copy, 0, wx.ALIGN_RIGHT|wx.ALIGN_CENTER_VERTICAL, 0) |
grid_sizer_2_copy.Add(self.comPortCtrl_copy, 0, 0, 0) |
sizer_6_copy.Add(grid_sizer_2_copy, 0, 0, 0) |
sizer_6_copy.Add((20, 20), 0, 0, 0) |
sizer_5_copy.Add(sizer_6_copy, 1, wx.EXPAND, 0) |
sizer_5_copy.Add((20, 20), 0, 0, 0) |
grid_sizer_3_copy.Add(self.button_5_copy, 0, wx.ALIGN_CENTER_HORIZONTAL|wx.ALIGN_CENTER_VERTICAL, 0) |
grid_sizer_3_copy.Add(self.button_6_copy, 0, wx.ALIGN_CENTER_HORIZONTAL|wx.ALIGN_CENTER_VERTICAL, 0) |
sizer_5_copy.Add(grid_sizer_3_copy, 0, wx.EXPAND, 0) |
sizer_5_copy.Add((20, 20), 0, 0, 0) |
self.SetSizer(sizer_5_copy) |
sizer_5_copy.Fit(self) |
sizer_5 = wx.BoxSizer(wx.VERTICAL) |
grid_sizer_3 = wx.GridSizer(1, 2, 0, 0) |
sizer_6 = wx.BoxSizer(wx.HORIZONTAL) |
grid_sizer_2 = wx.GridSizer(1, 2, 4, 4) |
sizer_5.Add((20, 20), 0, 0, 0) |
sizer_6.Add((20, 20), 0, 0, 0) |
sizer_6.Add(grid_sizer_2, 0, 0, 0) |
sizer_6.Add((20, 20), 0, 0, 0) |
sizer_5.Add(sizer_6, 1, wx.EXPAND, 0) |
sizer_5.Add((20, 20), 0, 0, 0) |
grid_sizer_3.Add(self.button_5, 0, wx.ALIGN_CENTER_HORIZONTAL|wx.ALIGN_CENTER_VERTICAL, 0) |
grid_sizer_3.Add(self.button_6, 0, wx.ALIGN_CENTER_HORIZONTAL|wx.ALIGN_CENTER_VERTICAL, 0) |
sizer_5.Add(grid_sizer_3, 0, wx.EXPAND, 0) |
sizer_5.Add((20, 20), 0, 0, 0) |
self.SetSizer(sizer_5) |
sizer_5.Fit(self) |
self.Layout() |
# end wxGlade |
|
# Store some of the items, we will need them later |
self.grid_sizer_2 = grid_sizer_2 |
self.sizer_5 = sizer_5 |
|
|
|
# end of class SettingsDialog |
|
|