1 import wx
2
3
5 - def __init__(
6 self,
7 parent,
8 ID,
9 title,
10 size = (300, 200),
11 pos = wx.DefaultPosition,
12 style = wx.DEFAULT_DIALOG_STYLE,
13 useMetal = False,
14 model = None
15 ):
16 self.parent = parent
17 self.model = model
18
19
20
21 pre = wx.PreDialog()
22 pre.SetExtraStyle(wx.DIALOG_EX_CONTEXTHELP)
23 pre.Create(parent, ID, title, pos, size, style)
24
25
26
27
28 self.PostCreate(pre)
29
30
31 if 'wxMac' in wx.PlatformInfo and useMetal:
32 self.SetExtraStyle(wx.DIALOG_EX_METAL)
33
34 self._mgr = wx.aui.AuiManager(self)
35
36 self.txts=[r'Model Name', r'Data Sets', r'Output filename']
37
38 self.DefaultTxts = [r'M1',
39 r'inline',
40 r'test.py'
41 ]
42
43 for x in xrange( 3 ):
44 wx.StaticText(self, -1, self.txts[x], (20, 20+x*40))
45
46 self.textCtrls = []
47
48 for x in xrange(3):
49 textctl = wx.TextCtrl(self,
50 -1,
51 pos=(110, 20+x*40),
52 size=wx.Size(150, 20),
53
54 )
55 self.textCtrls.append( textctl )
56
57
58 self._mgr.Update()
59
60 for x in xrange( 3 ):
61 self.textCtrls[x].SetValue( self.DefaultTxts[x] )
62
63
64 self.button = wx.Button(self,
65 wx.ID_OK,
66 '',
67 (100, 135)
68 )
69 self.cancelbutton = wx.Button(self,
70 wx.ID_CANCEL,
71 '',
72 (200, 135)
73 )
74 self.Bind(wx.aui.EVT_AUINOTEBOOK_PAGE_CLOSE, self.OnClosePage)
75 self.Bind(wx.EVT_CLOSE, self.OnClose)
76
77
78
86
87
89 ret = self.textCtrls[0].GetValue()
90 return ret
91
92
94 return self.textCtrls[1].GetValue().strip()
95
96
98 ret = self.textCtrls[2].GetValue()
99 return ret
100
101
104
105
107 self._mgr.UnInit()
108 event.Skip()
109
110
111 - def OnClosePage(self, event):
113
114
115
116
118 - def __init__(
119 self,
120 parent,
121 ID,
122 title,
123 size = (300, 200),
124 pos = wx.DefaultPosition,
125 style = wx.DEFAULT_DIALOG_STYLE,
126 useMetal = False,
127 model = None
128 ):
129 self.parent = parent
130 self.model = model
131
132
133
134 pre = wx.PreDialog()
135 pre.SetExtraStyle(wx.DIALOG_EX_CONTEXTHELP)
136 pre.Create(parent, ID, title, pos, size, style)
137
138
139
140
141 self.PostCreate(pre)
142
143
144 if 'wxMac' in wx.PlatformInfo and useMetal:
145 self.SetExtraStyle(wx.DIALOG_EX_METAL)
146
147 self._mgr = wx.aui.AuiManager(self)
148
149 self.txts=[r'Model Name', r'Data Sets', r'Output filename']
150
151 self.DefaultTxts = [r'M1',
152 r'du53.dat',
153 r'test_du53.xml'
154 ]
155
156 for x in xrange( 3 ):
157 wx.StaticText(self, -1, self.txts[x], (20, 20+x*40))
158
159 self.textCtrls = []
160
161 for x in xrange(3):
162 textctl = wx.TextCtrl(self,
163 -1,
164 pos=(110, 20+x*40),
165 size=wx.Size(150, 20),
166
167 )
168 self.textCtrls.append( textctl )
169
170
171 self._mgr.Update()
172
173 for x in xrange( 3 ):
174 self.textCtrls[x].SetValue( self.DefaultTxts[x] )
175
176
177 self.button = wx.Button(self, wx.ID_OK,'',(100, 135))
178 self.cancelbutton = wx.Button(self,
179 wx.ID_CANCEL,
180 '',
181 (200, 135)
182 )
183 self.Bind(wx.aui.EVT_AUINOTEBOOK_PAGE_CLOSE, self.OnClosePage)
184 self.Bind(wx.EVT_CLOSE, self.OnClose)
185
186
187
195
196
198 ret = self.textCtrls[0].GetValue()
199 return ret
200
201
203 return self.textCtrls[1].GetValue().strip()
204
205
207 ret = self.textCtrls[2].GetValue()
208 return ret
209
210
213
214
216 self._mgr.UnInit()
217 event.Skip()
218
219
220 - def OnClosePage(self, event):
222