Dialogs.py
changeset 58 39cd981ff242
parent 56 7187e1c00975
child 62 1908c45f21ef
equal deleted inserted replaced
57:9bf197698af0 58:39cd981ff242
     2 # -*- coding: utf-8 -*-
     2 # -*- coding: utf-8 -*-
     3 
     3 
     4 #This file is part of PLCOpenEditor, a library implementing an IEC 61131-3 editor
     4 #This file is part of PLCOpenEditor, a library implementing an IEC 61131-3 editor
     5 #based on the plcopen standard. 
     5 #based on the plcopen standard. 
     6 #
     6 #
     7 #Copyright (C): Edouard TISSERANT and Laurent BESSARD
     7 #Copyright (C) 2007: Edouard TISSERANT and Laurent BESSARD
     8 #
     8 #
     9 #See COPYING file for copyrights details.
     9 #See COPYING file for copyrights details.
    10 #
    10 #
    11 #This library is free software; you can redistribute it and/or
    11 #This library is free software; you can redistribute it and/or
    12 #modify it under the terms of the GNU General Public
    12 #modify it under the terms of the GNU General Public
    14 #version 2.1 of the License, or (at your option) any later version.
    14 #version 2.1 of the License, or (at your option) any later version.
    15 #
    15 #
    16 #This library is distributed in the hope that it will be useful,
    16 #This library is distributed in the hope that it will be useful,
    17 #but WITHOUT ANY WARRANTY; without even the implied warranty of
    17 #but WITHOUT ANY WARRANTY; without even the implied warranty of
    18 #MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    18 #MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    19 #Lesser General Public License for more details.
    19 #General Public License for more details.
    20 #
    20 #
    21 #You should have received a copy of the GNU General Public
    21 #You should have received a copy of the GNU General Public
    22 #License along with this library; if not, write to the Free Software
    22 #License along with this library; if not, write to the Free Software
    23 #Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
    23 #Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
    24 
    24 
    30 
    30 
    31 #-------------------------------------------------------------------------------
    31 #-------------------------------------------------------------------------------
    32 #                          Create New Block Dialog
    32 #                          Create New Block Dialog
    33 #-------------------------------------------------------------------------------
    33 #-------------------------------------------------------------------------------
    34 
    34 
    35 [wxID_BLOCKPROPERTIESDIALOG, wxID_BLOCKPROPERTIESDIALOGMAINPANEL, 
    35 [wxID_BLOCKPROPERTIESDIALOG, wxID_BLOCKPROPERTIESDIALOGNAME, 
    36  wxID_BLOCKPROPERTIESDIALOGNAME, wxID_BLOCKPROPERTIESDIALOGTYPETREE, 
    36  wxID_BLOCKPROPERTIESDIALOGTYPETREE, wxID_BLOCKPROPERTIESDIALOGTYPEDESC, 
    37  wxID_BLOCKPROPERTIESDIALOGTYPEDESC, wxID_BLOCKPROPERTIESDIALOGINPUTS, 
    37  wxID_BLOCKPROPERTIESDIALOGINPUTS, wxID_BLOCKPROPERTIESDIALOGPREVIEW, 
    38  wxID_BLOCKPROPERTIESDIALOGPREVIEW, wxID_BLOCKPROPERTIESDIALOGSTATICTEXT1, 
    38  wxID_BLOCKPROPERTIESDIALOGSTATICTEXT1, wxID_BLOCKPROPERTIESDIALOGSTATICTEXT2, 
    39  wxID_BLOCKPROPERTIESDIALOGSTATICTEXT2, wxID_BLOCKPROPERTIESDIALOGSTATICTEXT3, 
    39  wxID_BLOCKPROPERTIESDIALOGSTATICTEXT3, wxID_BLOCKPROPERTIESDIALOGSTATICTEXT4, 
    40  wxID_BLOCKPROPERTIESDIALOGSTATICTEXT4, 
    40 ] = [wx.NewId() for _init_ctrls in range(10)]
    41 ] = [wx.NewId() for _init_ctrls in range(11)]
       
    42 
    41 
    43 [CATEGORY, BLOCK] = range(2)
    42 [CATEGORY, BLOCK] = range(2)
    44 
    43 
    45 class BlockPropertiesDialog(wx.Dialog):
    44 class BlockPropertiesDialog(wx.Dialog):
    46     def _init_coll_flexGridSizer1_Items(self, parent):
    45     def _init_coll_flexGridSizer1_Items(self, parent):
    47         # generated method, don't edit
    46         # generated method, don't edit
    48 
    47 
    49         parent.AddWindow(self.MainPanel, 0, border=0, flag=0)
    48         parent.AddSizer(self.MainSizer, 0, border=20, flag=wxGROW|wxTOP|wxLEFT|wxRIGHT)
       
    49         parent.AddSizer(self.ButtonSizer, 0, border=20, flag=wxALIGN_RIGHT|wxBOTTOM|wxLEFT|wxRIGHT)
       
    50 
       
    51     def _init_coll_flexGridSizer1_Growables(self, parent):
       
    52         # generated method, don't edit
       
    53 
       
    54         parent.AddGrowableCol(0)
       
    55         parent.AddGrowableRow(0)
       
    56 
       
    57     def _init_coll_MainSizer_Items(self, parent):
       
    58         # generated method, don't edit
       
    59 
       
    60         parent.AddSizer(self.LeftBoxSizer, 1, border=5, flag=wxGROW|wxRIGHT)
       
    61         parent.AddSizer(self.RightGridSizer, 1, border=5, flag=wxGROW|wxLEFT)
       
    62 
       
    63     def _init_coll_LeftBoxSizer_Items(self, parent):
       
    64         # generated method, don't edit
       
    65 
       
    66         parent.AddWindow(self.TypeTree, 3, border=5, flag=wxGROW|wxBOTTOM)
       
    67         parent.AddWindow(self.TypeDesc, 1, border=0, flag=wxGROW)
       
    68 
       
    69     def _init_coll_RightGridSizer_Items(self, parent):
       
    70         # generated method, don't edit
       
    71 
       
    72         parent.AddSizer(self.RightUpGridSizer, 0, border=0, flag=wxGROW)
       
    73         parent.AddWindow(self.staticText4, 0, border=0, flag=wxGROW)
       
    74         parent.AddWindow(self.Preview, 0, border=0, flag=wxGROW)
       
    75 
       
    76     def _init_coll_RightGridSizer_Growables(self, parent):
       
    77         # generated method, don't edit
       
    78 
       
    79         parent.AddGrowableCol(0)
       
    80         parent.AddGrowableRow(2)
       
    81 
       
    82     def _init_coll_RightUpGridSizer_Items(self, parent):
       
    83         # generated method, don't edit
       
    84 
       
    85         parent.AddWindow(self.staticText2, 0, border=0, flag=wxGROW|wxALIGN_BOTTOM)
       
    86         parent.AddWindow(self.staticText3, 0, border=0, flag=wxGROW|wxALIGN_BOTTOM)
       
    87         parent.AddWindow(self.Name, 0, border=0, flag=wxGROW)
       
    88         parent.AddWindow(self.Inputs, 0, border=0, flag=wxGROW)
    50 
    89 
    51     def _init_sizers(self):
    90     def _init_sizers(self):
    52         # generated method, don't edit
    91         # generated method, don't edit
    53         self.flexGridSizer1 = wx.FlexGridSizer(cols=1, hgap=0, rows=2, vgap=0)
    92         self.flexGridSizer1 = wx.FlexGridSizer(cols=1, hgap=0, rows=2, vgap=10)
    54 
    93         self.MainSizer = wx.BoxSizer(wxHORIZONTAL)
       
    94         self.LeftBoxSizer = wx.StaticBoxSizer(self.staticbox1, wxVERTICAL)
       
    95         self.RightGridSizer = wx.FlexGridSizer(cols=1, hgap=0, rows=3, vgap=5)
       
    96         self.RightUpGridSizer = wx.GridSizer(cols=2, hgap=5, rows=2, vgap=5)
       
    97         
    55         self._init_coll_flexGridSizer1_Items(self.flexGridSizer1)
    98         self._init_coll_flexGridSizer1_Items(self.flexGridSizer1)
    56 
    99         self._init_coll_flexGridSizer1_Growables(self.flexGridSizer1)
       
   100         self._init_coll_MainSizer_Items(self.MainSizer)
       
   101         self._init_coll_LeftBoxSizer_Items(self.LeftBoxSizer)
       
   102         self._init_coll_RightGridSizer_Items(self.RightGridSizer)
       
   103         self._init_coll_RightGridSizer_Growables(self.RightGridSizer)
       
   104         self._init_coll_RightUpGridSizer_Items(self.RightUpGridSizer)
       
   105         
    57         self.SetSizer(self.flexGridSizer1)
   106         self.SetSizer(self.flexGridSizer1)
    58 
   107 
    59     def _init_ctrls(self, prnt):
   108     def _init_ctrls(self, prnt):
    60         # generated method, don't edit
   109         # generated method, don't edit
    61         wx.Dialog.__init__(self, id=wxID_BLOCKPROPERTIESDIALOG,
   110         wx.Dialog.__init__(self, id=wxID_BLOCKPROPERTIESDIALOG,
    62               name='BlockPropertiesDialog', parent=prnt, pos=wx.Point(376, 223),
   111               name='BlockPropertiesDialog', parent=prnt, pos=wx.Point(376, 223),
    63               size=wx.Size(600, 360), style=wx.DEFAULT_DIALOG_STYLE,
   112               size=wx.Size(600, 360), style=wx.DEFAULT_DIALOG_STYLE|wxRESIZE_BORDER,
    64               title='Block Properties')
   113               title='Block Properties')
    65         self.SetClientSize(wx.Size(600, 360))
   114         self.SetClientSize(wx.Size(600, 360))
    66 
   115 
    67         self.MainPanel = wx.Panel(id=wxID_BLOCKPROPERTIESDIALOGMAINPANEL,
       
    68               name='MainPanel', parent=self, pos=wx.Point(0, 0),
       
    69               size=wx.Size(600, 320), style=wx.TAB_TRAVERSAL)
       
    70         self.MainPanel.SetAutoLayout(True)
       
    71 
       
    72         self.staticbox1 = wx.StaticBox(id=wxID_BLOCKPROPERTIESDIALOGSTATICTEXT1,
   116         self.staticbox1 = wx.StaticBox(id=wxID_BLOCKPROPERTIESDIALOGSTATICTEXT1,
    73               label='Type:', name='staticBox1', parent=self.MainPanel,
   117               label='Type:', name='staticBox1', parent=self,
    74               pos=wx.Point(24, 24), size=wx.Size(245, 280), style=0)
   118               pos=wx.Point(0, 0), size=wx.Size(0, 0), style=0)
    75 
   119 
    76         self.staticText2 = wx.StaticText(id=wxID_BLOCKPROPERTIESDIALOGSTATICTEXT2,
   120         self.staticText2 = wx.StaticText(id=wxID_BLOCKPROPERTIESDIALOGSTATICTEXT2,
    77               label='Name:', name='staticText2', parent=self.MainPanel,
   121               label='Name:', name='staticText2', parent=self,
    78               pos=wx.Point(274, 24), size=wx.Size(70, 17), style=0)
   122               pos=wx.Point(0, 0), size=wx.Size(0, 17), style=0)
    79 
   123 
    80         self.staticText3 = wx.StaticText(id=wxID_BLOCKPROPERTIESDIALOGSTATICTEXT2,
   124         self.staticText3 = wx.StaticText(id=wxID_BLOCKPROPERTIESDIALOGSTATICTEXT2,
    81               label='Inputs:', name='staticText4', parent=self.MainPanel,
   125               label='Inputs:', name='staticText4', parent=self,
    82               pos=wx.Point(424, 24), size=wx.Size(70, 17), style=0)
   126               pos=wx.Point(0, 0), size=wx.Size(0, 17), style=0)
    83 
   127 
    84         self.staticText4 = wx.StaticText(id=wxID_BLOCKPROPERTIESDIALOGSTATICTEXT4,
   128         self.staticText4 = wx.StaticText(id=wxID_BLOCKPROPERTIESDIALOGSTATICTEXT4,
    85               label='Preview:', name='staticText4', parent=self.MainPanel,
   129               label='Preview:', name='staticText4', parent=self,
    86               pos=wx.Point(274, 80), size=wx.Size(100, 17), style=0)
   130               pos=wx.Point(0, 0), size=wx.Size(0, 17), style=0)
    87 
   131 
    88         self.TypeTree = wx.TreeCtrl(id=wxID_BLOCKPROPERTIESDIALOGTYPETREE,
   132         self.TypeTree = wx.TreeCtrl(id=wxID_BLOCKPROPERTIESDIALOGTYPETREE,
    89               name='TypeTree', parent=self.MainPanel, pos=wx.Point(34, 44),
   133               name='TypeTree', parent=self, pos=wx.Point(0, 0),
    90               size=wx.Size(225, 180), style=wx.TR_HAS_BUTTONS|wx.TR_HIDE_ROOT|wx.TR_SINGLE|wx.SUNKEN_BORDER)
   134               size=wx.Size(0, 0), style=wx.TR_HAS_BUTTONS|wx.TR_HIDE_ROOT|wx.TR_SINGLE|wx.SUNKEN_BORDER)
    91         EVT_TREE_SEL_CHANGED(self, wxID_BLOCKPROPERTIESDIALOGTYPETREE, self.OnTypeTreeItemSelected)
   135         EVT_TREE_SEL_CHANGED(self, wxID_BLOCKPROPERTIESDIALOGTYPETREE, self.OnTypeTreeItemSelected)
    92 
   136 
    93         self.TypeDesc = wx.TextCtrl(id=wxID_BLOCKPROPERTIESDIALOGTYPEDESC,
   137         self.TypeDesc = wx.TextCtrl(id=wxID_BLOCKPROPERTIESDIALOGTYPEDESC,
    94               name='TypeDesc', parent=self.MainPanel, pos=wx.Point(34, 230),
   138               name='TypeDesc', parent=self, pos=wx.Point(0, 0),
    95               size=wx.Size(225, 65), style=wx.TE_READONLY|wx.TE_MULTILINE)
   139               size=wx.Size(0, 0), style=wx.TE_READONLY|wx.TE_MULTILINE)
    96 
   140 
    97         self.Name = wx.TextCtrl(id=wxID_BLOCKPROPERTIESDIALOGNAME, value='',
   141         self.Name = wx.TextCtrl(id=wxID_BLOCKPROPERTIESDIALOGNAME, value='',
    98               name='Name', parent=self.MainPanel, pos=wx.Point(274, 48),
   142               name='Name', parent=self, pos=wx.Point(0, 0),
    99               size=wx.Size(145, 24), style=0)
   143               size=wx.Size(0, 24), style=0)
   100         EVT_TEXT(self, wxID_BLOCKPROPERTIESDIALOGNAME, self.OnNameChanged)
   144         EVT_TEXT(self, wxID_BLOCKPROPERTIESDIALOGNAME, self.OnNameChanged)
   101 
   145 
   102         self.Inputs = wx.SpinCtrl(id=wxID_BLOCKPROPERTIESDIALOGINPUTS,
   146         self.Inputs = wx.SpinCtrl(id=wxID_BLOCKPROPERTIESDIALOGINPUTS,
   103               name='Inputs', parent=self.MainPanel, pos=wx.Point(424, 48),
   147               name='Inputs', parent=self, pos=wx.Point(0, 0),
   104               size=wx.Size(145, 24), style=wxSP_ARROW_KEYS, min=2, max=20)
   148               size=wx.Size(0, 24), style=wxSP_ARROW_KEYS, min=2, max=20)
   105         EVT_SPINCTRL(self, wxID_BLOCKPROPERTIESDIALOGINPUTS, self.OnInputsChanged)
   149         EVT_SPINCTRL(self, wxID_BLOCKPROPERTIESDIALOGINPUTS, self.OnInputsChanged)
   106 
   150 
   107         self.Preview = wx.Panel(id=wxID_BLOCKPROPERTIESDIALOGPREVIEW,
   151         self.Preview = wx.Panel(id=wxID_BLOCKPROPERTIESDIALOGPREVIEW,
   108               name='Preview', parent=self.MainPanel, pos=wx.Point(274, 104),
   152               name='Preview', parent=self, pos=wx.Point(0, 0),
   109               size=wx.Size(300, 200), style=wx.TAB_TRAVERSAL|wx.SIMPLE_BORDER)
   153               size=wx.Size(0, 0), style=wx.TAB_TRAVERSAL|wx.SIMPLE_BORDER)
   110         self.Preview.SetBackgroundColour(wxColour(255,255,255))
   154         self.Preview.SetBackgroundColour(wxColour(255,255,255))
   111         setattr(self.Preview, "GetDrawingMode", lambda:FREEDRAWING_MODE)
   155         setattr(self.Preview, "GetDrawingMode", lambda:FREEDRAWING_MODE)
   112 
   156 
       
   157         self.ButtonSizer = self.CreateButtonSizer(wxOK|wxCANCEL|wxCENTRE)
       
   158         
   113         self._init_sizers()
   159         self._init_sizers()
   114 
   160 
   115     def __init__(self, parent):
   161     def __init__(self, parent):
   116         self._init_ctrls(parent)
   162         self._init_ctrls(parent)
   117         self.ButtonSizer = self.CreateButtonSizer(wxOK|wxCANCEL|wxCENTRE)
       
   118         self.flexGridSizer1.Add(self.ButtonSizer, 1, wxALIGN_RIGHT)
       
   119         self.Name.SetValue("")
   163         self.Name.SetValue("")
   120         self.Name.Enable(False)
   164         self.Name.Enable(False)
   121         self.Inputs.Enable(False)
   165         self.Inputs.Enable(False)
   122         self.Block = None
   166         self.Block = None
   123         self.MinBlockSize = None
   167         self.MinBlockSize = None
   267 
   311 
   268 #-------------------------------------------------------------------------------
   312 #-------------------------------------------------------------------------------
   269 #                          Create New Variable Dialog
   313 #                          Create New Variable Dialog
   270 #-------------------------------------------------------------------------------
   314 #-------------------------------------------------------------------------------
   271 
   315 
   272 [wxID_VARIABLEPROPERTIESDIALOG, wxID_VARIABLEPROPERTIESDIALOGMAINPANEL, 
   316 [wxID_VARIABLEPROPERTIESDIALOG, wxID_VARIABLEPROPERTIESDIALOGSPACER, 
   273  wxID_VARIABLEPROPERTIESDIALOGNAME, wxID_VARIABLEPROPERTIESDIALOGCLASS, 
   317  wxID_VARIABLEPROPERTIESDIALOGNAME, wxID_VARIABLEPROPERTIESDIALOGCLASS, 
   274  wxID_VARIABLEPROPERTIESDIALOGPREVIEW, wxID_VARIABLEPROPERTIESDIALOGEXPRESSION,
   318  wxID_VARIABLEPROPERTIESDIALOGPREVIEW, wxID_VARIABLEPROPERTIESDIALOGEXPRESSION,
   275  wxID_VARIABLEPROPERTIESDIALOGSTATICTEXT1, wxID_VARIABLEPROPERTIESDIALOGSTATICTEXT2,
   319  wxID_VARIABLEPROPERTIESDIALOGSTATICTEXT1, wxID_VARIABLEPROPERTIESDIALOGSTATICTEXT2,
   276  wxID_VARIABLEPROPERTIESDIALOGSTATICTEXT3, wxID_VARIABLEPROPERTIESDIALOGSTATICTEXT4,
   320  wxID_VARIABLEPROPERTIESDIALOGSTATICTEXT3, wxID_VARIABLEPROPERTIESDIALOGSTATICTEXT4,
   277 ] = [wx.NewId() for _init_ctrls in range(10)]
   321 ] = [wx.NewId() for _init_ctrls in range(10)]
   278 
   322 
   279 class VariablePropertiesDialog(wx.Dialog):
   323 class VariablePropertiesDialog(wx.Dialog):
   280     def _init_coll_flexGridSizer1_Items(self, parent):
   324     def _init_coll_flexGridSizer1_Items(self, parent):
   281         # generated method, don't edit
   325         # generated method, don't edit
   282 
   326 
   283         parent.AddWindow(self.MainPanel, 0, border=0, flag=0)
   327         parent.AddSizer(self.MainSizer, 0, border=20, flag=wxGROW|wxTOP|wxLEFT|wxRIGHT)
   284 
   328         parent.AddSizer(self.ButtonSizer, 0, border=20, flag=wxALIGN_RIGHT|wxBOTTOM|wxLEFT|wxRIGHT)
       
   329         
       
   330     def _init_coll_flexGridSizer1_Growables(self, parent):
       
   331         # generated method, don't edit
       
   332 
       
   333         parent.AddGrowableCol(0)
       
   334         parent.AddGrowableRow(0)
       
   335     
       
   336     def _init_coll_MainSizer_Items(self, parent):
       
   337         # generated method, don't edit
       
   338 
       
   339         parent.AddSizer(self.TopSizer, 0, border=0, flag=wxGROW)
       
   340         parent.AddWindow(self.staticText4, 0, border=0, flag=wxGROW)
       
   341         parent.AddWindow(self.Preview, 0, border=0, flag=wxGROW)
       
   342         
       
   343     def _init_coll_MainSizer_Growables(self, parent):
       
   344         # generated method, don't edit
       
   345 
       
   346         parent.AddGrowableCol(0)
       
   347         parent.AddGrowableRow(2)
       
   348     
       
   349     def _init_coll_TopSizer_Items(self, parent):
       
   350         # generated method, don't edit
       
   351 
       
   352         parent.AddSizer(self.LeftGridSizer, 1, border=5, flag=wxGROW|wxRIGHT)
       
   353         parent.AddSizer(self.RightGridSizer, 1, border=5, flag=wxGROW|wxLEFT)
       
   354     
       
   355     def _init_coll_LeftGridSizer_Items(self, parent):
       
   356         # generated method, don't edit
       
   357 
       
   358         parent.AddWindow(self.staticText1, 0, border=0, flag=wxGROW)
       
   359         parent.AddWindow(self.Class, 0, border=0, flag=wxGROW)
       
   360         parent.AddWindow(self.Spacer, 0, border=0, flag=wxGROW)
       
   361         parent.AddWindow(self.staticText2, 0, border=0, flag=wxGROW)
       
   362         parent.AddWindow(self.Expression, 0, border=0, flag=wxGROW)
       
   363     
       
   364     def _init_coll_LeftGridSizer_Growables(self, parent):
       
   365         # generated method, don't edit
       
   366 
       
   367         parent.AddGrowableCol(0)
       
   368         parent.AddGrowableRow(2)
       
   369             
       
   370     def _init_coll_RightGridSizer_Items(self, parent):
       
   371         # generated method, don't edit
       
   372 
       
   373         parent.AddWindow(self.staticText3, 0, border=0, flag=wxGROW)
       
   374         parent.AddWindow(self.Name, 0, border=0, flag=wxGROW)
       
   375         
       
   376     def _init_coll_RightGridSizer_Growables(self, parent):
       
   377         # generated method, don't edit
       
   378 
       
   379         parent.AddGrowableCol(0)
       
   380         parent.AddGrowableRow(1)
       
   381         
   285     def _init_sizers(self):
   382     def _init_sizers(self):
   286         # generated method, don't edit
   383         # generated method, don't edit
   287         self.flexGridSizer1 = wx.FlexGridSizer(cols=1, hgap=0, rows=2, vgap=0)
   384         self.flexGridSizer1 = wx.FlexGridSizer(cols=1, hgap=0, rows=2, vgap=10)
       
   385         self.MainSizer = wx.FlexGridSizer(cols=1, hgap=0, rows=3, vgap=5)
       
   386         self.TopSizer = wx.BoxSizer(wxHORIZONTAL)
       
   387         self.LeftGridSizer = wx.FlexGridSizer(cols=1, hgap=0, rows=5, vgap=5)
       
   388         self.RightGridSizer = wx.FlexGridSizer(cols=1, hgap=0, rows=2, vgap=5)
   288 
   389 
   289         self._init_coll_flexGridSizer1_Items(self.flexGridSizer1)
   390         self._init_coll_flexGridSizer1_Items(self.flexGridSizer1)
   290 
   391         self._init_coll_flexGridSizer1_Growables(self.flexGridSizer1)
       
   392         self._init_coll_MainSizer_Items(self.MainSizer)
       
   393         self._init_coll_MainSizer_Growables(self.MainSizer)
       
   394         self._init_coll_TopSizer_Items(self.TopSizer)
       
   395         self._init_coll_LeftGridSizer_Items(self.LeftGridSizer)
       
   396         self._init_coll_LeftGridSizer_Growables(self.LeftGridSizer)
       
   397         self._init_coll_RightGridSizer_Items(self.RightGridSizer)
       
   398         self._init_coll_RightGridSizer_Growables(self.RightGridSizer)
       
   399         
   291         self.SetSizer(self.flexGridSizer1)
   400         self.SetSizer(self.flexGridSizer1)
   292 
   401 
   293     def _init_ctrls(self, prnt):
   402     def _init_ctrls(self, prnt):
   294         # generated method, don't edit
   403         # generated method, don't edit
   295         wx.Dialog.__init__(self, id=wxID_VARIABLEPROPERTIESDIALOG,
   404         wx.Dialog.__init__(self, id=wxID_VARIABLEPROPERTIESDIALOG,
   296               name='VariablePropertiesDialog', parent=prnt, pos=wx.Point(376, 223),
   405               name='VariablePropertiesDialog', parent=prnt, pos=wx.Point(376, 223),
   297               size=wx.Size(400, 380), style=wx.DEFAULT_DIALOG_STYLE,
   406               size=wx.Size(400, 380), style=wx.DEFAULT_DIALOG_STYLE,
   298               title='Variable Properties')
   407               title='Variable Properties')
   299         self.SetClientSize(wx.Size(400, 380))
   408         self.SetClientSize(wx.Size(400, 380))
   300 
   409 
   301         self.MainPanel = wx.Panel(id=wxID_VARIABLEPROPERTIESDIALOGMAINPANEL,
       
   302               name='MainPanel', parent=self, pos=wx.Point(0, 0),
       
   303               size=wx.Size(400, 280), style=wx.TAB_TRAVERSAL)
       
   304         self.MainPanel.SetAutoLayout(True)
       
   305 
       
   306         self.staticText1 = wx.StaticText(id=wxID_VARIABLEPROPERTIESDIALOGSTATICTEXT1,
   410         self.staticText1 = wx.StaticText(id=wxID_VARIABLEPROPERTIESDIALOGSTATICTEXT1,
   307               label='Class:', name='staticText1', parent=self.MainPanel,
   411               label='Class:', name='staticText1', parent=self,
   308               pos=wx.Point(24, 24), size=wx.Size(70, 17), style=0)
   412               pos=wx.Point(0, 0), size=wx.Size(0, 17), style=0)
   309 
   413 
   310         self.staticText2 = wx.StaticText(id=wxID_VARIABLEPROPERTIESDIALOGSTATICTEXT2,
   414         self.staticText2 = wx.StaticText(id=wxID_VARIABLEPROPERTIESDIALOGSTATICTEXT2,
   311               label='Expression:', name='staticText2', parent=self.MainPanel,
   415               label='Expression:', name='staticText2', parent=self,
   312               pos=wx.Point(24, 90), size=wx.Size(100, 17), style=0)
   416               pos=wx.Point(0, 0), size=wx.Size(0, 17), style=0)
   313 
   417 
   314         self.staticText3 = wx.StaticText(id=wxID_VARIABLEPROPERTIESDIALOGSTATICTEXT3,
   418         self.staticText3 = wx.StaticText(id=wxID_VARIABLEPROPERTIESDIALOGSTATICTEXT3,
   315               label='Name:', name='staticText3', parent=self.MainPanel,
   419               label='Name:', name='staticText3', parent=self,
   316               pos=wx.Point(204, 24), size=wx.Size(70, 17), style=0)
   420               pos=wx.Point(0, 0), size=wx.Size(0, 17), style=0)
   317 
   421 
   318         self.staticText4 = wx.StaticText(id=wxID_VARIABLEPROPERTIESDIALOGSTATICTEXT4,
   422         self.staticText4 = wx.StaticText(id=wxID_VARIABLEPROPERTIESDIALOGSTATICTEXT4,
   319               label='Preview:', name='staticText4', parent=self.MainPanel,
   423               label='Preview:', name='staticText4', parent=self,
   320               pos=wx.Point(24, 144), size=wx.Size(100, 17), style=0)
   424               pos=wx.Point(0, 0), size=wx.Size(0, 17), style=0)
   321 
   425 
   322         self.Class = wx.Choice(id=wxID_VARIABLEPROPERTIESDIALOGCLASS,
   426         self.Class = wx.Choice(id=wxID_VARIABLEPROPERTIESDIALOGCLASS,
   323               name='Class', parent=self.MainPanel, pos=wx.Point(24, 48),
   427               name='Class', parent=self, pos=wx.Point(0, 0),
   324               size=wx.Size(145, 24), style=0)
   428               size=wx.Size(0, 24), style=0)
   325         EVT_CHOICE(self, wxID_VARIABLEPROPERTIESDIALOGCLASS, self.OnClassChanged)
   429         EVT_CHOICE(self, wxID_VARIABLEPROPERTIESDIALOGCLASS, self.OnClassChanged)
   326         
   430         
   327         self.Name = wx.ListBox(id=wxID_VARIABLEPROPERTIESDIALOGNAME,
   431         self.Name = wx.ListBox(id=wxID_VARIABLEPROPERTIESDIALOGNAME,
   328               name='Name', parent=self.MainPanel, pos=wx.Point(204, 48),
   432               name='Name', parent=self, pos=wx.Point(0, 0),
   329               size=wx.Size(145, 90), style=wx.LB_SINGLE)
   433               size=wx.Size(0, 90), style=wx.LB_SINGLE)
   330         EVT_LISTBOX(self, wxID_VARIABLEPROPERTIESDIALOGNAME, self.OnNameChanged)
   434         EVT_LISTBOX(self, wxID_VARIABLEPROPERTIESDIALOGNAME, self.OnNameChanged)
   331 
   435 
   332         self.Expression = wx.TextCtrl(id=wxID_VARIABLEPROPERTIESDIALOGEXPRESSION,
   436         self.Expression = wx.TextCtrl(id=wxID_VARIABLEPROPERTIESDIALOGEXPRESSION,
   333               name='Expression', parent=self.MainPanel, pos=wx.Point(24, 114),
   437               name='Expression', parent=self, pos=wx.Point(0, 0),
   334               size=wx.Size(145, 24), style=0)
   438               size=wx.Size(0, 24), style=0)
   335         EVT_TEXT(self, wxID_VARIABLEPROPERTIESDIALOGEXPRESSION, self.OnExpressionChanged)
   439         EVT_TEXT(self, wxID_VARIABLEPROPERTIESDIALOGEXPRESSION, self.OnExpressionChanged)
   336 
   440 
       
   441         self.Spacer = wx.Panel(id=wxID_VARIABLEPROPERTIESDIALOGSPACER,
       
   442               name='Spacer', parent=self, pos=wx.Point(0, 0),
       
   443               size=wx.Size(0, 0), style=wx.TAB_TRAVERSAL)
       
   444 
   337         self.Preview = wx.Panel(id=wxID_VARIABLEPROPERTIESDIALOGPREVIEW,
   445         self.Preview = wx.Panel(id=wxID_VARIABLEPROPERTIESDIALOGPREVIEW,
   338               name='Preview', parent=self.MainPanel, pos=wx.Point(24, 170),
   446               name='Preview', parent=self, pos=wx.Point(0, 0),
   339               size=wx.Size(350, 150), style=wx.TAB_TRAVERSAL|wx.SIMPLE_BORDER)
   447               size=wx.Size(0, 0), style=wx.TAB_TRAVERSAL|wx.SIMPLE_BORDER)
   340         self.Preview.SetBackgroundColour(wxColour(255,255,255))
   448         self.Preview.SetBackgroundColour(wxColour(255,255,255))
   341         setattr(self.Preview, "GetDrawingMode", lambda:FREEDRAWING_MODE)
   449         setattr(self.Preview, "GetDrawingMode", lambda:FREEDRAWING_MODE)
   342 
   450 
       
   451         self.ButtonSizer = self.CreateButtonSizer(wxOK|wxCANCEL|wxCENTRE)
       
   452 
   343         self._init_sizers()
   453         self._init_sizers()
   344 
   454 
   345     def __init__(self, parent):
   455     def __init__(self, parent):
   346         self._init_ctrls(parent)
   456         self._init_ctrls(parent)
   347         self.ButtonSizer = self.CreateButtonSizer(wxOK|wxCANCEL|wxCENTRE)
       
   348         self.flexGridSizer1.Add(self.ButtonSizer, 1, wxALIGN_RIGHT)
       
   349         self.Variable = None
   457         self.Variable = None
   350         self.VarList = []
   458         self.VarList = []
   351         self.MinVariableSize = None
   459         self.MinVariableSize = None
   352         self.RefreshNameList()
   460         self.RefreshNameList()
   353         
   461