1 |
xabbu |
1.8 |
#Boa:MDIParent:fraggleViewport |
2 |
xabbu |
1.1 |
|
3 |
joko |
1.5 |
import os |
4 |
xabbu |
1.1 |
from wxPython.wx import * |
5 |
|
|
|
6 |
|
|
import fraggleDialogPrefs |
7 |
xabbu |
1.2 |
import fraggleCtlPreferences |
8 |
xabbu |
1.8 |
import fraggleDialogs |
9 |
xabbu |
1.1 |
|
10 |
|
|
def create(parent): |
11 |
xabbu |
1.8 |
return fraggleViewport(parent) |
12 |
xabbu |
1.1 |
|
13 |
xabbu |
1.2 |
[wxID_FRAGGLEVIEWPORT] = map(lambda _init_ctrls: wxNewId(), range(1)) |
14 |
xabbu |
1.1 |
|
15 |
xabbu |
1.2 |
[wxID_FRAGGLEVIEWPORTMENU1FPREFS, wxID_FRAGGLEVIEWPORTMENU1ITEMS1, |
16 |
xabbu |
1.1 |
] = map(lambda _init_coll_menu1_Items: wxNewId(), range(2)) |
17 |
|
|
|
18 |
joko |
1.7 |
[wxID_FRAGGLEVIEWPORTMENU2CONT, wxID_FRAGGLEVIEWPORTMENU2ABOUT, |
19 |
xabbu |
1.8 |
] = map(lambda _init_coll_menu1_Items: wxNewId(), range(2)) |
20 |
joko |
1.7 |
|
21 |
xabbu |
1.2 |
class fraggleViewport(wxMDIParentFrame): |
22 |
xabbu |
1.1 |
def _init_coll_menu1_Items(self, parent): |
23 |
|
|
# generated method, don't edit |
24 |
xabbu |
1.6 |
|
25 |
|
|
parent.Append(helpString='Configure Netfraggle', |
26 |
|
|
id=wxID_FRAGGLEVIEWPORTMENU1FPREFS, item='Preferences', |
27 |
|
|
kind=wxITEM_NORMAL) |
28 |
|
|
parent.Append(helpString='Exit Netfraggle', |
29 |
|
|
id=wxID_FRAGGLEVIEWPORTMENU1ITEMS1, item='Exit', |
30 |
|
|
kind=wxITEM_NORMAL) |
31 |
xabbu |
1.1 |
|
32 |
xabbu |
1.2 |
EVT_MENU(self, wxID_FRAGGLEVIEWPORTMENU1FPREFS, self.OnMenu1items0Menu) |
33 |
|
|
EVT_MENU(self, wxID_FRAGGLEVIEWPORTMENU1ITEMS1, self.OnMenu1items1Menu) |
34 |
xabbu |
1.1 |
|
35 |
joko |
1.7 |
def _init_coll_menu2_Items(self, parent): |
36 |
|
|
# generated method, don't edit |
37 |
xabbu |
1.8 |
|
38 |
|
|
parent.Append(helpString='Contents', |
39 |
joko |
1.7 |
id=wxID_FRAGGLEVIEWPORTMENU2CONT, item='Contents', |
40 |
|
|
kind=wxITEM_NORMAL) |
41 |
xabbu |
1.8 |
parent.Append(helpString='About', |
42 |
joko |
1.7 |
id=wxID_FRAGGLEVIEWPORTMENU2ABOUT, item='About', |
43 |
|
|
kind=wxITEM_NORMAL) |
44 |
xabbu |
1.8 |
|
45 |
joko |
1.7 |
EVT_MENU(self, wxID_FRAGGLEVIEWPORTMENU2CONT, self.OnMenu2items0Menu) |
46 |
|
|
EVT_MENU(self, wxID_FRAGGLEVIEWPORTMENU2ABOUT, self.OnMenu2items1Menu) |
47 |
|
|
|
48 |
xabbu |
1.1 |
def _init_coll_menuBar1_Menus(self, parent): |
49 |
|
|
# generated method, don't edit |
50 |
|
|
|
51 |
xabbu |
1.8 |
parent.Append(menu=self.menu1, title='&File') |
52 |
|
|
parent.Append(menu=self.menu2, title='&help') |
53 |
xabbu |
1.1 |
|
54 |
|
|
def _init_utils(self): |
55 |
|
|
# generated method, don't edit |
56 |
|
|
self.menuBar1 = wxMenuBar() |
57 |
|
|
self.menuBar1.SetAutoLayout(1) |
58 |
|
|
|
59 |
|
|
self.menu1 = wxMenu(title='') |
60 |
|
|
self._init_coll_menu1_Items(self.menu1) |
61 |
joko |
1.7 |
self.menu2 = wxMenu(title='') |
62 |
|
|
self._init_coll_menu2_Items(self.menu2) |
63 |
|
|
|
64 |
xabbu |
1.1 |
self._init_coll_menuBar1_Menus(self.menuBar1) |
65 |
|
|
|
66 |
|
|
def _init_ctrls(self, prnt): |
67 |
|
|
# generated method, don't edit |
68 |
xabbu |
1.2 |
wxMDIParentFrame.__init__(self, id=wxID_FRAGGLEVIEWPORT, |
69 |
|
|
name='fraggleViewport', parent=prnt, pos=wxPoint(277, 313), |
70 |
|
|
size=wxSize(683, 307), |
71 |
xabbu |
1.1 |
style=wxDEFAULT_FRAME_STYLE | wxVSCROLL | wxHSCROLL, |
72 |
|
|
title='wxMDIParentFrame1') |
73 |
|
|
self._init_utils() |
74 |
xabbu |
1.2 |
self.SetClientSize(wxSize(683, 284)) |
75 |
xabbu |
1.1 |
self.SetMenuBar(self.menuBar1) |
76 |
|
|
|
77 |
xabbu |
1.2 |
def __init_preferences__(self): |
78 |
|
|
self.preferencesCtl = fraggleCtlPreferences.create(self) |
79 |
|
|
self.dialogPrefs = fraggleDialogPrefs.create(self) |
80 |
xabbu |
1.6 |
self.dialogPrefs.loadConfig() |
81 |
|
|
self.dialogPrefs.updateConfig() |
82 |
xabbu |
1.2 |
|
83 |
xabbu |
1.1 |
def __init__(self, parent): |
84 |
|
|
self._init_ctrls(parent) |
85 |
xabbu |
1.2 |
self.__init_preferences__() |
86 |
xabbu |
1.8 |
|
87 |
xabbu |
1.1 |
|
88 |
xabbu |
1.8 |
def OnMenu1items0Menu(self, event): |
89 |
xabbu |
1.1 |
try: |
90 |
|
|
self.dialogPrefs.ShowModal() |
91 |
|
|
finally: |
92 |
xabbu |
1.8 |
pass |
93 |
|
|
event.Skip() |
94 |
|
|
|
95 |
|
|
def OnMenu1items1Menu(self, event): |
96 |
joko |
1.7 |
self.Destroy() |
97 |
xabbu |
1.8 |
event.Skip() |
98 |
xabbu |
1.1 |
|
99 |
joko |
1.7 |
|
100 |
|
|
def OnMenu2items0Menu(self, event): |
101 |
xabbu |
1.8 |
try: |
102 |
|
|
self.dialogPrefs.ShowModal() |
103 |
|
|
finally: |
104 |
|
|
pass |
105 |
|
|
event.Skip() |
106 |
joko |
1.7 |
|
107 |
|
|
def OnMenu2items1Menu(self, event): |
108 |
xabbu |
1.8 |
#self.Destroy() |
109 |
|
|
#event.Skip() |
110 |
|
|
fraggleDialogs.AboutDialog() |
111 |
joko |
1.4 |
|