Rev 607 | Rev 611 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 607 | Rev 608 | ||
---|---|---|---|
Line 35... | Line 35... | ||
35 | class SettingsDialog(wx.Dialog): |
35 | class SettingsDialog(wx.Dialog): |
36 | def __init__(self, *args, **kwds): |
36 | def __init__(self, *args, **kwds): |
37 | # begin wxGlade: SettingsDialog.__init__ |
37 | # begin wxGlade: SettingsDialog.__init__ |
38 | kwds["style"] = wx.DEFAULT_DIALOG_STYLE |
38 | kwds["style"] = wx.DEFAULT_DIALOG_STYLE |
39 | wx.Dialog.__init__(self, *args, **kwds) |
39 | wx.Dialog.__init__(self, *args, **kwds) |
40 | self.label_5_copy = wx.StaticText(self, -1, "COM Port ", style=wx.ALIGN_RIGHT) |
- | |
41 | self.comPortCtrl_copy = wx.TextCtrl(self, -1, "") |
- | |
42 | self.button_5_copy = wx.Button(self, wx.ID_CANCEL, "") |
40 | self.button_5 = wx.Button(self, wx.ID_CANCEL, "") |
43 | self.button_6_copy = wx.Button(self, wx.ID_OK, "") |
41 | self.button_6 = wx.Button(self, wx.ID_OK, "") |
Line 44... | Line 42... | ||
44 | 42 | ||
45 | self.__set_properties() |
43 | self.__set_properties() |
46 | self.__do_layout() |
44 | self.__do_layout() |
Line -... | Line 45... | ||
- | 45 | # end wxGlade |
|
- | 46 | ||
- | 47 | # The first argument that is passed to the constructor is the parent |
|
- | 48 | settings = args[0].app.settings |
|
- | 49 | # Add text-boxes for all settings |
|
- | 50 | self.grid_sizer_2.SetRows(len(settings)) |
|
- | 51 | for setting in settings.iteritems(): |
|
- | 52 | lb = wx.StaticText(self, -1, setting[1].descr, style=wx.ALIGN_RIGHT) |
|
- | 53 | tb = wx.TextCtrl(self, -1, str(setting[1].value)) |
|
- | 54 | self.grid_sizer_2.Add(lb, 0, wx.ALIGN_RIGHT|wx.ALIGN_CENTER_VERTICAL, 0) |
|
- | 55 | self.grid_sizer_2.Add(tb, 0, 0, 0) |
|
- | 56 | self.sizer_5.Fit(self) |
|
47 | # end wxGlade |
57 | self.Layout() |
48 | 58 | ||
49 | def __set_properties(self): |
59 | def __set_properties(self): |
50 | # begin wxGlade: SettingsDialog.__set_properties |
60 | # begin wxGlade: SettingsDialog.__set_properties |
Line 51... | Line 61... | ||
51 | self.SetTitle("Settings") |
61 | self.SetTitle("Settings") |
52 | # end wxGlade |
62 | # end wxGlade |
53 | 63 | ||
54 | def __do_layout(self): |
64 | def __do_layout(self): |
55 | # begin wxGlade: SettingsDialog.__do_layout |
65 | # begin wxGlade: SettingsDialog.__do_layout |
56 | sizer_5_copy = wx.BoxSizer(wx.VERTICAL) |
66 | sizer_5 = wx.BoxSizer(wx.VERTICAL) |
57 | grid_sizer_3_copy = wx.GridSizer(1, 2, 0, 0) |
67 | grid_sizer_3 = wx.GridSizer(1, 2, 0, 0) |
58 | sizer_6_copy = wx.BoxSizer(wx.HORIZONTAL) |
68 | sizer_6 = wx.BoxSizer(wx.HORIZONTAL) |
59 | grid_sizer_2_copy = wx.GridSizer(1, 2, 4, 4) |
- | |
60 | sizer_5_copy.Add((20, 20), 0, 0, 0) |
- | |
61 | sizer_6_copy.Add((20, 20), 0, 0, 0) |
69 | grid_sizer_2 = wx.GridSizer(1, 2, 4, 4) |
62 | grid_sizer_2_copy.Add(self.label_5_copy, 0, wx.ALIGN_RIGHT|wx.ALIGN_CENTER_VERTICAL, 0) |
70 | sizer_5.Add((20, 20), 0, 0, 0) |
63 | grid_sizer_2_copy.Add(self.comPortCtrl_copy, 0, 0, 0) |
71 | sizer_6.Add((20, 20), 0, 0, 0) |
64 | sizer_6_copy.Add(grid_sizer_2_copy, 0, 0, 0) |
72 | sizer_6.Add(grid_sizer_2, 0, 0, 0) |
65 | sizer_6_copy.Add((20, 20), 0, 0, 0) |
73 | sizer_6.Add((20, 20), 0, 0, 0) |
66 | sizer_5_copy.Add(sizer_6_copy, 1, wx.EXPAND, 0) |
74 | sizer_5.Add(sizer_6, 1, wx.EXPAND, 0) |
67 | sizer_5_copy.Add((20, 20), 0, 0, 0) |
75 | sizer_5.Add((20, 20), 0, 0, 0) |
68 | grid_sizer_3_copy.Add(self.button_5_copy, 0, wx.ALIGN_CENTER_HORIZONTAL|wx.ALIGN_CENTER_VERTICAL, 0) |
76 | grid_sizer_3.Add(self.button_5, 0, wx.ALIGN_CENTER_HORIZONTAL|wx.ALIGN_CENTER_VERTICAL, 0) |
69 | grid_sizer_3_copy.Add(self.button_6_copy, 0, wx.ALIGN_CENTER_HORIZONTAL|wx.ALIGN_CENTER_VERTICAL, 0) |
77 | grid_sizer_3.Add(self.button_6, 0, wx.ALIGN_CENTER_HORIZONTAL|wx.ALIGN_CENTER_VERTICAL, 0) |
70 | sizer_5_copy.Add(grid_sizer_3_copy, 0, wx.EXPAND, 0) |
78 | sizer_5.Add(grid_sizer_3, 0, wx.EXPAND, 0) |
71 | sizer_5_copy.Add((20, 20), 0, 0, 0) |
79 | sizer_5.Add((20, 20), 0, 0, 0) |
72 | self.SetSizer(sizer_5_copy) |
80 | self.SetSizer(sizer_5) |
Line -... | Line 81... | ||
- | 81 | sizer_5.Fit(self) |
|
- | 82 | self.Layout() |
|
- | 83 | # end wxGlade |
|
- | 84 | ||
- | 85 | # Store some of the items, we will need them later |
|
- | 86 | self.grid_sizer_2 = grid_sizer_2 |
|
73 | sizer_5_copy.Fit(self) |
87 | self.sizer_5 = sizer_5 |
Line 74... | Line 88... | ||
74 | self.Layout() |
88 | |
75 | # end wxGlade |
89 |