1 import wx
2 from reflutils import CheckValid
3
4
5
7 - def __init__(
8 self,
9 parent,
10 ID,
11 title,
12 size = (300, 300),
13 pos = wx.DefaultPosition,
14 style = wx.DEFAULT_DIALOG_STYLE,
15 useMetal = False,
16 ):
17 self.parent = parent
18
19 pre = wx.PreDialog()
20 pre.SetExtraStyle(wx.DIALOG_EX_CONTEXTHELP)
21 pre.Create(parent, ID, title, pos, size, style)
22
23 self.PostCreate(pre)
24
25
26 if 'wxMac' in wx.PlatformInfo and useMetal:
27 self.SetExtraStyle(wx.DIALOG_EX_METAL)
28
29 self._mgr = wx.aui.AuiManager(self)
30
31
32
33 self.Txts = [r'Name',
34 r'rho',
35 r'mu',
36 r'phi',
37 r'theta'
38 ]
39
40 self.SubstrateTxts = [r'Si',
41
42 r'2.07',
43 r'0.0',
44 r'0',
45 r'0'
46 ]
47
48 self.IncidentTxts = [r'Air',
49
50 r'0.0',
51 r'0.0',
52 r'0',
53 r'0'
54 ]
55
56 for x in xrange(5):
57 wx.StaticText(self, -1, self.Txts[x], (25, 50+x*30))
58
59 wx.StaticText(self, -1, "Incident", ( 70, 20) )
60 wx.StaticText(self, -1, "Substrate", (180, 20) )
61
62
63 self.textCtrls = []
64
65 for x in xrange(5):
66 textctl = wx.TextCtrl(self,
67 -1,
68 pos=(70, 50+x*30),
69 size=wx.Size(90, 20)
70
71 )
72 self.textCtrls.append( textctl )
73
74
75 self.textCtrls2 = []
76 for x in xrange(5):
77 textctl = wx.TextCtrl(self,
78 -1,
79 pos=(180, 50+x*30),
80 size=wx.Size(90, 20)
81
82 )
83 self.textCtrls2.append( textctl )
84
85 self._mgr.Update()
86
87 for x in xrange( 5 ):
88 self.textCtrls[x].SetValue( self.IncidentTxts[x] )
89
90 for x in xrange( 5 ):
91 self.textCtrls2[x].SetValue( self.SubstrateTxts[x] )
92
93 self.button = wx.Button(self,
94 wx.ID_OK,
95 '',
96 (100, 70+5*30)
97 )
98 self.cancelbutton = wx.Button(self,
99 wx.ID_CANCEL,
100 '',
101 (200, 70+5*30)
102 )
103
104 self.Bind(wx.aui.EVT_AUINOTEBOOK_PAGE_CLOSE, self.OnClosePage)
105 self.Bind(wx.EVT_CLOSE, self.OnClose)
106
107
108 self.layer_info=[]
109
110
111
112
114 return self.textCtrls[0].GetValue().strip()
115
117 return self.textCtrls2[0].GetValue().strip()
118
122
126
130
134
138
142
146
150
151
154
155
157 self._mgr.UnInit()
158 event.Skip()
159
160
161 - def OnClosePage(self, event):
163
164
175
176
187
188
189
190
191
193 - def __init__(
194 self,
195 parent,
196 ID,
197 title,
198 size = (300, 240),
199 pos = wx.DefaultPosition,
200 style = wx.DEFAULT_DIALOG_STYLE,
201 useMetal = False,
202 ):
203 self.parent = parent
204
205 pre = wx.PreDialog()
206 pre.SetExtraStyle(wx.DIALOG_EX_CONTEXTHELP)
207 pre.Create(parent, ID, title, pos, size, style)
208
209 self.PostCreate(pre)
210
211
212 if 'wxMac' in wx.PlatformInfo and useMetal:
213 self.SetExtraStyle(wx.DIALOG_EX_METAL)
214
215 self._mgr = wx.aui.AuiManager(self)
216
217
218
219 self.Txts = [r'Name',
220 r'rho',
221 r'mu'
222 ]
223
224 self.SubstrateTxts = [r'Si',
225
226 r'2.07',
227 r'0.0'
228 ]
229
230 self.IncidentTxts = [r'Air',
231
232 r'0.0',
233 r'0.0'
234 ]
235
236 for x in xrange(3):
237 wx.StaticText(self, -1, self.Txts[x], (25, 50+x*30))
238
239 wx.StaticText(self, -1, "Incident", ( 70, 20) )
240 wx.StaticText(self, -1, "Substrate", (180, 20) )
241
242
243 self.textCtrls = []
244
245 for x in xrange(3):
246 textctl = wx.TextCtrl(self,
247 -1,
248 pos=(70, 50+x*30),
249 size=wx.Size(90, 20)
250
251 )
252 self.textCtrls.append( textctl )
253
254
255 self.textCtrls2 = []
256 for x in xrange(3):
257 textctl = wx.TextCtrl(self,
258 -1,
259 pos=(180, 50+x*30),
260 size=wx.Size(90, 20)
261
262 )
263 self.textCtrls2.append( textctl )
264
265 self._mgr.Update()
266
267 for x in xrange( 3 ):
268 self.textCtrls[x].SetValue( self.IncidentTxts[x] )
269
270 for x in xrange( 3 ):
271 self.textCtrls2[x].SetValue( self.SubstrateTxts[x] )
272
273 self.button = wx.Button(self,
274 wx.ID_OK,
275 '',
276 (100, 70+3*30)
277 )
278 self.cancelbutton = wx.Button(self,
279 wx.ID_CANCEL,
280 '',
281 (200, 70+3*30)
282 )
283
284 self.Bind(wx.aui.EVT_AUINOTEBOOK_PAGE_CLOSE, self.OnClosePage)
285 self.Bind(wx.EVT_CLOSE, self.OnClose)
286
287
288 self.layer_info=[]
289
290
292 return self.textCtrls[0].GetValue().strip()
293
295 return self.textCtrls2[0].GetValue().strip()
296
300
304
308
312
313
316
317
319 self._mgr.UnInit()
320 event.Skip()
321
322
323 - def OnClosePage(self, event):
325
326
334
335
343