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