2 |
|
|
3 |
# $Id$ |
# $Id$ |
4 |
# $Log$ |
# $Log$ |
5 |
|
# Revision 1.21 2004/09/21 18:12:19 xabbu |
6 |
|
# U in __init_modules -> self.modulesCtl.SetViewport(self) will be set |
7 |
|
# |
8 |
|
# Revision 1.20 2004/09/05 10:09:26 xabbu |
9 |
|
# + Bug that menues where displayed incorrectly on nt like os resolved. |
10 |
|
# + Removed OS dependend menu creation in faggleMain -> moved to fraggleViewPort |
11 |
|
# + Modules configuration dialog can be displayed by selecting Files->Modules now |
12 |
|
# |
13 |
|
# Revision 1.19 2004/09/05 00:21:10 xabbu |
14 |
|
# +Fixed File Menu Modules item on Posix system. Gotta do testing on Windows with it. |
15 |
|
# |
16 |
|
# Revision 1.18 2004/09/04 20:26:01 xabbu |
17 |
|
# +Added a button to the Preferences tab for showing the Modules Dialog. |
18 |
|
# Todo: When the module dialog is shown, it is still being blocked by the preferences dialog. I am not sure why but will have to look into it further. |
19 |
|
# |
20 |
|
# +Added modules directory |
21 |
|
# |
22 |
# Revision 1.17 2004/09/01 21:43:30 xabbu |
# Revision 1.17 2004/09/01 21:43:30 xabbu |
23 |
# +Moved funtion getDefaultDir from FraggleCtlPreferences to FraggleEngine for more convenience |
# +Moved funtion getDefaultDir from FraggleCtlPreferences to FraggleEngine for more convenience |
24 |
# +FraggleCtlModules class creation for handling content modules |
# +FraggleCtlModules class creation for handling content modules |
58 |
|
|
59 |
from fraggleConstants import * |
from fraggleConstants import * |
60 |
import fraggleDialogPrefs |
import fraggleDialogPrefs |
61 |
|
import FraggleDialogModules |
62 |
import FraggleAboutDialog |
import FraggleAboutDialog |
63 |
import FraggleTopicFrame |
import FraggleTopicFrame |
64 |
import FraggleXMLRPC |
import FraggleXMLRPC |
68 |
|
|
69 |
[wxID_FRAGGLEVIEWPORT] = map(lambda _init_ctrls: wxNewId(), range(1)) |
[wxID_FRAGGLEVIEWPORT] = map(lambda _init_ctrls: wxNewId(), range(1)) |
70 |
|
|
71 |
[wxID_FRAGGLEVIEWPORTMENU1FPREFS, wxID_FRAGGLEVIEWPORTMENU1ITEMS1, |
[wxID_FRAGGLEVIEWPORTMENU1FMODULES, wxID_FRAGGLEVIEWPORTMENU1FPREFS, |
72 |
] = map(lambda _init_coll_menu1_Items: wxNewId(), range(2)) |
wxID_FRAGGLEVIEWPORTMENU1ITEMS1, |
73 |
|
] = map(lambda _init_coll_menu1_Items: wxNewId(), range(3)) |
74 |
|
|
75 |
[wxID_FRAGGLEVIEWPORTMENU2ABOUT, wxID_FRAGGLEVIEWPORTMENU2CONT, |
[wxID_FRAGGLEVIEWPORTMENU2ABOUT, wxID_FRAGGLEVIEWPORTMENU2CONT, |
76 |
] = map(lambda _init_coll_menu2_Items: wxNewId(), range(2)) |
] = map(lambda _init_coll_menu2_Items: wxNewId(), range(2)) |
108 |
def _init_coll_menu1_Items(self, parent): |
def _init_coll_menu1_Items(self, parent): |
109 |
# generated method, don't edit |
# generated method, don't edit |
110 |
|
|
111 |
|
parent.Append(helpString='Configure Modules', |
112 |
|
id=wxID_FRAGGLEVIEWPORTMENU1FMODULES, item='Modules', |
113 |
|
kind=wxITEM_NORMAL) |
114 |
parent.Append(helpString='Configure Netfraggle', |
parent.Append(helpString='Configure Netfraggle', |
115 |
id=wxID_FRAGGLEVIEWPORTMENU1FPREFS, item='Preferences', |
id=wxID_FRAGGLEVIEWPORTMENU1FPREFS, item='Preferences', |
116 |
kind=wxITEM_NORMAL) |
kind=wxITEM_NORMAL) |
117 |
parent.Append(helpString='Exit Netfraggle', |
parent.Append(helpString='Exit Netfraggle', |
118 |
id=wxID_FRAGGLEVIEWPORTMENU1ITEMS1, item='Exit', |
id=wxID_FRAGGLEVIEWPORTMENU1ITEMS1, item='Exit', |
119 |
kind=wxITEM_NORMAL) |
kind=wxITEM_NORMAL) |
120 |
|
EVT_MENU(self, wxID_FRAGGLEVIEWPORTMENU1FMODULES, |
121 |
|
self.OnMenu1FmodulesMenu) |
122 |
|
EVT_MENU(self, wxID_FRAGGLEVIEWPORTMENU1FPREFS, self.OnMenu1FprefsMenu) |
123 |
|
EVT_MENU(self, wxID_FRAGGLEVIEWPORTMENU1ITEMS1, self.OnMenu1Items1Menu) |
124 |
|
|
125 |
def _init_coll_menuBar1_Menus(self, parent): |
def _init_coll_menuBar1_Menus(self, parent): |
126 |
# generated method, don't edit |
# generated method, don't edit |
131 |
def _init_utils(self): |
def _init_utils(self): |
132 |
# generated method, don't edit |
# generated method, don't edit |
133 |
self.menuBar1 = wxMenuBar() |
self.menuBar1 = wxMenuBar() |
134 |
self.menuBar1.SetAutoLayout(1) |
self.menuBar1.SetAutoLayout(0) |
135 |
|
|
136 |
self.menu1 = wxMenu(title='') |
self.menu1 = wxMenu(title='') |
|
self._init_coll_menu1_Items(self.menu1) |
|
137 |
|
|
138 |
self.menu2 = wxMenu(title='') |
self.menu2 = wxMenu(title='') |
|
self._init_coll_menu2_Items(self.menu2) |
|
139 |
|
|
140 |
self.FraggleTaskBarMenu = wxMenu(title=u'NetFraggle') |
self.FraggleTaskBarMenu = wxMenu(title=u'NetFraggle') |
|
self._init_coll_FraggleTaskBarMenu_Items(self.FraggleTaskBarMenu) |
|
141 |
|
|
142 |
self._init_coll_menuBar1_Menus(self.menuBar1) |
self._init_coll_menuBar1_Menus(self.menuBar1) |
143 |
|
self._init_coll_menu1_Items(self.menu1) |
144 |
|
self._init_coll_menu2_Items(self.menu2) |
145 |
|
self._init_coll_FraggleTaskBarMenu_Items(self.FraggleTaskBarMenu) |
146 |
|
|
147 |
def _init_ctrls(self, prnt): |
def _init_ctrls(self, prnt): |
148 |
# generated method, don't edit |
# generated method, don't edit |
149 |
wxMDIParentFrame.__init__(self, id=wxID_FRAGGLEVIEWPORT, |
wxMDIParentFrame.__init__(self, id=wxID_FRAGGLEVIEWPORT, |
150 |
name='fraggleViewport', parent=prnt, pos=wxPoint(335, 382), |
name='fraggleViewport', parent=prnt, pos=wxPoint(335, 382), |
151 |
size=wxSize(427, 269), |
size=wxSize(435, 250), |
152 |
style=wxDEFAULT_FRAME_STYLE | wxVSCROLL | wxHSCROLL, |
style=wxDEFAULT_FRAME_STYLE | wxVSCROLL | wxHSCROLL, |
153 |
title='NetFraggle 0.0.1') |
title='NetFraggle 0.0.1') |
154 |
self._init_utils() |
self._init_utils() |
155 |
self.SetClientSize(wxSize(427, 246)) |
self.SetClientSize(wxSize(427, 223)) |
156 |
self.SetMenuBar(self.menuBar1) |
self.SetMenuBar(self.menuBar1) |
157 |
|
|
158 |
def __init_modules__(self): |
def __init_modules__(self): |
159 |
self.modulesCtl = self.engine.modules |
self.modulesCtl = self.engine.modules |
160 |
|
self.modulesCtl.SetViewport(self) |
161 |
self.dialogModules = FraggleDialogModules.create(self) |
self.dialogModules = FraggleDialogModules.create(self) |
162 |
|
|
163 |
def __init_preferences__(self): |
def __init_preferences__(self): |
194 |
import __main__ |
import __main__ |
195 |
self.engine = __main__.engine |
self.engine = __main__.engine |
196 |
self._init_ctrls(parent) |
self._init_ctrls(parent) |
197 |
|
self.__init_modules__() |
198 |
self.__init_preferences__() |
self.__init_preferences__() |
199 |
self.__init_taskbar_icon__() |
self.__init_taskbar_icon__() |
200 |
self.__init_xmlrpc__() |
self.__init_xmlrpc__() |
211 |
event.Skip() |
event.Skip() |
212 |
|
|
213 |
|
|
214 |
def OnMenu2items0Menu(self, event): |
#def OnMenu2items0Menu(self, event): |
215 |
try: |
# try: |
216 |
self.dialogPrefs.ShowModal() |
# self.dialogPrefs.ShowModal() |
217 |
finally: |
# finally: |
218 |
pass |
# pass |
219 |
event.Skip() |
# event.Skip() |
220 |
|
|
221 |
def OnMenu2items1Menu(self, event): |
def OnMenu2items1Menu(self, event): |
222 |
"""Show about screen""" |
"""Show about screen""" |
244 |
#event.Skip() |
#event.Skip() |
245 |
#self.Destroy() |
#self.Destroy() |
246 |
self.Close(True) |
self.Close(True) |
247 |
|
|
248 |
|
def OnMenu1FmodulesMenu(self, event): |
249 |
|
self.dialogModules.Show() |
250 |
|
event.Skip() |
251 |
|
|
252 |
|
def OnMenu1FprefsMenu(self, event): |
253 |
|
try: |
254 |
|
self.dialogPrefs.ShowModal() |
255 |
|
finally: |
256 |
|
pass |
257 |
|
event.Skip() |
258 |
|
|
259 |
|
def OnMenu1Items1Menu(self, event): |
260 |
|
self.Destroy() |
261 |
|
event.Skip() |
262 |
|
|