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