1 |
#Boa:MDIParent:fraggleViewport |
2 |
|
3 |
import os |
4 |
from wxPython.wx import * |
5 |
|
6 |
import fraggleDialogPrefs |
7 |
import fraggleCtlPreferences |
8 |
|
9 |
def create(parent): |
10 |
return fraggleViewport(parent) |
11 |
|
12 |
[wxID_FRAGGLEVIEWPORT] = map(lambda _init_ctrls: wxNewId(), range(1)) |
13 |
|
14 |
[wxID_FRAGGLEVIEWPORTMENU1FPREFS, wxID_FRAGGLEVIEWPORTMENU1ITEMS1, |
15 |
] = map(lambda _init_coll_menu1_Items: wxNewId(), range(2)) |
16 |
|
17 |
class fraggleViewport(wxMDIParentFrame): |
18 |
def _init_coll_menu1_Items(self, parent): |
19 |
# generated method, don't edit |
20 |
|
21 |
if os.name == "posix": |
22 |
parent.Append(helpString='Configure Netfraggle', |
23 |
id=wxID_FRAGGLEVIEWPORTMENU1FPREFS, item='Preferences', |
24 |
kind=wxITEM_NORMAL) |
25 |
parent.Append(helpString='Exit Netfraggle', |
26 |
id=wxID_FRAGGLEVIEWPORTMENU1ITEMS1, item='Exit', |
27 |
kind=wxITEM_NORMAL) |
28 |
elif os.name == "nt": |
29 |
parent.Append(wxID_FRAGGLEVIEWPORTMENU1FPREFS, 'Configure Netfraggle', "", wxITEM_NORMAL) |
30 |
parent.Append(wxID_FRAGGLEVIEWPORTMENU1FPREFS, 'Exit Netfraggle', "", wxITEM_NORMAL) |
31 |
|
32 |
EVT_MENU(self, wxID_FRAGGLEVIEWPORTMENU1FPREFS, self.OnMenu1items0Menu) |
33 |
EVT_MENU(self, wxID_FRAGGLEVIEWPORTMENU1ITEMS1, self.OnMenu1items1Menu) |
34 |
|
35 |
def _init_coll_menuBar1_Menus(self, parent): |
36 |
# generated method, don't edit |
37 |
|
38 |
parent.Append(menu=self.menu1, title='File') |
39 |
|
40 |
def _init_utils(self): |
41 |
# generated method, don't edit |
42 |
self.menuBar1 = wxMenuBar() |
43 |
self.menuBar1.SetAutoLayout(1) |
44 |
|
45 |
self.menu1 = wxMenu(title='') |
46 |
self._init_coll_menu1_Items(self.menu1) |
47 |
|
48 |
self._init_coll_menuBar1_Menus(self.menuBar1) |
49 |
|
50 |
def _init_ctrls(self, prnt): |
51 |
# generated method, don't edit |
52 |
wxMDIParentFrame.__init__(self, id=wxID_FRAGGLEVIEWPORT, |
53 |
name='fraggleViewport', parent=prnt, pos=wxPoint(277, 313), |
54 |
size=wxSize(683, 307), |
55 |
style=wxDEFAULT_FRAME_STYLE | wxVSCROLL | wxHSCROLL, |
56 |
title='wxMDIParentFrame1') |
57 |
self._init_utils() |
58 |
self.SetClientSize(wxSize(683, 284)) |
59 |
self.SetMenuBar(self.menuBar1) |
60 |
|
61 |
def __init_preferences__(self): |
62 |
self.preferencesCtl = fraggleCtlPreferences.create(self) |
63 |
self.dialogPrefs = fraggleDialogPrefs.create(self) |
64 |
|
65 |
def __init__(self, parent): |
66 |
self._init_ctrls(parent) |
67 |
self.__init_preferences__() |
68 |
|
69 |
|
70 |
def OnMenu1items0Menu(self, event): |
71 |
try: |
72 |
self.dialogPrefs.ShowModal() |
73 |
finally: |
74 |
self.dialogPrefs.Destroy() |
75 |
event.Skip() |
76 |
|
77 |
def OnMenu1items1Menu(self, event): |
78 |
self.Destroy() |
79 |
event.Skip() |
80 |
|