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