127 |
126 |
128 filesOpen = args |
127 filesOpen = args |
129 ScriptDirectory = sys.path[0] |
128 ScriptDirectory = sys.path[0] |
130 |
129 |
131 |
130 |
132 [wxID_OBJDICTEDIT, wxID_OBJDICTEDITFILEOPENED, |
131 [ID_OBJDICTEDIT, ID_OBJDICTEDITFILEOPENED, |
133 wxID_OBJDICTEDITHELPBAR, |
132 ID_OBJDICTEDITHELPBAR, |
134 ] = [wx.NewId() for _init_ctrls in range(3)] |
133 ] = [wx.NewId() for _init_ctrls in range(3)] |
135 |
134 |
136 [wxID_OBJDICTEDITADDMENUITEMS0, wxID_OBJDICTEDITADDMENUITEMS1, |
135 [ID_OBJDICTEDITADDMENUITEMS0, ID_OBJDICTEDITADDMENUITEMS1, |
137 wxID_OBJDICTEDITADDMENUITEMS2, wxID_OBJDICTEDITADDMENUITEMS3, |
136 ID_OBJDICTEDITADDMENUITEMS2, ID_OBJDICTEDITADDMENUITEMS3, |
138 wxID_OBJDICTEDITADDMENUITEMS4, wxID_OBJDICTEDITADDMENUITEMS5, |
137 ID_OBJDICTEDITADDMENUITEMS4, ID_OBJDICTEDITADDMENUITEMS5, |
139 ] = [wx.NewId() for _init_coll_AddMenu_Items in range(6)] |
138 ] = [wx.NewId() for _init_coll_AddMenu_Items in range(6)] |
140 |
139 |
141 [wxID_OBJDICTEDITFILEMENUITEMS0, wxID_OBJDICTEDITFILEMENUITEMS1, |
140 [ID_OBJDICTEDITFILEMENUITEMS0, ID_OBJDICTEDITFILEMENUITEMS1, |
142 wxID_OBJDICTEDITFILEMENUITEMS2, wxID_OBJDICTEDITFILEMENUITEMS4, |
141 ID_OBJDICTEDITFILEMENUITEMS2, ID_OBJDICTEDITFILEMENUITEMS4, |
143 wxID_OBJDICTEDITFILEMENUITEMS5, wxID_OBJDICTEDITFILEMENUITEMS6, |
142 ID_OBJDICTEDITFILEMENUITEMS5, ID_OBJDICTEDITFILEMENUITEMS6, |
144 wxID_OBJDICTEDITFILEMENUITEMS7, wxID_OBJDICTEDITFILEMENUITEMS8, |
143 ID_OBJDICTEDITFILEMENUITEMS7, ID_OBJDICTEDITFILEMENUITEMS8, |
145 wxID_OBJDICTEDITFILEMENUITEMS9, |
144 ID_OBJDICTEDITFILEMENUITEMS9, |
146 ] = [wx.NewId() for _init_coll_FileMenu_Items in range(9)] |
145 ] = [wx.NewId() for _init_coll_FileMenu_Items in range(9)] |
147 |
146 |
148 [wxID_OBJDICTEDITEDITMENUITEMS0, wxID_OBJDICTEDITEDITMENUITEMS1, |
147 [ID_OBJDICTEDITEDITMENUITEMS0, ID_OBJDICTEDITEDITMENUITEMS1, |
149 wxID_OBJDICTEDITEDITMENUITEMS2, wxID_OBJDICTEDITEDITMENUITEMS4, |
148 ID_OBJDICTEDITEDITMENUITEMS2, ID_OBJDICTEDITEDITMENUITEMS4, |
150 wxID_OBJDICTEDITEDITMENUITEMS6, wxID_OBJDICTEDITEDITMENUITEMS7, |
149 ID_OBJDICTEDITEDITMENUITEMS6, ID_OBJDICTEDITEDITMENUITEMS7, |
151 wxID_OBJDICTEDITEDITMENUITEMS8, |
150 ID_OBJDICTEDITEDITMENUITEMS8, |
152 ] = [wx.NewId() for _init_coll_EditMenu_Items in range(7)] |
151 ] = [wx.NewId() for _init_coll_EditMenu_Items in range(7)] |
153 |
152 |
154 [wxID_OBJDICTEDITHELPMENUITEMS0, wxID_OBJDICTEDITHELPMENUITEMS1, |
153 [ID_OBJDICTEDITHELPMENUITEMS0, ID_OBJDICTEDITHELPMENUITEMS1, |
155 wxID_OBJDICTEDITHELPMENUITEMS2, |
154 ID_OBJDICTEDITHELPMENUITEMS2, |
156 ] = [wx.NewId() for _init_coll_HelpMenu_Items in range(3)] |
155 ] = [wx.NewId() for _init_coll_HelpMenu_Items in range(3)] |
157 |
156 |
158 class objdictedit(wx.Frame): |
157 class objdictedit(wx.Frame): |
159 def _init_coll_menuBar1_Menus(self, parent): |
158 def _init_coll_menuBar1_Menus(self, parent): |
160 # generated method, don't edit |
|
161 |
|
162 parent.Append(menu=self.FileMenu, title='File') |
159 parent.Append(menu=self.FileMenu, title='File') |
163 parent.Append(menu=self.EditMenu, title='Edit') |
160 parent.Append(menu=self.EditMenu, title='Edit') |
164 parent.Append(menu=self.AddMenu, title='Add') |
161 parent.Append(menu=self.AddMenu, title='Add') |
165 parent.Append(menu=self.HelpMenu, title='Help') |
162 parent.Append(menu=self.HelpMenu, title='Help') |
166 |
163 |
167 def _init_coll_EditMenu_Items(self, parent): |
164 def _init_coll_EditMenu_Items(self, parent): |
168 # generated method, don't edit |
165 parent.Append(help='', id=ID_OBJDICTEDITEDITMENUITEMS4, |
169 |
|
170 parent.Append(help='', id=wxID_OBJDICTEDITEDITMENUITEMS4, |
|
171 kind=wx.ITEM_NORMAL, text='Refresh\tCTRL+R') |
166 kind=wx.ITEM_NORMAL, text='Refresh\tCTRL+R') |
172 parent.AppendSeparator() |
167 parent.AppendSeparator() |
173 parent.Append(help='', id=wxID_OBJDICTEDITEDITMENUITEMS1, |
168 parent.Append(help='', id=ID_OBJDICTEDITEDITMENUITEMS1, |
174 kind=wx.ITEM_NORMAL, text='Undo\tCTRL+Z') |
169 kind=wx.ITEM_NORMAL, text='Undo\tCTRL+Z') |
175 parent.Append(help='', id=wxID_OBJDICTEDITEDITMENUITEMS0, |
170 parent.Append(help='', id=ID_OBJDICTEDITEDITMENUITEMS0, |
176 kind=wx.ITEM_NORMAL, text='Redo\tCTRL+Y') |
171 kind=wx.ITEM_NORMAL, text='Redo\tCTRL+Y') |
177 parent.AppendSeparator() |
172 parent.AppendSeparator() |
178 parent.Append(help='', id=wxID_OBJDICTEDITEDITMENUITEMS6, |
173 parent.Append(help='', id=ID_OBJDICTEDITEDITMENUITEMS6, |
179 kind=wx.ITEM_NORMAL, text='Node infos') |
174 kind=wx.ITEM_NORMAL, text='Node infos') |
180 parent.Append(help='', id=wxID_OBJDICTEDITEDITMENUITEMS2, |
175 parent.Append(help='', id=ID_OBJDICTEDITEDITMENUITEMS2, |
181 kind=wx.ITEM_NORMAL, text='DS-301 Profile') |
176 kind=wx.ITEM_NORMAL, text='DS-301 Profile') |
182 parent.Append(help='', id=wxID_OBJDICTEDITEDITMENUITEMS8, |
177 parent.Append(help='', id=ID_OBJDICTEDITEDITMENUITEMS8, |
183 kind=wx.ITEM_NORMAL, text='DS-302 Profile') |
178 kind=wx.ITEM_NORMAL, text='DS-302 Profile') |
184 parent.Append(help='', id=wxID_OBJDICTEDITEDITMENUITEMS7, |
179 parent.Append(help='', id=ID_OBJDICTEDITEDITMENUITEMS7, |
185 kind=wx.ITEM_NORMAL, text='Other Profile') |
180 kind=wx.ITEM_NORMAL, text='Other Profile') |
186 self.Bind(wx.EVT_MENU, self.OnUndoMenu, |
181 self.Bind(wx.EVT_MENU, self.OnUndoMenu, |
187 id=wxID_OBJDICTEDITEDITMENUITEMS1) |
182 id=ID_OBJDICTEDITEDITMENUITEMS1) |
188 self.Bind(wx.EVT_MENU, self.OnRedoMenu, |
183 self.Bind(wx.EVT_MENU, self.OnRedoMenu, |
189 id=wxID_OBJDICTEDITEDITMENUITEMS0) |
184 id=ID_OBJDICTEDITEDITMENUITEMS0) |
190 self.Bind(wx.EVT_MENU, self.OnCommunicationMenu, |
185 self.Bind(wx.EVT_MENU, self.OnCommunicationMenu, |
191 id=wxID_OBJDICTEDITEDITMENUITEMS2) |
186 id=ID_OBJDICTEDITEDITMENUITEMS2) |
192 self.Bind(wx.EVT_MENU, self.OnRefreshMenu, |
187 self.Bind(wx.EVT_MENU, self.OnRefreshMenu, |
193 id=wxID_OBJDICTEDITEDITMENUITEMS4) |
188 id=ID_OBJDICTEDITEDITMENUITEMS4) |
194 self.Bind(wx.EVT_MENU, self.OnNodeInfosMenu, |
189 self.Bind(wx.EVT_MENU, self.OnNodeInfosMenu, |
195 id=wxID_OBJDICTEDITEDITMENUITEMS6) |
190 id=ID_OBJDICTEDITEDITMENUITEMS6) |
196 self.Bind(wx.EVT_MENU, self.OnEditProfileMenu, |
191 self.Bind(wx.EVT_MENU, self.OnEditProfileMenu, |
197 id=wxID_OBJDICTEDITEDITMENUITEMS7) |
192 id=ID_OBJDICTEDITEDITMENUITEMS7) |
198 self.Bind(wx.EVT_MENU, self.OnOtherCommunicationMenu, |
193 self.Bind(wx.EVT_MENU, self.OnOtherCommunicationMenu, |
199 id=wxID_OBJDICTEDITEDITMENUITEMS8) |
194 id=ID_OBJDICTEDITEDITMENUITEMS8) |
200 |
195 |
201 def _init_coll_HelpMenu_Items(self, parent): |
196 def _init_coll_HelpMenu_Items(self, parent): |
202 # generated method, don't edit |
197 parent.Append(help='', id=ID_OBJDICTEDITHELPMENUITEMS0, |
203 |
|
204 parent.Append(help='', id=wxID_OBJDICTEDITHELPMENUITEMS0, |
|
205 kind=wx.ITEM_NORMAL, text='DS-301 Standard\tF1') |
198 kind=wx.ITEM_NORMAL, text='DS-301 Standard\tF1') |
206 self.Bind(wx.EVT_MENU, self.OnHelpDS301Menu, |
199 self.Bind(wx.EVT_MENU, self.OnHelpDS301Menu, |
207 id=wxID_OBJDICTEDITHELPMENUITEMS0) |
200 id=ID_OBJDICTEDITHELPMENUITEMS0) |
208 parent.Append(help='', id=wxID_OBJDICTEDITHELPMENUITEMS1, |
201 parent.Append(help='', id=ID_OBJDICTEDITHELPMENUITEMS1, |
209 kind=wx.ITEM_NORMAL, text='CAN Festival Docs\tF2') |
202 kind=wx.ITEM_NORMAL, text='CAN Festival Docs\tF2') |
210 self.Bind(wx.EVT_MENU, self.OnHelpCANFestivalMenu, |
203 self.Bind(wx.EVT_MENU, self.OnHelpCANFestivalMenu, |
211 id=wxID_OBJDICTEDITHELPMENUITEMS1) |
204 id=ID_OBJDICTEDITHELPMENUITEMS1) |
212 if Html_Window: |
205 if Html_Window: |
213 parent.Append(help='', id=wxID_OBJDICTEDITHELPMENUITEMS2, |
206 parent.Append(help='', id=ID_OBJDICTEDITHELPMENUITEMS2, |
214 kind=wx.ITEM_NORMAL, text='About') |
207 kind=wx.ITEM_NORMAL, text='About') |
215 self.Bind(wx.EVT_MENU, self.OnAboutMenu, |
208 self.Bind(wx.EVT_MENU, self.OnAboutMenu, |
216 id=wxID_OBJDICTEDITHELPMENUITEMS2) |
209 id=ID_OBJDICTEDITHELPMENUITEMS2) |
217 |
210 |
218 def _init_coll_FileMenu_Items(self, parent): |
211 def _init_coll_FileMenu_Items(self, parent): |
219 # generated method, don't edit |
212 parent.Append(help='', id=ID_OBJDICTEDITFILEMENUITEMS5, |
220 |
|
221 parent.Append(help='', id=wxID_OBJDICTEDITFILEMENUITEMS5, |
|
222 kind=wx.ITEM_NORMAL, text='New\tCTRL+N') |
213 kind=wx.ITEM_NORMAL, text='New\tCTRL+N') |
223 parent.Append(help='', id=wxID_OBJDICTEDITFILEMENUITEMS0, |
214 parent.Append(help='', id=ID_OBJDICTEDITFILEMENUITEMS0, |
224 kind=wx.ITEM_NORMAL, text='Open\tCTRL+O') |
215 kind=wx.ITEM_NORMAL, text='Open\tCTRL+O') |
225 parent.Append(help='', id=wxID_OBJDICTEDITFILEMENUITEMS1, |
216 parent.Append(help='', id=ID_OBJDICTEDITFILEMENUITEMS1, |
226 kind=wx.ITEM_NORMAL, text='Save\tCTRL+S') |
217 kind=wx.ITEM_NORMAL, text='Save\tCTRL+S') |
227 parent.Append(help='', id=wxID_OBJDICTEDITFILEMENUITEMS6, |
218 parent.Append(help='', id=ID_OBJDICTEDITFILEMENUITEMS6, |
228 kind=wx.ITEM_NORMAL, text='Save As...\tALT+S') |
219 kind=wx.ITEM_NORMAL, text='Save As...\tALT+S') |
229 parent.Append(help='', id=wxID_OBJDICTEDITFILEMENUITEMS2, |
220 parent.Append(help='', id=ID_OBJDICTEDITFILEMENUITEMS2, |
230 kind=wx.ITEM_NORMAL, text='Close\tCTRL+W') |
221 kind=wx.ITEM_NORMAL, text='Close\tCTRL+W') |
231 parent.AppendSeparator() |
222 parent.AppendSeparator() |
232 parent.Append(help='', id=wxID_OBJDICTEDITFILEMENUITEMS7, |
223 parent.Append(help='', id=ID_OBJDICTEDITFILEMENUITEMS7, |
233 kind=wx.ITEM_NORMAL, text='Import EDS file') |
224 kind=wx.ITEM_NORMAL, text='Import EDS file') |
234 parent.Append(help='', id=wxID_OBJDICTEDITFILEMENUITEMS9, |
225 parent.Append(help='', id=ID_OBJDICTEDITFILEMENUITEMS9, |
235 kind=wx.ITEM_NORMAL, text='Export to EDS file') |
226 kind=wx.ITEM_NORMAL, text='Export to EDS file') |
236 parent.Append(help='', id=wxID_OBJDICTEDITFILEMENUITEMS8, |
227 parent.Append(help='', id=ID_OBJDICTEDITFILEMENUITEMS8, |
237 kind=wx.ITEM_NORMAL, text='Build Dictionary\tCTRL+B') |
228 kind=wx.ITEM_NORMAL, text='Build Dictionary\tCTRL+B') |
238 parent.AppendSeparator() |
229 parent.AppendSeparator() |
239 parent.Append(help='', id=wxID_OBJDICTEDITFILEMENUITEMS4, |
230 parent.Append(help='', id=ID_OBJDICTEDITFILEMENUITEMS4, |
240 kind=wx.ITEM_NORMAL, text='Exit') |
231 kind=wx.ITEM_NORMAL, text='Exit') |
241 self.Bind(wx.EVT_MENU, self.OnOpenMenu, |
232 self.Bind(wx.EVT_MENU, self.OnOpenMenu, |
242 id=wxID_OBJDICTEDITFILEMENUITEMS0) |
233 id=ID_OBJDICTEDITFILEMENUITEMS0) |
243 self.Bind(wx.EVT_MENU, self.OnSaveMenu, |
234 self.Bind(wx.EVT_MENU, self.OnSaveMenu, |
244 id=wxID_OBJDICTEDITFILEMENUITEMS1) |
235 id=ID_OBJDICTEDITFILEMENUITEMS1) |
245 self.Bind(wx.EVT_MENU, self.OnCloseMenu, |
236 self.Bind(wx.EVT_MENU, self.OnCloseMenu, |
246 id=wxID_OBJDICTEDITFILEMENUITEMS2) |
237 id=ID_OBJDICTEDITFILEMENUITEMS2) |
247 self.Bind(wx.EVT_MENU, self.OnQuitMenu, |
238 self.Bind(wx.EVT_MENU, self.OnQuitMenu, |
248 id=wxID_OBJDICTEDITFILEMENUITEMS4) |
239 id=ID_OBJDICTEDITFILEMENUITEMS4) |
249 self.Bind(wx.EVT_MENU, self.OnNewMenu, |
240 self.Bind(wx.EVT_MENU, self.OnNewMenu, |
250 id=wxID_OBJDICTEDITFILEMENUITEMS5) |
241 id=ID_OBJDICTEDITFILEMENUITEMS5) |
251 self.Bind(wx.EVT_MENU, self.OnSaveAsMenu, |
242 self.Bind(wx.EVT_MENU, self.OnSaveAsMenu, |
252 id=wxID_OBJDICTEDITFILEMENUITEMS6) |
243 id=ID_OBJDICTEDITFILEMENUITEMS6) |
253 self.Bind(wx.EVT_MENU, self.OnImportEDSMenu, |
244 self.Bind(wx.EVT_MENU, self.OnImportEDSMenu, |
254 id=wxID_OBJDICTEDITFILEMENUITEMS7) |
245 id=ID_OBJDICTEDITFILEMENUITEMS7) |
255 self.Bind(wx.EVT_MENU, self.OnExportCMenu, |
246 self.Bind(wx.EVT_MENU, self.OnExportCMenu, |
256 id=wxID_OBJDICTEDITFILEMENUITEMS8) |
247 id=ID_OBJDICTEDITFILEMENUITEMS8) |
257 self.Bind(wx.EVT_MENU, self.OnExportEDSMenu, |
248 self.Bind(wx.EVT_MENU, self.OnExportEDSMenu, |
258 id=wxID_OBJDICTEDITFILEMENUITEMS9) |
249 id=ID_OBJDICTEDITFILEMENUITEMS9) |
259 |
250 |
260 def _init_coll_AddMenu_Items(self, parent): |
251 def _init_coll_AddMenu_Items(self, parent): |
261 # generated method, don't edit |
252 parent.Append(help='', id=ID_OBJDICTEDITADDMENUITEMS0, |
262 |
|
263 parent.Append(help='', id=wxID_OBJDICTEDITADDMENUITEMS0, |
|
264 kind=wx.ITEM_NORMAL, text='SDO Server') |
253 kind=wx.ITEM_NORMAL, text='SDO Server') |
265 parent.Append(help='', id=wxID_OBJDICTEDITADDMENUITEMS1, |
254 parent.Append(help='', id=ID_OBJDICTEDITADDMENUITEMS1, |
266 kind=wx.ITEM_NORMAL, text='SDO Client') |
255 kind=wx.ITEM_NORMAL, text='SDO Client') |
267 parent.Append(help='', id=wxID_OBJDICTEDITADDMENUITEMS2, |
256 parent.Append(help='', id=ID_OBJDICTEDITADDMENUITEMS2, |
268 kind=wx.ITEM_NORMAL, text='PDO Transmit') |
257 kind=wx.ITEM_NORMAL, text='PDO Transmit') |
269 parent.Append(help='', id=wxID_OBJDICTEDITADDMENUITEMS3, |
258 parent.Append(help='', id=ID_OBJDICTEDITADDMENUITEMS3, |
270 kind=wx.ITEM_NORMAL, text='PDO Receive') |
259 kind=wx.ITEM_NORMAL, text='PDO Receive') |
271 parent.Append(help='', id=wxID_OBJDICTEDITADDMENUITEMS4, |
260 parent.Append(help='', id=ID_OBJDICTEDITADDMENUITEMS4, |
272 kind=wx.ITEM_NORMAL, text='Map Variable') |
261 kind=wx.ITEM_NORMAL, text='Map Variable') |
273 parent.Append(help='', id=wxID_OBJDICTEDITADDMENUITEMS5, |
262 parent.Append(help='', id=ID_OBJDICTEDITADDMENUITEMS5, |
274 kind=wx.ITEM_NORMAL, text='User Type') |
263 kind=wx.ITEM_NORMAL, text='User Type') |
275 self.Bind(wx.EVT_MENU, self.OnAddSDOServerMenu, |
264 self.Bind(wx.EVT_MENU, self.OnAddSDOServerMenu, |
276 id=wxID_OBJDICTEDITADDMENUITEMS0) |
265 id=ID_OBJDICTEDITADDMENUITEMS0) |
277 self.Bind(wx.EVT_MENU, self.OnAddSDOClientMenu, |
266 self.Bind(wx.EVT_MENU, self.OnAddSDOClientMenu, |
278 id=wxID_OBJDICTEDITADDMENUITEMS1) |
267 id=ID_OBJDICTEDITADDMENUITEMS1) |
279 self.Bind(wx.EVT_MENU, self.OnAddPDOTransmitMenu, |
268 self.Bind(wx.EVT_MENU, self.OnAddPDOTransmitMenu, |
280 id=wxID_OBJDICTEDITADDMENUITEMS2) |
269 id=ID_OBJDICTEDITADDMENUITEMS2) |
281 self.Bind(wx.EVT_MENU, self.OnAddPDOReceiveMenu, |
270 self.Bind(wx.EVT_MENU, self.OnAddPDOReceiveMenu, |
282 id=wxID_OBJDICTEDITADDMENUITEMS3) |
271 id=ID_OBJDICTEDITADDMENUITEMS3) |
283 self.Bind(wx.EVT_MENU, self.OnAddMapVariableMenu, |
272 self.Bind(wx.EVT_MENU, self.OnAddMapVariableMenu, |
284 id=wxID_OBJDICTEDITADDMENUITEMS4) |
273 id=ID_OBJDICTEDITADDMENUITEMS4) |
285 self.Bind(wx.EVT_MENU, self.OnAddUserTypeMenu, |
274 self.Bind(wx.EVT_MENU, self.OnAddUserTypeMenu, |
286 id=wxID_OBJDICTEDITADDMENUITEMS5) |
275 id=ID_OBJDICTEDITADDMENUITEMS5) |
287 |
276 |
288 def _init_coll_HelpBar_Fields(self, parent): |
277 def _init_coll_HelpBar_Fields(self, parent): |
289 # generated method, don't edit |
|
290 parent.SetFieldsCount(3) |
278 parent.SetFieldsCount(3) |
291 |
279 |
292 parent.SetStatusText(number=0, text='') |
280 parent.SetStatusText(number=0, text='') |
293 parent.SetStatusText(number=1, text='') |
281 parent.SetStatusText(number=1, text='') |
294 parent.SetStatusText(number=2, text='') |
282 parent.SetStatusText(number=2, text='') |
295 |
283 |
296 parent.SetStatusWidths([100, 110, -1]) |
284 parent.SetStatusWidths([100, 110, -1]) |
297 |
285 |
298 def _init_utils(self): |
286 def _init_utils(self): |
299 # generated method, don't edit |
|
300 self.menuBar1 = wx.MenuBar() |
287 self.menuBar1 = wx.MenuBar() |
301 self.menuBar1.SetEvtHandlerEnabled(True) |
288 self.menuBar1.SetEvtHandlerEnabled(True) |
302 |
289 |
303 self.FileMenu = wx.Menu(title='') |
290 self.FileMenu = wx.Menu(title='') |
304 |
|
305 self.EditMenu = wx.Menu(title='') |
291 self.EditMenu = wx.Menu(title='') |
306 |
|
307 self.AddMenu = wx.Menu(title='') |
292 self.AddMenu = wx.Menu(title='') |
308 |
|
309 self.HelpMenu = wx.Menu(title='') |
293 self.HelpMenu = wx.Menu(title='') |
310 |
294 |
311 self._init_coll_menuBar1_Menus(self.menuBar1) |
295 self._init_coll_menuBar1_Menus(self.menuBar1) |
312 self._init_coll_FileMenu_Items(self.FileMenu) |
296 self._init_coll_FileMenu_Items(self.FileMenu) |
313 self._init_coll_EditMenu_Items(self.EditMenu) |
297 self._init_coll_EditMenu_Items(self.EditMenu) |
314 self._init_coll_AddMenu_Items(self.AddMenu) |
298 self._init_coll_AddMenu_Items(self.AddMenu) |
315 self._init_coll_HelpMenu_Items(self.HelpMenu) |
299 self._init_coll_HelpMenu_Items(self.HelpMenu) |
316 |
300 |
317 def _init_ctrls(self, prnt): |
301 def _init_ctrls(self, prnt): |
318 # generated method, don't edit |
302 wx.Frame.__init__(self, id=ID_OBJDICTEDIT, name='objdictedit', |
319 wx.Frame.__init__(self, id=wxID_OBJDICTEDIT, name='objdictedit', |
|
320 parent=prnt, pos=wx.Point(149, 178), size=wx.Size(1000, 700), |
303 parent=prnt, pos=wx.Point(149, 178), size=wx.Size(1000, 700), |
321 style=wx.DEFAULT_FRAME_STYLE, title='Objdictedit') |
304 style=wx.DEFAULT_FRAME_STYLE, title='Objdictedit') |
322 self._init_utils() |
305 self._init_utils() |
323 self.SetClientSize(wx.Size(1000, 700)) |
306 self.SetClientSize(wx.Size(1000, 700)) |
324 self.SetMenuBar(self.menuBar1) |
307 self.SetMenuBar(self.menuBar1) |
325 self.Bind(wx.EVT_CLOSE, self.OnCloseFrame, id=wxID_OBJDICTEDIT) |
308 self.Bind(wx.EVT_CLOSE, self.OnCloseFrame, id=ID_OBJDICTEDIT) |
326 |
309 |
327 self.FileOpened = wx.Notebook(id=wxID_OBJDICTEDITFILEOPENED, |
310 self.FileOpened = wx.Notebook(id=ID_OBJDICTEDITFILEOPENED, |
328 name='FileOpened', parent=self, pos=wx.Point(0, 0), |
311 name='FileOpened', parent=self, pos=wx.Point(0, 0), |
329 size=wx.Size(0, 0), style=0) |
312 size=wx.Size(0, 0), style=0) |
330 self.FileOpened.Bind(wx.EVT_NOTEBOOK_PAGE_CHANGED, |
313 self.FileOpened.Bind(wx.EVT_NOTEBOOK_PAGE_CHANGED, |
331 self.OnFileSelectedChanged, id=wxID_OBJDICTEDITFILEOPENED) |
314 self.OnFileSelectedChanged, id=ID_OBJDICTEDITFILEOPENED) |
332 |
315 |
333 self.HelpBar = wx.StatusBar(id=wxID_OBJDICTEDITHELPBAR, name='HelpBar', |
316 self.HelpBar = wx.StatusBar(id=ID_OBJDICTEDITHELPBAR, name='HelpBar', |
334 parent=self, style=wxST_SIZEGRIP) |
317 parent=self, style=wx.ST_SIZEGRIP) |
335 self._init_coll_HelpBar_Fields(self.HelpBar) |
318 self._init_coll_HelpBar_Fields(self.HelpBar) |
336 self.SetStatusBar(self.HelpBar) |
319 self.SetStatusBar(self.HelpBar) |
337 |
320 |
338 def __init__(self, parent): |
321 def __init__(self, parent): |
339 self._init_ctrls(parent) |
322 self._init_ctrls(parent) |
608 #------------------------------------------------------------------------------- |
591 #------------------------------------------------------------------------------- |
609 |
592 |
610 def OnNewMenu(self, event): |
593 def OnNewMenu(self, event): |
611 self.FilePath = "" |
594 self.FilePath = "" |
612 dialog = CreateNodeDialog(self, ScriptDirectory) |
595 dialog = CreateNodeDialog(self, ScriptDirectory) |
613 if dialog.ShowModal() == wxID_OK: |
596 if dialog.ShowModal() == wx.ID_OK: |
614 name, id, nodetype, description = dialog.GetValues() |
597 name, id, nodetype, description = dialog.GetValues() |
615 profile, filepath = dialog.GetProfile() |
598 profile, filepath = dialog.GetProfile() |
616 NMT = dialog.GetNMTManagement() |
599 NMT = dialog.GetNMTManagement() |
617 options = dialog.GetOptions() |
600 options = dialog.GetOptions() |
618 result = self.Manager.CreateNewNode(name, id, nodetype, description, profile, filepath, NMT, options) |
601 result = self.Manager.CreateNewNode(name, id, nodetype, description, profile, filepath, NMT, options) |
619 if type(result) == IntType: |
602 if type(result) == IntType: |
620 new_editingpanel = EditingPanel(self, self.Manager) |
603 new_editingpanel = EditingPanel(self, self.Manager) |
621 new_editingpanel.SetIndex(result) |
604 new_editingpanel.SetIndex(result) |
622 self.FileOpened.AddPage(new_editingpanel, "") |
605 self.FileOpened.AddPage(new_editingpanel, "") |
623 self.FileOpened.SetSelection(self.FileOpened.GetPageCount() - 1) |
606 self.FileOpened.SetSelection(self.FileOpened.GetPageCount() - 1) |
624 self.EditMenu.Enable(wxID_OBJDICTEDITEDITMENUITEMS8, False) |
607 self.EditMenu.Enable(ID_OBJDICTEDITEDITMENUITEMS8, False) |
625 if "DS302" in options: |
608 if "DS302" in options: |
626 self.EditMenu.Enable(wxID_OBJDICTEDITEDITMENUITEMS8, True) |
609 self.EditMenu.Enable(ID_OBJDICTEDITEDITMENUITEMS8, True) |
627 self.RefreshBufferState() |
610 self.RefreshBufferState() |
628 self.RefreshProfileMenu() |
611 self.RefreshProfileMenu() |
629 self.RefreshMainMenu() |
612 self.RefreshMainMenu() |
630 else: |
613 else: |
631 message = wxMessageDialog(self, result, "ERROR", wxOK|wxICON_ERROR) |
614 message = wx.MessageDialog(self, result, "ERROR", wx.OK|wx.ICON_ERROR) |
632 message.ShowModal() |
615 message.ShowModal() |
633 message.Destroy() |
616 message.Destroy() |
634 event.Skip() |
617 event.Skip() |
635 |
618 |
636 def OnOpenMenu(self, event): |
619 def OnOpenMenu(self, event): |
637 filepath = self.Manager.GetCurrentFilePath() |
620 filepath = self.Manager.GetCurrentFilePath() |
638 if filepath != "": |
621 if filepath != "": |
639 directory = os.path.dirname(filepath) |
622 directory = os.path.dirname(filepath) |
640 else: |
623 else: |
641 directory = os.getcwd() |
624 directory = os.getcwd() |
642 dialog = wxFileDialog(self, "Choose a file", directory, "", "OD files (*.od)|*.od|All files|*.*", wxOPEN|wxCHANGE_DIR) |
625 dialog = wx.FileDialog(self, "Choose a file", directory, "", "OD files (*.od)|*.od|All files|*.*", wx.OPEN|wx.CHANGE_DIR) |
643 if dialog.ShowModal() == wxID_OK: |
626 if dialog.ShowModal() == wx.ID_OK: |
644 filepath = dialog.GetPath() |
627 filepath = dialog.GetPath() |
645 if os.path.isfile(filepath): |
628 if os.path.isfile(filepath): |
646 result = self.Manager.OpenFileInCurrent(filepath) |
629 result = self.Manager.OpenFileInCurrent(filepath) |
647 if type(result) == IntType: |
630 if type(result) == IntType: |
648 new_editingpanel = EditingPanel(self, self.Manager) |
631 new_editingpanel = EditingPanel(self, self.Manager) |
649 new_editingpanel.SetIndex(result) |
632 new_editingpanel.SetIndex(result) |
650 self.FileOpened.AddPage(new_editingpanel, "") |
633 self.FileOpened.AddPage(new_editingpanel, "") |
651 self.FileOpened.SetSelection(self.FileOpened.GetPageCount() - 1) |
634 self.FileOpened.SetSelection(self.FileOpened.GetPageCount() - 1) |
652 if self.Manager.CurrentDS302Defined(): |
635 if self.Manager.CurrentDS302Defined(): |
653 self.EditMenu.Enable(wxID_OBJDICTEDITEDITMENUITEMS8, True) |
636 self.EditMenu.Enable(ID_OBJDICTEDITEDITMENUITEMS8, True) |
654 else: |
637 else: |
655 self.EditMenu.Enable(wxID_OBJDICTEDITEDITMENUITEMS8, False) |
638 self.EditMenu.Enable(ID_OBJDICTEDITEDITMENUITEMS8, False) |
656 self.RefreshEditMenu() |
639 self.RefreshEditMenu() |
657 self.RefreshBufferState() |
640 self.RefreshBufferState() |
658 self.RefreshProfileMenu() |
641 self.RefreshProfileMenu() |
659 self.RefreshMainMenu() |
642 self.RefreshMainMenu() |
660 else: |
643 else: |
661 message = wxMessageDialog(self, e.args[0], "Error", wxOK|wxICON_ERROR) |
644 message = wx.MessageDialog(self, e.args[0], "Error", wx.OK|wx.ICON_ERROR) |
662 message.ShowModal() |
645 message.ShowModal() |
663 message.Destroy() |
646 message.Destroy() |
664 dialog.Destroy() |
647 dialog.Destroy() |
665 event.Skip() |
648 event.Skip() |
666 |
649 |
746 self.FileOpened.SetSelection(self.FileOpened.GetPageCount() - 1) |
729 self.FileOpened.SetSelection(self.FileOpened.GetPageCount() - 1) |
747 self.RefreshBufferState() |
730 self.RefreshBufferState() |
748 self.RefreshCurrentIndexList() |
731 self.RefreshCurrentIndexList() |
749 self.RefreshProfileMenu() |
732 self.RefreshProfileMenu() |
750 self.RefreshMainMenu() |
733 self.RefreshMainMenu() |
751 message = wxMessageDialog(self, "Import successful", "Information", wxOK|wxICON_INFORMATION) |
734 message = wx.MessageDialog(self, "Import successful", "Information", wx.OK|wx.ICON_INFORMATION) |
752 message.ShowModal() |
735 message.ShowModal() |
753 message.Destroy() |
736 message.Destroy() |
754 else: |
737 else: |
755 message = wxMessageDialog(self, result, "Error", wxOK|wxICON_ERROR) |
738 message = wx.MessageDialog(self, result, "Error", wx.OK|wx.ICON_ERROR) |
756 message.ShowModal() |
739 message.ShowModal() |
757 message.Destroy() |
740 message.Destroy() |
758 else: |
741 else: |
759 message = wxMessageDialog(self, "\"%s\" is not a valid file!"%filepath, "Error", wxOK|wxICON_ERROR) |
742 message = wx.MessageDialog(self, "\"%s\" is not a valid file!"%filepath, "Error", wx.OK|wx.ICON_ERROR) |
760 message.ShowModal() |
743 message.ShowModal() |
761 message.Destroy() |
744 message.Destroy() |
762 dialog.Destroy() |
745 dialog.Destroy() |
763 event.Skip() |
746 event.Skip() |
764 |
747 |
765 |
748 |
766 def OnExportEDSMenu(self, event): |
749 def OnExportEDSMenu(self, event): |
767 dialog = wxFileDialog(self, "Choose a file", os.getcwd(), self.Manager.GetCurrentNodeInfos()[0], "EDS files (*.eds)|*.eds|All files|*.*", wxSAVE|wxOVERWRITE_PROMPT|wxCHANGE_DIR) |
750 dialog = wx.FileDialog(self, "Choose a file", os.getcwd(), self.Manager.GetCurrentNodeInfos()[0], "EDS files (*.eds)|*.eds|All files|*.*", wx.SAVE|wx.OVERWRITE_PROMPT|wx.CHANGE_DIR) |
768 if dialog.ShowModal() == wxID_OK: |
751 if dialog.ShowModal() == wx.ID_OK: |
769 filepath = dialog.GetPath() |
752 filepath = dialog.GetPath() |
770 if os.path.isdir(os.path.dirname(filepath)): |
753 if os.path.isdir(os.path.dirname(filepath)): |
771 path, extend = os.path.splitext(filepath) |
754 path, extend = os.path.splitext(filepath) |
772 if extend in ("", "."): |
755 if extend in ("", "."): |
773 filepath = path + ".eds" |
756 filepath = path + ".eds" |
774 result = self.Manager.ExportCurrentToEDSFile(filepath) |
757 result = self.Manager.ExportCurrentToEDSFile(filepath) |
775 if not result: |
758 if not result: |
776 message = wxMessageDialog(self, "Export successful", "Information", wxOK|wxICON_INFORMATION) |
759 message = wx.MessageDialog(self, "Export successful", "Information", wx.OK|wx.ICON_INFORMATION) |
777 message.ShowModal() |
760 message.ShowModal() |
778 message.Destroy() |
761 message.Destroy() |
779 else: |
762 else: |
780 message = wxMessageDialog(self, result, "Error", wxOK|wxICON_ERROR) |
763 message = wx.MessageDialog(self, result, "Error", wx.OK|wx.ICON_ERROR) |
781 message.ShowModal() |
764 message.ShowModal() |
782 message.Destroy() |
765 message.Destroy() |
783 else: |
766 else: |
784 message = wxMessageDialog(self, "\"%s\" is not a valid folder!"%os.path.dirname(filepath), "Error", wxOK|wxICON_ERROR) |
767 message = wx.MessageDialog(self, "\"%s\" is not a valid folder!"%os.path.dirname(filepath), "Error", wx.OK|wx.ICON_ERROR) |
785 message.ShowModal() |
768 message.ShowModal() |
786 message.Destroy() |
769 message.Destroy() |
787 dialog.Destroy() |
770 dialog.Destroy() |
788 event.Skip() |
771 event.Skip() |
789 |
772 |
790 def OnExportCMenu(self, event): |
773 def OnExportCMenu(self, event): |
791 dialog = wxFileDialog(self, "Choose a file", os.getcwd(), self.Manager.GetCurrentNodeInfos()[0], "CANFestival C files (*.c)|*.c|All files|*.*", wxSAVE|wxOVERWRITE_PROMPT|wxCHANGE_DIR) |
774 dialog = wx.FileDialog(self, "Choose a file", os.getcwd(), self.Manager.GetCurrentNodeInfos()[0], "CANFestival C files (*.c)|*.c|All files|*.*", wx.SAVE|wx.OVERWRITE_PROMPT|wx.CHANGE_DIR) |
792 if dialog.ShowModal() == wxID_OK: |
775 if dialog.ShowModal() == wx.ID_OK: |
793 filepath = dialog.GetPath() |
776 filepath = dialog.GetPath() |
794 if os.path.isdir(os.path.dirname(filepath)): |
777 if os.path.isdir(os.path.dirname(filepath)): |
795 path, extend = os.path.splitext(filepath) |
778 path, extend = os.path.splitext(filepath) |
796 if extend in ("", "."): |
779 if extend in ("", "."): |
797 filepath = path + ".c" |
780 filepath = path + ".c" |
798 result = self.Manager.ExportCurrentToCFile(filepath) |
781 result = self.Manager.ExportCurrentToCFile(filepath) |
799 if not result: |
782 if not result: |
800 message = wxMessageDialog(self, "Export successful", "Information", wxOK|wxICON_INFORMATION) |
783 message = wx.MessageDialog(self, "Export successful", "Information", wx.OK|wx.ICON_INFORMATION) |
801 message.ShowModal() |
784 message.ShowModal() |
802 message.Destroy() |
785 message.Destroy() |
803 else: |
786 else: |
804 message = wxMessageDialog(self, result, "Error", wxOK|wxICON_ERROR) |
787 message = wx.MessageDialog(self, result, "Error", wx.OK|wx.ICON_ERROR) |
805 message.ShowModal() |
788 message.ShowModal() |
806 message.Destroy() |
789 message.Destroy() |
807 else: |
790 else: |
808 message = wxMessageDialog(self, "\"%s\" is not a valid folder!"%os.path.dirname(filepath), "Error", wxOK|wxICON_ERROR) |
791 message = wx.MessageDialog(self, "\"%s\" is not a valid folder!"%os.path.dirname(filepath), "Error", wx.OK|wx.ICON_ERROR) |
809 message.ShowModal() |
792 message.ShowModal() |
810 message.Destroy() |
793 message.Destroy() |
811 dialog.Destroy() |
794 dialog.Destroy() |
812 event.Skip() |
795 event.Skip() |
813 |
796 |