~launchpad-p-s/sofastatistics/main

« back to all changes in this revision

Viewing changes to make_table_gui.py

  • Committer: Grant Paton-Simpson
  • Date: 2009-05-19 04:21:43 UTC
  • Revision ID: g@ubuntu-20090519042143-p561mbokz3inefvd
Initial import

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#! /usr/bin/env python
 
2
# -*- coding: utf-8 -*-
 
3
 
 
4
#leave one of these out and it might fail silently!
 
5
import sys
 
6
import os
 
7
import pprint
 
8
import wx
 
9
import wx.gizmos
 
10
 
 
11
import demotables
 
12
import dimtables
 
13
import dimtree
 
14
import full_html
 
15
import getdata
 
16
import make_table
 
17
import projects
 
18
import util
 
19
 
 
20
SCRIPT_PATH = util.get_script_path()
 
21
 
 
22
             
 
23
class DlgMakeTable(wx.Dialog, make_table.MakeTable, dimtree.DimTree):
 
24
    
 
25
    def __init__(self, title, dbe, conn_dets, default_dbs=None, 
 
26
                 default_tbls=None, fil_labels="", fil_css="", fil_report="", 
 
27
                 fil_script="", var_labels=None, var_notes=None, 
 
28
                 val_dics=None, pos=wx.DefaultPosition, size=wx.DefaultSize):
 
29
         
 
30
        wx.Dialog.__init__(self, parent=None, id=-1, title=title, pos=pos,
 
31
                          style=wx.MINIMIZE_BOX | wx.MAXIMIZE_BOX | \
 
32
                          wx.RESIZE_BORDER | wx.SYSTEM_MENU | \
 
33
                          wx.CAPTION | wx.CLOSE_BOX | \
 
34
                          wx.CLIP_CHILDREN)
 
35
        self.fil_labels = fil_labels
 
36
        self.fil_css = fil_css
 
37
        self.fil_report = fil_report
 
38
        self.fil_script = fil_script        
 
39
        self.var_labels, self.var_notes, self.val_dics = \
 
40
            projects.GetLabels(fil_labels)            
 
41
        self.open_html = []
 
42
        self.open_scripts = []
 
43
        self.col_no_vars_item = None # needed if no variable in columns
 
44
        # set up panel for frame
 
45
        self.panel = wx.Panel(self)
 
46
        ib = wx.IconBundle()
 
47
        ib.AddIconFromFile(os.path.join(SCRIPT_PATH, "images", 
 
48
                                        "python_logo_only_16.xpm"), 
 
49
                           wx.BITMAP_TYPE_XPM)
 
50
        self.SetIcons(ib)
 
51
        # Data details
 
52
        # Databases
 
53
        lblDatabases = wx.StaticText(self.panel, -1, "Database:")
 
54
        lblDatabases.SetFont(font=wx.Font(11, wx.SWISS, wx.NORMAL, wx.BOLD))
 
55
        # set up self.dropDatabases and self.dropTables
 
56
        getdata.setupDataDropdowns(self, self.panel, dbe, conn_dets, 
 
57
                                   default_dbs, default_tbls)
 
58
        self.dropDatabases.Bind(wx.EVT_CHOICE, self.OnDatabaseSel)
 
59
        # Tables
 
60
        lblTables = wx.StaticText(self.panel, -1, "Table:")
 
61
        lblTables.SetFont(font=wx.Font(11, wx.SWISS, wx.NORMAL, wx.BOLD))
 
62
        self.dropTables.Bind(wx.EVT_CHOICE, self.OnTableSel)
 
63
        # Data config details
 
64
        lblLabelPath = wx.StaticText(self.panel, -1, "Labels:")
 
65
        lblLabelPath.SetFont(font=wx.Font(11, wx.SWISS, wx.NORMAL, wx.BOLD))
 
66
        self.txtLabelsFile = wx.TextCtrl(self.panel, -1, self.fil_labels, 
 
67
                                         size=(250,-1))
 
68
        self.txtLabelsFile.Bind(wx.EVT_KILL_FOCUS, self.OnLabelFileLostFocus)
 
69
        btnLabelPath = wx.Button(self.panel, -1, "Browse ...")
 
70
        btnLabelPath.Bind(wx.EVT_BUTTON, self.OnButtonLabelPath)
 
71
        #btnLabelPath.Bind(wx.EVT_ENTER_WINDOW, self.LabelPathEnterWindow)
 
72
        #btnLabelPath.Bind(wx.EVT_LEAVE_WINDOW, self.BlankStatusBar)
 
73
        # CSS style config details
 
74
        lblCssPath = wx.StaticText(self.panel, -1, "CSS file:")
 
75
        lblCssPath.SetFont(font=wx.Font(11, wx.SWISS, wx.NORMAL, wx.BOLD))
 
76
        self.txtCssFile = wx.TextCtrl(self.panel, -1, self.fil_css, 
 
77
                                      size=(250,-1))
 
78
        self.txtCssFile.Bind(wx.EVT_KILL_FOCUS, self.OnCssFileLostFocus)
 
79
        btnCssPath = wx.Button(self.panel, -1, "Browse ...")
 
80
        btnCssPath.Bind(wx.EVT_BUTTON, self.OnButtonCssPath)
 
81
        #btnCssPath.Bind(wx.EVT_ENTER_WINDOW, self.CssPathEnterWindow)
 
82
        #btnCssPath.Bind(wx.EVT_LEAVE_WINDOW, self.BlankStatusBar)
 
83
        # Output details
 
84
        # report 
 
85
        lblReportPath = wx.StaticText(self.panel, -1, "Report:")
 
86
        lblReportPath.SetFont(font=wx.Font(11, wx.SWISS, wx.NORMAL, wx.BOLD))
 
87
        self.txtReportFile = wx.TextCtrl(self.panel, -1, self.fil_report, 
 
88
                                         size=(250,-1))
 
89
        self.txtReportFile.Bind(wx.EVT_KILL_FOCUS, self.OnReportFileLostFocus)
 
90
        btnReportPath = wx.Button(self.panel, -1, "Browse ...")
 
91
        btnReportPath.Bind(wx.EVT_BUTTON, self.OnButtonReportPath)
 
92
        #btnReportPath.Bind(wx.EVT_ENTER_WINDOW, self.ReportPathEnterWindow)
 
93
        #btnReportPath.Bind(wx.EVT_LEAVE_WINDOW, self.BlankStatusBar)
 
94
        # script
 
95
        lblScriptPath = wx.StaticText(self.panel, -1, "Script:")
 
96
        lblScriptPath.SetFont(font=wx.Font(11, wx.SWISS, wx.NORMAL, wx.BOLD))
 
97
        self.txtScriptFile = wx.TextCtrl(self.panel, -1, self.fil_script, 
 
98
                                   size=(250,-1))
 
99
        self.txtScriptFile.Bind(wx.EVT_KILL_FOCUS, self.OnScriptFileLostFocus)
 
100
        btnScriptPath = wx.Button(self.panel, -1, "Browse ...")
 
101
        btnScriptPath.Bind(wx.EVT_BUTTON, self.OnButtonScriptPath)
 
102
        #btnScriptPath.Bind(wx.EVT_ENTER_WINDOW, self.ScriptPathEnterWindow)
 
103
        #btnScriptPath.Bind(wx.EVT_LEAVE_WINDOW, self.BlankStatusBar)
 
104
        # title details
 
105
        lblTitles = wx.StaticText(self.panel, -1, "Title:")
 
106
        lblTitles.SetFont(font=wx.Font(11, wx.SWISS, wx.NORMAL, wx.BOLD))
 
107
        self.txtTitles = wx.TextCtrl(self.panel, -1, size=(50,40), 
 
108
                                     style=wx.TE_MULTILINE)
 
109
        self.txtTitles.Bind(wx.EVT_TEXT, self.OnTitleChange)
 
110
        lblSubtitles = wx.StaticText(self.panel, -1, "Subtitle:")
 
111
        lblSubtitles.SetFont(font=wx.Font(11, wx.SWISS, wx.NORMAL, 
 
112
                                          wx.BOLD))
 
113
        self.txtSubtitles = wx.TextCtrl(self.panel, -1, size=(50,40), 
 
114
                                        style=wx.TE_MULTILINE)
 
115
        self.txtSubtitles.Bind(wx.EVT_TEXT, self.OnSubtitleChange)
 
116
        #radio
 
117
        self.radTabType = wx.RadioBox(self.panel, -1, "Table Type", 
 
118
                         choices=("Column measures e.g. FREQ, row % etc",
 
119
                                  "Summarise rows e.g. MEAN, MEDIAN etc",
 
120
                                  "Display table data as is"),
 
121
                         style=wx.RA_SPECIFY_ROWS)
 
122
        self.radTabType.Bind(wx.EVT_RADIOBOX, self.OnTabTypeChange)
 
123
        self.tab_type = self.radTabType.GetSelection()
 
124
        # option checkboxs
 
125
        self.chkTotalsRow = wx.CheckBox(self.panel, -1, "Totals Row?")
 
126
        self.chkTotalsRow.Bind(wx.EVT_CHECKBOX, self.OnChkTotalsRow)
 
127
        self.chkFirstAsLabel = wx.CheckBox(self.panel, -1, 
 
128
                                           "First col as label?")
 
129
        self.chkFirstAsLabel.Bind(wx.EVT_CHECKBOX, self.OnChkFirstAsLabel)
 
130
        self.EnableOpts(enable=False)
 
131
        #text labels
 
132
        lblRows = wx.StaticText(self.panel, -1, "Rows:")
 
133
        lblRows.SetFont(font=wx.Font(11, wx.SWISS, wx.NORMAL, wx.BOLD))
 
134
        lblCols = wx.StaticText(self.panel, -1, "Columns:")
 
135
        lblCols.SetFont(font=wx.Font(11, wx.SWISS, wx.NORMAL, wx.BOLD))
 
136
        #buttons
 
137
        #rows
 
138
        self.btnRowAdd = wx.Button(self.panel, -1, "Add")
 
139
        self.btnRowAdd.Bind(wx.EVT_BUTTON, self.OnRowAdd)
 
140
        #self.btnRowAdd.Bind(wx.EVT_ENTER_WINDOW, self.OnAddRowEnterWindow)
 
141
        #self.btnRowAdd.Bind(wx.EVT_LEAVE_WINDOW, self.BlankStatusBar)
 
142
        self.btnRowAddUnder = wx.Button(self.panel, -1, "Add Under")
 
143
        self.btnRowAddUnder.Bind(wx.EVT_BUTTON, self.OnRowAddUnder)
 
144
        #self.btnRowAddUnder.Bind(wx.EVT_ENTER_WINDOW, self.OnAddRowUnderEnterWindow)
 
145
        #self.btnRowAddUnder.Bind(wx.EVT_LEAVE_WINDOW, self.BlankStatusBar)
 
146
        self.btnRowDel = wx.Button(self.panel, -1, "Delete")
 
147
        self.btnRowDel.Bind(wx.EVT_BUTTON, self.OnRowDelete)
 
148
        #self.btnRowDel.Bind(wx.EVT_ENTER_WINDOW, self.OnDeleteRowEnterWindow)
 
149
        #self.btnRowDel.Bind(wx.EVT_LEAVE_WINDOW, self.BlankStatusBar)
 
150
        self.btnRowConf = wx.Button(self.panel, -1, "Config")
 
151
        self.btnRowConf.Bind(wx.EVT_BUTTON, self.OnRowConfig)
 
152
        #self.btnRowConf.Bind(wx.EVT_ENTER_WINDOW, self.OnConfigRowEnterWindow)
 
153
        #self.btnRowConf.Bind(wx.EVT_LEAVE_WINDOW, self.BlankStatusBar)
 
154
        #cols
 
155
        self.btnColAdd = wx.Button(self.panel, -1, "Add")
 
156
        self.btnColAdd.Bind(wx.EVT_BUTTON, self.OnColAdd)
 
157
        #self.btnColAdd.Bind(wx.EVT_ENTER_WINDOW, self.OnAddColEnterWindow)
 
158
        #self.btnColAdd.Bind(wx.EVT_LEAVE_WINDOW, self.BlankStatusBar)
 
159
        self.btnColAddUnder = wx.Button(self.panel, -1, "Add Under")
 
160
        self.btnColAddUnder.Bind(wx.EVT_BUTTON, self.OnColAddUnder)
 
161
        #self.btnColAddUnder.Bind(wx.EVT_ENTER_WINDOW, 
 
162
        #                    self.OnAddColUnderEnterWindow)
 
163
        #self.btnColAddUnder.Bind(wx.EVT_LEAVE_WINDOW, self.BlankStatusBar)
 
164
        self.btnColDel = wx.Button(self.panel, -1, "Delete")
 
165
        self.btnColDel.Bind(wx.EVT_BUTTON, self.OnColDelete)
 
166
        #self.btnColDel.Bind(wx.EVT_ENTER_WINDOW, 
 
167
        #               self.OnDeleteColEnterWindow)
 
168
        #self.btnColDel.Bind(wx.EVT_LEAVE_WINDOW, self.BlankStatusBar)
 
169
        self.btnColConf = wx.Button(self.panel, -1, "Config")
 
170
        self.btnColConf.Bind(wx.EVT_BUTTON, self.OnColConfig)
 
171
        #self.btnColConf.Bind(wx.EVT_ENTER_WINDOW, 
 
172
        #                self.OnConfigColEnterWindow)
 
173
        #self.btnColConf.Bind(wx.EVT_LEAVE_WINDOW, self.BlankStatusBar)
 
174
        #main
 
175
        btnRun = wx.Button(self.panel, -1, "RUN")
 
176
        btnRun.Bind(wx.EVT_BUTTON, self.OnButtonRun)
 
177
        #btnRun.Bind(wx.EVT_ENTER_WINDOW, self.OnRunEnterWindow)
 
178
        #btnRun.Bind(wx.EVT_LEAVE_WINDOW, self.BlankStatusBar)        
 
179
        btnExport = wx.Button(self.panel, -1, "EXPORT")
 
180
        btnExport.Bind(wx.EVT_BUTTON, self.OnButtonExport)
 
181
        #btnExport.Bind(wx.EVT_ENTER_WINDOW, self.OnExportEnterWindow)
 
182
        #btnExport.Bind(wx.EVT_LEAVE_WINDOW, self.BlankStatusBar)
 
183
        btnHelp = wx.Button(self.panel, -1, "HELP")
 
184
        #btnHelp.Bind(wx.EVT_BUTTON, self.OnButtonView)
 
185
        #btnHelp.Bind(wx.EVT_ENTER_WINDOW, self.OnHelpEnterWindow)
 
186
        #btnHelp.Bind(wx.EVT_LEAVE_WINDOW, self.BlankStatusBar)
 
187
        btnClear = wx.Button(self.panel, -1, "CLEAR")
 
188
        btnClear.Bind(wx.EVT_BUTTON, self.OnButtonClear)
 
189
        #btnClear.Bind(wx.EVT_ENTER_WINDOW, self.OnClearEnterWindow)
 
190
        #btnClear.Bind(wx.EVT_LEAVE_WINDOW, self.BlankStatusBar)
 
191
        btnClose = wx.Button(self.panel, -1, "CLOSE")
 
192
        btnClose.Bind(wx.EVT_BUTTON, self.OnClose)
 
193
        #btnClose.Bind(wx.EVT_ENTER_WINDOW, self.OnCloseEnterWindow)
 
194
        #btnClose.Bind(wx.EVT_LEAVE_WINDOW, self.BlankStatusBar)
 
195
        #trees
 
196
        self.rowtree = wx.gizmos.TreeListCtrl(self.panel, -1, 
 
197
              style=wx.TR_FULL_ROW_HIGHLIGHT|wx.TR_HIDE_ROOT|wx.TR_MULTIPLE)
 
198
        self.rowtree.Bind(wx.EVT_TREE_ITEM_ACTIVATED, self.OnRowItemActivated)
 
199
        self.rowtree.Bind(wx.EVT_TREE_ITEM_RIGHT_CLICK, self.OnRowItemRightClick)
 
200
        self.rowRoot = self.setupDimTree(self.rowtree)
 
201
        self.coltree = wx.gizmos.TreeListCtrl(self.panel, -1, 
 
202
              style=wx.TR_FULL_ROW_HIGHLIGHT|wx.TR_HIDE_ROOT|wx.TR_MULTIPLE)
 
203
        self.coltree.Bind(wx.EVT_TREE_ITEM_ACTIVATED, self.OnColItemActivated)
 
204
        self.coltree.Bind(wx.EVT_TREE_ITEM_RIGHT_CLICK, self.OnColItemRightClick)
 
205
        self.colRoot = self.setupDimTree(self.coltree)
 
206
        #setup demo table type
 
207
        self.demo_tab = demotables.GenDemoTable(txtTitles=self.txtTitles, 
 
208
                                 txtSubtitles=self.txtSubtitles,
 
209
                                 colRoot=self.colRoot, 
 
210
                                 rowRoot=self.rowRoot, 
 
211
                                 rowtree=self.rowtree, 
 
212
                                 coltree=self.coltree, 
 
213
                                 col_no_vars_item=self.col_no_vars_item, 
 
214
                                 var_labels=self.var_labels, 
 
215
                                 val_dics=self.val_dics,
 
216
                                 fil_css=self.fil_css)
 
217
        self.html = full_html.FullHTML(self.panel, size=(200,250))
 
218
        
 
219
        #self.html = wx.webview.WebView(self.panel, -1, size=(200,250))
 
220
        
 
221
        lbldemo_tbls = wx.StaticText(self.panel, -1, "Demonstration Table:")
 
222
        lbldemo_tbls.SetFont(font=wx.Font(11, wx.SWISS, wx.NORMAL, wx.BOLD))
 
223
        # main section SIZERS **************************************************************
 
224
        szrMain = wx.BoxSizer(wx.VERTICAL)
 
225
        bxData = wx.StaticBox(self.panel, -1, "Data Source")
 
226
        szrData = wx.StaticBoxSizer(bxData, wx.HORIZONTAL)
 
227
        szrConfig = wx.BoxSizer(wx.HORIZONTAL)
 
228
        bxOutput = wx.StaticBox(self.panel, -1, "Output")
 
229
        szrOutput = wx.StaticBoxSizer(bxOutput, wx.HORIZONTAL)
 
230
        szrMid = wx.BoxSizer(wx.HORIZONTAL)
 
231
        szrDims = wx.BoxSizer(wx.HORIZONTAL)
 
232
        #1 MAIN
 
233
        #2 DATA
 
234
        #3 DATA INNER
 
235
        szrDataInner = wx.BoxSizer(wx.HORIZONTAL)
 
236
        szrDataInner.Add(lblDatabases, 0, wx.LEFT|wx.RIGHT, 5)
 
237
        szrDataInner.Add(self.dropDatabases, 0, wx.RIGHT, 10)
 
238
        szrDataInner.Add(lblTables, 0, wx.RIGHT, 5)
 
239
        szrDataInner.Add(self.dropTables, 0)
 
240
        szrData.Add(szrDataInner)
 
241
        #2 CONFIG
 
242
        #3 DATA CONFIG
 
243
        bxDataConfig = wx.StaticBox(self.panel, -1, "Data Config")
 
244
        szrDataConfig = wx.StaticBoxSizer(bxDataConfig, wx.HORIZONTAL)
 
245
        #3 DATA CONFIG INNER
 
246
        szrDataConfigInner = wx.BoxSizer(wx.HORIZONTAL)
 
247
        szrDataConfigInner.Add(lblLabelPath, 0, wx.LEFT|wx.RIGHT, 5)
 
248
        szrDataConfigInner.Add(self.txtLabelsFile, 1, wx.GROW|wx.RIGHT, 10)
 
249
        szrDataConfigInner.Add(btnLabelPath, 0)
 
250
        szrDataConfig.Add(szrDataConfigInner, 1)
 
251
        szrConfig.Add(szrDataConfig, 1, wx.RIGHT, 10)
 
252
        #3 CSS CONFIG
 
253
        bxCssConfig = wx.StaticBox(self.panel, -1, "Table Style")
 
254
        szrCssConfig = wx.StaticBoxSizer(bxCssConfig, wx.HORIZONTAL)
 
255
        #3 CSS CONFIG INNER
 
256
        szrCssConfigInner = wx.BoxSizer(wx.HORIZONTAL)
 
257
        szrCssConfigInner.Add(lblCssPath, 0, wx.LEFT|wx.RIGHT, 5)
 
258
        szrCssConfigInner.Add(self.txtCssFile, 1, wx.GROW|wx.RIGHT, 10)
 
259
        szrCssConfigInner.Add(btnCssPath, 0)
 
260
        szrCssConfig.Add(szrCssConfigInner, 1)
 
261
        szrConfig.Add(szrCssConfig, 1)
 
262
        #2 OUTPUT
 
263
        #3 OUTPUT INNER
 
264
        szrOutputInner = wx.BoxSizer(wx.HORIZONTAL)
 
265
        # report 
 
266
        szrOutputInner.Add(lblReportPath, 0, wx.LEFT|wx.RIGHT, 5)
 
267
        szrOutputInner.Add(self.txtReportFile, 1, wx.GROW|wx.RIGHT, 10)
 
268
        szrOutputInner.Add(btnReportPath, 0, wx.RIGHT, 10)
 
269
        # script
 
270
        szrOutputInner.Add(lblScriptPath, 0, wx.LEFT|wx.RIGHT, 5)
 
271
        szrOutputInner.Add(self.txtScriptFile, 1, wx.GROW|wx.RIGHT, 10)
 
272
        szrOutputInner.Add(btnScriptPath, 0)
 
273
        szrOutput.Add(szrOutputInner, 1)
 
274
        #2 MID
 
275
        #3 TABTYPE
 
276
        szrTabType = wx.BoxSizer(wx.HORIZONTAL)
 
277
        szrTabType.Add(self.radTabType, 0)
 
278
        #3 TITLES/OPTIONS
 
279
        szrTitlesOptions = wx.BoxSizer(wx.VERTICAL)
 
280
        #4 TITLE DETS
 
281
        szrTitleDets = wx.BoxSizer(wx.HORIZONTAL)
 
282
        #5 TITLES
 
283
        szrTitles = wx.BoxSizer(wx.VERTICAL)
 
284
        szrTitles.Add(lblTitles, 0)
 
285
        szrTitles.Add(self.txtTitles, 0, wx.GROW)
 
286
        #5 Subtitles
 
287
        szrSubtitles = wx.BoxSizer(wx.VERTICAL)
 
288
        szrSubtitles.Add(lblSubtitles, 0)
 
289
        szrSubtitles.Add(self.txtSubtitles, 0, wx.GROW)
 
290
        #4 TITLE assembly
 
291
        szrTitleDets.Add(szrTitles, 1, wx.GROW|wx.LEFT, 5)
 
292
        szrTitleDets.Add(szrSubtitles, 1, wx.GROW|wx.LEFT, 5)
 
293
        #4 totals row
 
294
        szrOpts = wx.BoxSizer(wx.HORIZONTAL)
 
295
        szrOpts.Add(self.chkTotalsRow, 0, wx.LEFT|wx.TOP, 5)        
 
296
        szrOpts.Add(self.chkFirstAsLabel, 0, wx.LEFT|wx.TOP, 5)
 
297
        #3 TITLES/OPTIONS assembly      
 
298
        szrTitlesOptions.Add(szrTitleDets, 1, wx.GROW|wx.LEFT, 5)
 
299
        szrTitlesOptions.Add(szrOpts, 0, wx.LEFT, 5)
 
300
        #3 MID assembly
 
301
        szrMid.Add(szrTabType, 0)
 
302
        szrMid.Add(szrTitlesOptions, 1, wx.GROW)
 
303
        #2 DIMS
 
304
        #3 TREES
 
305
        szrTrees = wx.BoxSizer(wx.HORIZONTAL)
 
306
        #4 ROWS
 
307
        szrRows = wx.BoxSizer(wx.VERTICAL)
 
308
        szrRows.Add(lblRows, 0)
 
309
        szrRowButtons = wx.BoxSizer(wx.HORIZONTAL)
 
310
        szrRowButtons.Add(self.btnRowAdd, 0, wx.RIGHT, 2)
 
311
        szrRowButtons.Add(self.btnRowAddUnder, 0, wx.RIGHT, 2)
 
312
        szrRowButtons.Add(self.btnRowDel, 0, wx.RIGHT, 2)
 
313
        szrRowButtons.Add(self.btnRowConf)
 
314
        szrRows.Add(szrRowButtons, 0)
 
315
        szrRows.Add(self.rowtree, 1, wx.GROW)
 
316
        #4 COLS
 
317
        szrCols = wx.BoxSizer(wx.VERTICAL)
 
318
        szrCols.Add(lblCols, 0)
 
319
        szrColButtons = wx.BoxSizer(wx.HORIZONTAL)
 
320
        szrColButtons.Add(self.btnColAdd, 0, wx.RIGHT, 2)
 
321
        szrColButtons.Add(self.btnColAddUnder, 0, wx.RIGHT, 2)
 
322
        szrColButtons.Add(self.btnColDel, 0, wx.RIGHT, 2)
 
323
        szrColButtons.Add(self.btnColConf)
 
324
        szrCols.Add(szrColButtons)
 
325
        szrCols.Add(self.coltree, 1, wx.GROW)
 
326
        #3 TREES assemble
 
327
        szrTrees.Add(szrRows, 1, wx.GROW|wx.RIGHT, 2)
 
328
        szrTrees.Add(szrCols, 1, wx.GROW|wx.LEFT, 2)
 
329
        #3 BUTTONS
 
330
        szrButtons = wx.FlexGridSizer(rows=3, cols=1, hgap=5, vgap=5)
 
331
        szrButtons.AddGrowableRow(2,2) #only relevant if surrounding sizer 
 
332
        #  stretched vertically enough by its content
 
333
        szrButtons.Add(btnRun, 0, wx.TOP, 0)
 
334
        szrButtons.Add(btnExport, 0)
 
335
        szrButtons.Add(btnHelp, 0)
 
336
        szrButtons.Add(btnClear, 0)
 
337
        szrButtons.Add(btnClose, 1, wx.ALIGN_BOTTOM)
 
338
        #2 MID assemble
 
339
        szrDims.Add(szrTrees, 1, wx.GROW|wx.RIGHT, 5)
 
340
        szrDims.Add(szrButtons, 0, wx.GROW)
 
341
        #2 HTML
 
342
        szrHtml = wx.BoxSizer(wx.VERTICAL)
 
343
        szrHtml.Add(lbldemo_tbls, 0)
 
344
        szrHtml.Add(self.html, 1, wx.GROW)
 
345
        #1 MAIN assemble
 
346
        szrMain.Add(szrData, 0, wx.GROW|wx.LEFT|wx.RIGHT|wx.TOP, 10)
 
347
        szrMain.Add(szrConfig, 0, wx.GROW|wx.LEFT|wx.RIGHT, 10)
 
348
        szrMain.Add(szrOutput, 0, wx.GROW|wx.LEFT|wx.RIGHT, 10)
 
349
        szrMain.Add(szrMid, 0, wx.GROW|wx.ALL, 10)
 
350
        szrMain.Add(szrDims, 1, wx.GROW|wx.LEFT|wx.RIGHT|wx.BOTTOM, 10)
 
351
        szrMain.Add(szrHtml, 2, wx.GROW|wx.LEFT|wx.RIGHT, 10)
 
352
        #status bar
 
353
        #self.statusbar = self.CreateStatusBar()
 
354
        #attach main sizer to panel>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
 
355
        self.panel.SetSizer(szrMain)
 
356
        szrMain.SetSizeHints(self)
 
357
        self.Fit() #needed, otherwise initial display problem with 
 
358
        #  status bar