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