Package Peach :: Package Gui :: Module gui
[hide private]

Source Code for Module Peach.Gui.gui

  1  #!/usr/bin/env python 
  2  # -*- coding: iso-8859-15 -*- 
  3  # generated by wxGlade 0.6.3 on Sun Jun 01 19:07:59 2008 
  4   
  5  import wx 
  6   
  7  # begin wxGlade: extracode 
  8  import wx.propgrid as wxpg 
  9   
 10  # end wxGlade 
 11   
 12   
 13   
14 -class PeachMainFrame(wx.Frame):
15 - def __init__(self, *args, **kwds):
16 # begin wxGlade: PeachMainFrame.__init__ 17 kwds["style"] = wx.DEFAULT_FRAME_STYLE 18 wx.Frame.__init__(self, *args, **kwds) 19 self.peachMainSplitter = wx.SplitterWindow(self, -1, style=wx.SP_3D|wx.SP_BORDER) 20 self.window_1_pane_2 = wx.Panel(self.peachMainSplitter, -1) 21 self.window_1_pane_1 = wx.Panel(self.peachMainSplitter, -1) 22 23 # Tool Bar 24 self.peachMainToolbar = wx.ToolBar(self, -1) 25 self.SetToolBar(self.peachMainToolbar) 26 self.peachMainToolbar.AddLabelTool(6001, "New", wx.Bitmap("icons\\document-new.png", wx.BITMAP_TYPE_ANY), wx.NullBitmap, wx.ITEM_NORMAL, "Create new Peach XML file", "") 27 self.peachMainToolbar.AddLabelTool(6002, "Open", wx.Bitmap("icons\\document-open.png", wx.BITMAP_TYPE_ANY), wx.NullBitmap, wx.ITEM_NORMAL, "Open Peach XML File (Ctrl-O)", "") 28 self.peachMainToolbar.AddLabelTool(6003, "Save", wx.Bitmap("icons\\document-save.png", wx.BITMAP_TYPE_ANY), wx.NullBitmap, wx.ITEM_NORMAL, "Save file (Ctrl-S)", "") 29 self.peachMainToolbar.AddLabelTool(6004, "Save As...", wx.Bitmap("icons\\document-save-as.png", wx.BITMAP_TYPE_ANY), wx.NullBitmap, wx.ITEM_NORMAL, "Save file as...", "") 30 self.peachMainToolbar.AddSeparator() 31 self.peachMainToolbar.AddLabelTool(6007, "Copy", wx.Bitmap("icons\\edit-copy.png", wx.BITMAP_TYPE_ANY), wx.NullBitmap, wx.ITEM_NORMAL, "Copy current element (Ctrl-C)", "") 32 self.peachMainToolbar.AddLabelTool(6008, "Cut", wx.Bitmap("icons\\edit-cut.png", wx.BITMAP_TYPE_ANY), wx.NullBitmap, wx.ITEM_NORMAL, "Cut current element (Ctrl-X)", "") 33 self.peachMainToolbar.AddLabelTool(6009, "Past", wx.Bitmap("icons\\edit-paste.png", wx.BITMAP_TYPE_ANY), wx.NullBitmap, wx.ITEM_NORMAL, "Paste current element (Ctrl-V)", "") 34 self.peachMainToolbar.AddSeparator() 35 self.peachMainToolbar.AddLabelTool(6010, "New Node", wx.Bitmap("icons\\list-add.png", wx.BITMAP_TYPE_ANY), wx.NullBitmap, wx.ITEM_NORMAL, "Add a new element (Insert)", "") 36 self.peachMainToolbar.AddLabelTool(6011, "Remove Node", wx.Bitmap("icons\\list-remove.png", wx.BITMAP_TYPE_ANY), wx.NullBitmap, wx.ITEM_NORMAL, "Remove current element (Delete)", "") 37 self.peachMainToolbar.AddSeparator() 38 self.peachMainToolbar.AddLabelTool(6012, "Up", wx.Bitmap("icons\\go-up.png", wx.BITMAP_TYPE_ANY), wx.NullBitmap, wx.ITEM_NORMAL, "Move element up (Ctrl-UP)", "") 39 self.peachMainToolbar.AddLabelTool(6013, "Down", wx.Bitmap("icons\\go-down.png", wx.BITMAP_TYPE_ANY), wx.NullBitmap, wx.ITEM_NORMAL, "Move element down (Ctrl-Down)", "") 40 self.peachMainToolbar.AddSeparator() 41 self.peachMainToolbar.AddLabelTool(6014, "Test", wx.Bitmap("icons\\applications-system.png", wx.BITMAP_TYPE_ANY), wx.NullBitmap, wx.ITEM_NORMAL, "Test DDL (Ctrl-T)", "") 42 self.peachMainToolbar.AddSeparator() 43 self.peachMainToolbar.AddLabelTool(6015, "About", wx.Bitmap("icons\\about.png", wx.BITMAP_TYPE_ANY), wx.NullBitmap, wx.ITEM_NORMAL, "About...", "") 44 # Tool Bar end 45 self.peachMainTree = wx.TreeCtrl(self.window_1_pane_1, -1, style=wx.TR_HAS_BUTTONS|wx.TR_LINES_AT_ROOT|wx.TR_EDIT_LABELS|wx.TR_DEFAULT_STYLE|wx.SUNKEN_BORDER) 46 self.textTreeHelp = wx.TextCtrl(self.window_1_pane_1, -1, "", style=wx.TE_MULTILINE|wx.TE_READONLY|wx.TE_WORDWRAP) 47 self.peachMainPropertyGrid = wxpg.PropertyGrid(self.window_1_pane_2, -1) 48 self.textPropHelp = wx.TextCtrl(self.window_1_pane_2, -1, "", style=wx.TE_MULTILINE|wx.TE_READONLY|wx.TE_WORDWRAP) 49 50 self.__set_properties() 51 self.__do_layout() 52 53 self.Bind(wx.EVT_TOOL, self.OnToolbarNew, id=6001) 54 self.Bind(wx.EVT_TOOL, self.OnToolbarOpen, id=6002) 55 self.Bind(wx.EVT_TOOL, self.OnToolbarSave, id=6003) 56 self.Bind(wx.EVT_TOOL, self.OnToolbarSaveAs, id=6004) 57 self.Bind(wx.EVT_TOOL, self.OnToolbarCopy, id=6007) 58 self.Bind(wx.EVT_TOOL, self.OnToolbarCut, id=6008) 59 self.Bind(wx.EVT_TOOL, self.OnToolbarPast, id=6009) 60 self.Bind(wx.EVT_TOOL, self.OnToolbarNewNode, id=6010) 61 self.Bind(wx.EVT_TOOL, self.OnToolbarRemoveNode, id=6011) 62 self.Bind(wx.EVT_TOOL, self.OnToolbarUp, id=6012) 63 self.Bind(wx.EVT_TOOL, self.OnToolbarDown, id=6013) 64 self.Bind(wx.EVT_TOOL, self.OnToolbarTest, id=6014) 65 self.Bind(wx.EVT_TOOL, self.OnToolbarAbout, id=6015) 66 self.Bind(wx.EVT_TREE_END_DRAG, self.OnTreeEndDrag, self.peachMainTree) 67 self.Bind(wx.EVT_TREE_DELETE_ITEM, self.OnTreeDeleteItem, self.peachMainTree) 68 self.Bind(wx.EVT_TREE_SEL_CHANGED, self.OnTreeSelectionChanged, self.peachMainTree) 69 self.Bind(wx.EVT_TREE_SEL_CHANGING, self.OnTreeSelectionChanging, self.peachMainTree) 70 self.Bind(wx.EVT_TREE_ITEM_ACTIVATED, self.OnTreeItemActivated, self.peachMainTree) 71 self.Bind(wx.EVT_TREE_END_LABEL_EDIT, self.OnTreeEndLabelEdit, self.peachMainTree)
72 # end wxGlade 73
74 - def __set_properties(self):
75 # begin wxGlade: PeachMainFrame.__set_properties 76 self.SetTitle("Peach Builder") 77 _icon = wx.EmptyIcon() 78 _icon.CopyFromBitmap(wx.Bitmap("icons\\peach20x20.ico", wx.BITMAP_TYPE_ANY)) 79 self.SetIcon(_icon) 80 self.peachMainToolbar.Realize() 81 self.peachMainTree.SetFocus() 82 self.textTreeHelp.SetBackgroundColour(wx.Colour(249, 255, 191)) 83 self.textTreeHelp.Hide() 84 self.textPropHelp.SetBackgroundColour(wx.Colour(249, 255, 191))
85 # end wxGlade 86
87 - def __do_layout(self):
88 # begin wxGlade: PeachMainFrame.__do_layout 89 sizer_1 = wx.BoxSizer(wx.HORIZONTAL) 90 sizer_3 = wx.BoxSizer(wx.HORIZONTAL) 91 sizer_5 = wx.BoxSizer(wx.VERTICAL) 92 sizer_2 = wx.BoxSizer(wx.HORIZONTAL) 93 sizer_6 = wx.BoxSizer(wx.VERTICAL) 94 sizer_6.Add(self.peachMainTree, 3, wx.EXPAND, 0) 95 sizer_6.Add(self.textTreeHelp, 1, wx.EXPAND, 0) 96 sizer_2.Add(sizer_6, 1, wx.EXPAND, 0) 97 self.window_1_pane_1.SetSizer(sizer_2) 98 sizer_5.Add(self.peachMainPropertyGrid, 3, wx.EXPAND, 0) 99 sizer_5.Add(self.textPropHelp, 1, wx.EXPAND, 0) 100 sizer_3.Add(sizer_5, 1, wx.EXPAND, 0) 101 self.window_1_pane_2.SetSizer(sizer_3) 102 self.peachMainSplitter.SplitVertically(self.window_1_pane_1, self.window_1_pane_2) 103 sizer_1.Add(self.peachMainSplitter, 1, wx.EXPAND, 0) 104 self.SetSizer(sizer_1) 105 sizer_1.Fit(self) 106 self.Layout()
107 # end wxGlade 108
109 - def OnToolbarNew(self, event): # wxGlade: PeachMainFrame.<event_handler>
110 print "Event handler `OnToolbarNew' not implemented!" 111 event.Skip()
112
113 - def OnToolbarOpen(self, event): # wxGlade: PeachMainFrame.<event_handler>
114 print "Event handler `OnToolbarOpen' not implemented!" 115 event.Skip() 116
117 - def OnToolbarSave(self, event): # wxGlade: PeachMainFrame.<event_handler>
118 print "Event handler `OnToolbarSave' not implemented!" 119 event.Skip() 120
121 - def OnToolbarSaveAs(self, event): # wxGlade: PeachMainFrame.<event_handler>
122 print "Event handler `OnToolbarSaveAs' not implemented!" 123 event.Skip() 124
125 - def OnToolbarCopy(self, event): # wxGlade: PeachMainFrame.<event_handler>
126 print "Event handler `OnToolbarCopy' not implemented!" 127 event.Skip() 128
129 - def OnToolbarCut(self, event): # wxGlade: PeachMainFrame.<event_handler>
130 print "Event handler `OnToolbarCut' not implemented!" 131 event.Skip() 132
133 - def OnToolbarPast(self, event): # wxGlade: PeachMainFrame.<event_handler>
134 print "Event handler `OnToolbarPast' not implemented!" 135 event.Skip() 136
137 - def OnToolbarNewNode(self, event): # wxGlade: PeachMainFrame.<event_handler>
138 print "Event handler `OnToolbarNewNode' not implemented!" 139 event.Skip() 140
141 - def OnToolbarRemoveNode(self, event): # wxGlade: PeachMainFrame.<event_handler>
142 print "Event handler `OnToolbarRemoveNode' not implemented!" 143 event.Skip() 144
145 - def OnToolbarUp(self, event): # wxGlade: PeachMainFrame.<event_handler>
146 print "Event handler `OnToolbarUp' not implemented!" 147 event.Skip() 148
149 - def OnToolbarDown(self, event): # wxGlade: PeachMainFrame.<event_handler>
150 print "Event handler `OnToolbarDown' not implemented!" 151 event.Skip() 152
153 - def OnToolbarTest(self, event): # wxGlade: PeachMainFrame.<event_handler>
154 print "Event handler `OnToolbarTest' not implemented!" 155 event.Skip() 156
157 - def OnToolbarAbout(self, event): # wxGlade: PeachMainFrame.<event_handler>
158 print "Event handler `OnToolbarAbout' not implemented!" 159 event.Skip() 160
161 - def OnTreeEndDrag(self, event): # wxGlade: PeachMainFrame.<event_handler>
162 print "Event handler `OnTreeEndDrag' not implemented!" 163 event.Skip() 164
165 - def OnTreeDeleteItem(self, event): # wxGlade: PeachMainFrame.<event_handler>
166 print "Event handler `OnTreeDeleteItem' not implemented!" 167 event.Skip() 168
169 - def OnTreeSelectionChanged(self, event): # wxGlade: PeachMainFrame.<event_handler>
170 print "Event handler `OnTreeSelectionChanged' not implemented!" 171 event.Skip() 172
173 - def OnTreeSelectionChanging(self, event): # wxGlade: PeachMainFrame.<event_handler>
174 print "Event handler `OnTreeSelectionChanging' not implemented!" 175 event.Skip() 176
177 - def OnTreeItemActivated(self, event): # wxGlade: PeachMainFrame.<event_handler>
178 print "Event handler `OnTreeItemActivated' not implemented!" 179 event.Skip() 180
181 - def OnTreeEndLabelEdit(self, event): # wxGlade: PeachMainFrame.<event_handler>
182 print "Event handler `OnTreeEndLabelEdit' not implemented!" 183 event.Skip() 184 185 # end of class PeachMainFrame 186 187
188 -class AddDialog(wx.Dialog):
189 - def __init__(self, *args, **kwds):
190 # begin wxGlade: AddDialog.__init__ 191 kwds["style"] = wx.DEFAULT_DIALOG_STYLE|wx.RESIZE_BORDER|wx.THICK_FRAME 192 wx.Dialog.__init__(self, *args, **kwds) 193 self.label_1 = wx.StaticText(self, -1, "Element Type:", style=wx.ALIGN_RIGHT) 194 self.AddDialogListBox = wx.ListBox(self, -1, choices=["asdasd", "ASDASDASD", "AADSDASD", "asdasd", "asdasd", "AAAAAA"], style=wx.LB_SINGLE|wx.LB_NEEDED_SB|wx.LB_SORT) 195 self.textAddHelp = wx.TextCtrl(self, -1, "AAAAAAAAAAAAAAAAAAAAAAAAAAAA", style=wx.TE_MULTILINE|wx.TE_READONLY) 196 self.AddDialogOkButton = wx.Button(self, wx.ID_OK, "OK") 197 self.AddDialogCancelButton = wx.Button(self, wx.ID_CANCEL, "Cancel") 198 199 self.__set_properties() 200 self.__do_layout() 201 202 self.Bind(wx.EVT_LISTBOX, self.OnListBox, self.AddDialogListBox)
203 # end wxGlade 204
205 - def __set_properties(self):
206 # begin wxGlade: AddDialog.__set_properties 207 self.SetTitle("Add Element") 208 self.AddDialogListBox.SetFocus() 209 self.AddDialogListBox.SetSelection(0) 210 self.textAddHelp.SetBackgroundColour(wx.Colour(249, 255, 191)) 211 self.AddDialogOkButton.SetDefault()
212 # end wxGlade 213
214 - def __do_layout(self):
215 # begin wxGlade: AddDialog.__do_layout 216 sizer_7 = wx.BoxSizer(wx.HORIZONTAL) 217 sizer_7_copy_1 = wx.FlexGridSizer(2, 1, 0, 0) 218 grid_sizer_1 = wx.FlexGridSizer(1, 2, 0, 0) 219 grid_sizer_5 = wx.FlexGridSizer(1, 2, 0, 0) 220 sizer_8 = wx.BoxSizer(wx.VERTICAL) 221 grid_sizer_5.Add(self.label_1, 0, wx.RIGHT, 0) 222 sizer_8.Add(self.AddDialogListBox, 2, wx.EXPAND, 0) 223 sizer_8.Add(self.textAddHelp, 1, wx.EXPAND, 0) 224 grid_sizer_5.Add(sizer_8, 1, wx.EXPAND, 0) 225 grid_sizer_5.AddGrowableRow(0) 226 grid_sizer_5.AddGrowableCol(1) 227 sizer_7_copy_1.Add(grid_sizer_5, 1, wx.EXPAND, 0) 228 grid_sizer_1.Add(self.AddDialogOkButton, 0, 0, 0) 229 grid_sizer_1.Add(self.AddDialogCancelButton, 0, 0, 0) 230 sizer_7_copy_1.Add(grid_sizer_1, 0, wx.EXPAND, 0) 231 sizer_7_copy_1.AddGrowableRow(0) 232 sizer_7_copy_1.AddGrowableCol(0) 233 sizer_7.Add(sizer_7_copy_1, 1, wx.EXPAND, 0) 234 self.SetSizer(sizer_7) 235 sizer_7.Fit(self) 236 self.Layout()
237 # end wxGlade 238
239 - def OnListBox(self, event): # wxGlade: AddDialog.<event_handler>
240 print "Event handler `OnListBox' not implemented!" 241 event.Skip()
242 243 # end of class AddDialog 244 245
246 -class AboutDialog(wx.Dialog):
247 - def __init__(self, *args, **kwds):
248 # begin wxGlade: AboutDialog.__init__ 249 kwds["style"] = wx.DEFAULT_DIALOG_STYLE 250 wx.Dialog.__init__(self, *args, **kwds) 251 self.bitmap_1 = wx.StaticBitmap(self, -1, wx.Bitmap("C:\\Peach\\Peach\\Gui\\icons\\big-peach.jpg", wx.BITMAP_TYPE_ANY)) 252 self.label_2 = wx.StaticText(self, -1, "\n Peach Builder v2.1 \n\n Copyright (c) 2007-2008 Michael Eddington \n\nhttp://peachfuzzer.com\n", style=wx.ALIGN_CENTRE) 253 self.button_1 = wx.Button(self, wx.ID_OK, "OK") 254 255 self.__set_properties() 256 self.__do_layout()
257 # end wxGlade 258
259 - def __set_properties(self):
260 # begin wxGlade: AboutDialog.__set_properties 261 self.SetTitle("About Peach Builder") 262 self.button_1.SetFocus() 263 self.button_1.SetDefault()
264 # end wxGlade 265
266 - def __do_layout(self):
267 # begin wxGlade: AboutDialog.__do_layout 268 grid_sizer_2 = wx.FlexGridSizer(2, 2, 0, 0) 269 sizer_4_copy = wx.BoxSizer(wx.HORIZONTAL) 270 grid_sizer_2.Add(self.bitmap_1, 0, 0, 0) 271 grid_sizer_2.Add(self.label_2, 0, wx.EXPAND, 0) 272 sizer_4_copy.Add(self.button_1, 1, wx.EXPAND|wx.ALIGN_RIGHT, 0) 273 grid_sizer_2.Add(sizer_4_copy, 1, wx.EXPAND, 0) 274 self.SetSizer(grid_sizer_2) 275 grid_sizer_2.Fit(self) 276 self.Layout()
277 # end wxGlade 278 279 # end of class AboutDialog 280 281
282 -class PeachTestDialog(wx.Dialog):
283 - def __init__(self, *args, **kwds):
284 # begin wxGlade: PeachTestDialog.__init__ 285 kwds["style"] = wx.DEFAULT_DIALOG_STYLE 286 wx.Dialog.__init__(self, *args, **kwds) 287 self.buttonParse = wx.Button(self, -1, "Parse") 288 self.buttonCount = wx.Button(self, -1, "Count") 289 self.buttonGenerate = wx.Button(self, -1, "Generate") 290 self.textOutput = wx.TextCtrl(self, -1, "", style=wx.TE_MULTILINE|wx.TE_READONLY|wx.HSCROLL) 291 self.buttonDone = wx.Button(self, wx.ID_OK, "Done") 292 293 self.__set_properties() 294 self.__do_layout() 295 296 self.Bind(wx.EVT_BUTTON, self.OnParse, self.buttonParse) 297 self.Bind(wx.EVT_BUTTON, self.OnCount, self.buttonCount) 298 self.Bind(wx.EVT_BUTTON, self.OnGenerate, self.buttonGenerate)
299 # end wxGlade 300
301 - def __set_properties(self):
302 # begin wxGlade: PeachTestDialog.__set_properties 303 self.SetTitle("Test DDL") 304 self.buttonParse.SetDefault() 305 self.textOutput.SetMinSize((300, 200))
306 # end wxGlade 307
308 - def __do_layout(self):
309 # begin wxGlade: PeachTestDialog.__do_layout 310 grid_sizer_3 = wx.FlexGridSizer(2, 2, 0, 0) 311 sizer_4 = wx.BoxSizer(wx.VERTICAL) 312 sizer_4.Add(self.buttonParse, 0, 0, 0) 313 sizer_4.Add(self.buttonCount, 0, 0, 0) 314 sizer_4.Add(self.buttonGenerate, 0, 0, 0) 315 grid_sizer_3.Add(sizer_4, 1, wx.EXPAND, 0) 316 grid_sizer_3.Add(self.textOutput, 0, wx.EXPAND, 0) 317 grid_sizer_3.Add(self.buttonDone, 0, 0, 0) 318 self.SetSizer(grid_sizer_3) 319 grid_sizer_3.Fit(self) 320 self.Layout()
321 # end wxGlade 322
323 - def OnParse(self, event): # wxGlade: PeachTestDialog.<event_handler>
324 print "Event handler `OnParse' not implemented!" 325 event.Skip()
326
327 - def OnCount(self, event): # wxGlade: PeachTestDialog.<event_handler>
328 print "Event handler `OnCount' not implemented!" 329 event.Skip() 330
331 - def OnGenerate(self, event): # wxGlade: PeachTestDialog.<event_handler>
332 print "Event handler `OnGenerate' not implemented!" 333 event.Skip() 334 335 # end of class PeachTestDialog 336 337
338 -class PeachValidation(wx.Frame):
339 - def __init__(self, *args, **kwds):
340 # begin wxGlade: PeachValidation.__init__ 341 kwds["style"] = wx.DEFAULT_FRAME_STYLE 342 wx.Frame.__init__(self, *args, **kwds) 343 self.splitterTopBottom = wx.SplitterWindow(self, -1, style=wx.SP_3D|wx.SP_BORDER) 344 self.window_1_pane_2 = wx.Panel(self.splitterTopBottom, -1) 345 self.splitterRightLeft = wx.SplitterWindow(self.window_1_pane_2, -1, style=wx.SP_3D|wx.SP_BORDER) 346 self.window_2_pane_2 = wx.Panel(self.splitterRightLeft, -1) 347 self.window_2_pane_1 = wx.Panel(self.splitterRightLeft, -1) 348 self.window_1_pane_1 = wx.Panel(self.splitterTopBottom, -1) 349 self.label_6 = wx.StaticText(self.window_1_pane_1, -1, "Peach XML File:") 350 self.textPeachXmlFilename = wx.TextCtrl(self.window_1_pane_1, -1, "") 351 self.buttonPeachFileBrowse = wx.Button(self.window_1_pane_1, -1, "Browse...") 352 self.buttonPeachFileLoad = wx.Button(self.window_1_pane_1, -1, "Load") 353 self.label_7 = wx.StaticText(self.window_1_pane_1, -1, "Data Model:") 354 self.comboDataModel = wx.ComboBox(self.window_1_pane_1, -1, choices=[], style=wx.CB_DROPDOWN|wx.CB_DROPDOWN|wx.CB_READONLY|wx.CB_SORT) 355 self.static_line_1 = wx.StaticLine(self.window_1_pane_1, -1) 356 self.label_3 = wx.StaticText(self.window_1_pane_1, -1, "Data file to load:") 357 self.static_line_5 = wx.StaticLine(self.window_1_pane_1, -1, style=wx.LI_VERTICAL) 358 self.label_8 = wx.StaticText(self.window_1_pane_1, -1, "Select Mutator To Test:") 359 self.textFilename = wx.TextCtrl(self.window_1_pane_1, -1, "") 360 self.buttonBrowse = wx.Button(self.window_1_pane_1, -1, "Browse...") 361 self.static_line_6 = wx.StaticLine(self.window_1_pane_1, -1, style=wx.LI_VERTICAL) 362 self.comboMutator = wx.ComboBox(self.window_1_pane_1, -1, choices=[], style=wx.CB_DROPDOWN|wx.CB_DROPDOWN|wx.CB_READONLY|wx.CB_SORT) 363 self.buttonLoad = wx.Button(self.window_1_pane_1, -1, "Validate") 364 self.static_line_7 = wx.StaticLine(self.window_1_pane_1, -1, style=wx.LI_VERTICAL) 365 self.buttonGenerate = wx.Button(self.window_1_pane_1, -1, "Mutate") 366 self.treeDataTree = wx.TreeCtrl(self.window_2_pane_1, -1, style=wx.TR_HAS_BUTTONS|wx.TR_LINES_AT_ROOT|wx.TR_DEFAULT_STYLE|wx.SUNKEN_BORDER) 367 self.textOutput = wx.TextCtrl(self.window_2_pane_2, -1, "", style=wx.TE_MULTILINE|wx.TE_READONLY) 368 369 self.__set_properties() 370 self.__do_layout() 371 372 self.Bind(wx.EVT_BUTTON, self.OnButtonPeachFileBrowse, self.buttonPeachFileBrowse) 373 self.Bind(wx.EVT_BUTTON, self.OnButtonPeachXmlLoad, self.buttonPeachFileLoad) 374 self.Bind(wx.EVT_COMBOBOX, self.OnComboDataModel, self.comboDataModel) 375 self.Bind(wx.EVT_BUTTON, self.OnButtonBrowse, self.buttonBrowse) 376 self.Bind(wx.EVT_BUTTON, self.OnButtonLoad, self.buttonLoad) 377 self.Bind(wx.EVT_BUTTON, self.OnButtonGenerate, self.buttonGenerate) 378 self.Bind(wx.EVT_TREE_SEL_CHANGED, self.OnTreeSelChanged, self.treeDataTree)
379 # end wxGlade 380
381 - def __set_properties(self):
382 # begin wxGlade: PeachValidation.__set_properties 383 self.SetTitle("Peach Validation") 384 _icon = wx.EmptyIcon() 385 _icon.CopyFromBitmap(wx.Bitmap("C:\\peach\\Peach\\Gui\\icons\\peach20x20.ico", wx.BITMAP_TYPE_ANY)) 386 self.SetIcon(_icon) 387 self.textPeachXmlFilename.SetMinSize((150, 23)) 388 self.textPeachXmlFilename.SetFocus() 389 self.textFilename.SetMinSize((150, 23)) 390 self.comboMutator.SetMinSize((200, 21)) 391 self.textOutput.SetBackgroundColour(wx.Colour(192, 192, 192)) 392 self.textOutput.SetFont(wx.Font(9, wx.MODERN, wx.NORMAL, wx.NORMAL, 0, "Courier New"))
393 # end wxGlade 394
395 - def __do_layout(self):
396 # begin wxGlade: PeachValidation.__do_layout 397 sizer_9 = wx.BoxSizer(wx.VERTICAL) 398 sizer_11 = wx.BoxSizer(wx.HORIZONTAL) 399 sizer_15 = wx.BoxSizer(wx.HORIZONTAL) 400 sizer_12 = wx.BoxSizer(wx.HORIZONTAL) 401 sizer_17 = wx.BoxSizer(wx.VERTICAL) 402 grid_sizer_6 = wx.FlexGridSizer(4, 3, 3, 3) 403 sizer_14 = wx.BoxSizer(wx.HORIZONTAL) 404 grid_sizer_4 = wx.FlexGridSizer(2, 2, 0, 0) 405 sizer_16 = wx.BoxSizer(wx.HORIZONTAL) 406 grid_sizer_4.Add(self.label_6, 0, wx.ALL, 3) 407 sizer_16.Add(self.textPeachXmlFilename, 0, wx.EXPAND, 0) 408 sizer_16.Add(self.buttonPeachFileBrowse, 0, wx.LEFT|wx.RIGHT, 3) 409 sizer_16.Add(self.buttonPeachFileLoad, 0, 0, 0) 410 grid_sizer_4.Add(sizer_16, 1, wx.EXPAND, 0) 411 grid_sizer_4.Add(self.label_7, 0, wx.ALL, 3) 412 grid_sizer_4.Add(self.comboDataModel, 0, wx.ALL|wx.EXPAND, 3) 413 sizer_17.Add(grid_sizer_4, 0, wx.ALL|wx.EXPAND, 2) 414 sizer_17.Add(self.static_line_1, 0, wx.EXPAND, 0) 415 grid_sizer_6.Add(self.label_3, 0, wx.ALL, 3) 416 grid_sizer_6.Add(self.static_line_5, 0, wx.EXPAND, 0) 417 grid_sizer_6.Add(self.label_8, 0, 0, 0) 418 sizer_14.Add(self.textFilename, 1, wx.EXPAND, 0) 419 sizer_14.Add(self.buttonBrowse, 0, wx.LEFT, 3) 420 grid_sizer_6.Add(sizer_14, 1, wx.ALL|wx.EXPAND, 2) 421 grid_sizer_6.Add(self.static_line_6, 0, wx.EXPAND, 0) 422 grid_sizer_6.Add(self.comboMutator, 1, wx.EXPAND, 0) 423 grid_sizer_6.Add(self.buttonLoad, 0, wx.ALL, 3) 424 grid_sizer_6.Add(self.static_line_7, 0, wx.EXPAND, 0) 425 grid_sizer_6.Add(self.buttonGenerate, 0, 0, 0) 426 sizer_17.Add(grid_sizer_6, 0, wx.EXPAND, 0) 427 self.window_1_pane_1.SetSizer(sizer_17) 428 sizer_12.Add(self.treeDataTree, 1, wx.EXPAND, 0) 429 self.window_2_pane_1.SetSizer(sizer_12) 430 sizer_15.Add(self.textOutput, 1, wx.EXPAND, 0) 431 self.window_2_pane_2.SetSizer(sizer_15) 432 self.splitterRightLeft.SplitVertically(self.window_2_pane_1, self.window_2_pane_2) 433 sizer_11.Add(self.splitterRightLeft, 1, wx.EXPAND, 0) 434 self.window_1_pane_2.SetSizer(sizer_11) 435 self.splitterTopBottom.SplitHorizontally(self.window_1_pane_1, self.window_1_pane_2) 436 sizer_9.Add(self.splitterTopBottom, 1, wx.EXPAND, 0) 437 self.SetSizer(sizer_9) 438 sizer_9.Fit(self) 439 self.Layout()
440 # end wxGlade 441
442 - def OnButtonPeachFileBrowse(self, event): # wxGlade: PeachValidation.<event_handler>
443 print "Event handler `OnButtonPeachFileBrowse' not implemented!" 444 event.Skip()
445
446 - def OnButtonPeachXmlLoad(self, event): # wxGlade: PeachValidation.<event_handler>
447 print "Event handler `OnButtonPeachXmlLoad' not implemented!" 448 event.Skip() 449
450 - def OnComboDataModel(self, event): # wxGlade: PeachValidation.<event_handler>
451 print "Event handler `OnComboDataModel' not implemented!" 452 event.Skip() 453
454 - def OnButtonBrowse(self, event): # wxGlade: PeachValidation.<event_handler>
455 print "Event handler `OnButtonBrowse' not implemented!" 456 event.Skip() 457
458 - def OnButtonLoad(self, event): # wxGlade: PeachValidation.<event_handler>
459 print "Event handler `OnButtonLoad' not implemented!" 460 event.Skip() 461
462 - def OnButtonGenerate(self, event): # wxGlade: PeachValidation.<event_handler>
463 print "Event handler `OnButtonGenerate' not implemented!" 464 event.Skip() 465
466 - def OnTreeSelChanged(self, event): # wxGlade: PeachValidation.<event_handler>
467 print "Event handler `OnTreeSelChanged' not implemented!" 468 event.Skip() 469 470 # end of class PeachValidation 471 472 473 if __name__ == "__main__": 474 app = wx.PySimpleApp(0) 475 wx.InitAllImageHandlers() 476 peachMain = PeachMainFrame(None, -1, "") 477 app.SetTopWindow(peachMain) 478 peachMain.Show() 479 app.MainLoop() 480