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