153 def create_main_panel(self):
154 self.panel = wx.Panel(self)
157 self.canvas = FigCanvas(self.panel, -1, self.fig)
159 self.xmin_control = BoundControlBox(self.panel, -1,
"X min", 0)
160 self.xmax_control = BoundControlBox(self.panel, -1,
"X max", 50)
161 self.ymin_control = BoundControlBox(self.panel, -1,
"Y min", 0)
162 self.ymax_control = BoundControlBox(self.panel, -1,
"Y max", 100)
164 self.pause_button = wx.Button(self.panel, -1,
"Pause")
165 self.Bind(wx.EVT_BUTTON, self.on_pause_button, self.pause_button)
166 self.Bind(wx.EVT_UPDATE_UI, self.on_update_pause_button, self.pause_button)
168 self.cb_grid = wx.CheckBox(self.panel, -1,
170 style=wx.ALIGN_RIGHT)
171 self.Bind(wx.EVT_CHECKBOX, self.on_cb_grid, self.cb_grid)
172 self.cb_grid.SetValue(
True)
174 self.cb_xlab = wx.CheckBox(self.panel, -1,
176 style=wx.ALIGN_RIGHT)
177 self.Bind(wx.EVT_CHECKBOX, self.on_cb_xlab, self.cb_xlab)
178 self.cb_xlab.SetValue(
True)
180 self.hbox1 = wx.BoxSizer(wx.HORIZONTAL)
181 self.hbox1.Add(self.pause_button, border=5, flag=wx.ALL | wx.ALIGN_CENTER_VERTICAL)
182 self.hbox1.AddSpacer(20)
183 self.hbox1.Add(self.cb_grid, border=5, flag=wx.ALL | wx.ALIGN_CENTER_VERTICAL)
184 self.hbox1.AddSpacer(10)
185 self.hbox1.Add(self.cb_xlab, border=5, flag=wx.ALL | wx.ALIGN_CENTER_VERTICAL)
187 self.hbox2 = wx.BoxSizer(wx.HORIZONTAL)
188 self.hbox2.Add(self.xmin_control, border=5, flag=wx.ALL)
189 self.hbox2.Add(self.xmax_control, border=5, flag=wx.ALL)
190 self.hbox2.AddSpacer(24)
191 self.hbox2.Add(self.ymin_control, border=5, flag=wx.ALL)
192 self.hbox2.Add(self.ymax_control, border=5, flag=wx.ALL)
194 self.vbox = wx.BoxSizer(wx.VERTICAL)
195 self.vbox.Add(self.canvas, 1, flag=wx.LEFT | wx.TOP | wx.GROW)
196 self.vbox.Add(self.hbox1, 0, flag=wx.ALIGN_LEFT | wx.TOP)
197 self.vbox.Add(self.hbox2, 0, flag=wx.ALIGN_LEFT | wx.TOP)
199 self.panel.SetSizer(self.vbox)