--- nfo/projects/netfraggle/bin/fraggleViewport.py 2004/08/27 03:25:44 1.13 +++ nfo/projects/netfraggle/bin/fraggleViewport.py 2004/09/21 18:12:19 1.21 @@ -1,7 +1,39 @@ #Boa:MDIParent:fraggleViewport -# $Id: fraggleViewport.py,v 1.13 2004/08/27 03:25:44 joko Exp $ +# $Id: fraggleViewport.py,v 1.21 2004/09/21 18:12:19 xabbu Exp $ # $Log: fraggleViewport.py,v $ +# Revision 1.21 2004/09/21 18:12:19 xabbu +# U in __init_modules -> self.modulesCtl.SetViewport(self) will be set +# +# Revision 1.20 2004/09/05 10:09:26 xabbu +# + Bug that menues where displayed incorrectly on nt like os resolved. +# + Removed OS dependend menu creation in faggleMain -> moved to fraggleViewPort +# + Modules configuration dialog can be displayed by selecting Files->Modules now +# +# Revision 1.19 2004/09/05 00:21:10 xabbu +# +Fixed File Menu Modules item on Posix system. Gotta do testing on Windows with it. +# +# Revision 1.18 2004/09/04 20:26:01 xabbu +# +Added a button to the Preferences tab for showing the Modules Dialog. +# 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. +# +# +Added modules directory +# +# Revision 1.17 2004/09/01 21:43:30 xabbu +# +Moved funtion getDefaultDir from FraggleCtlPreferences to FraggleEngine for more convenience +# +FraggleCtlModules class creation for handling content modules +# +# Revision 1.16 2004/08/30 13:06:40 joko +# U now gets preferences via self.engine +# +# Revision 1.15 2004/08/27 21:14:02 xabbu +# TopicDetails can now be closed. +# GUI change on Preferences Dialog in order to prepare multiple server profiles. +# Small bugfixes to get the new topic windows working on posix platform. +# +# Revision 1.14 2004/08/27 04:39:06 joko +# cleanup +# # Revision 1.13 2004/08/27 03:25:44 joko # added FraggleTaskBarMenu # @@ -26,7 +58,7 @@ from fraggleConstants import * import fraggleDialogPrefs -import fraggleCtlPreferences +import FraggleDialogModules import FraggleAboutDialog import FraggleTopicFrame import FraggleXMLRPC @@ -36,8 +68,9 @@ [wxID_FRAGGLEVIEWPORT] = map(lambda _init_ctrls: wxNewId(), range(1)) -[wxID_FRAGGLEVIEWPORTMENU1FPREFS, wxID_FRAGGLEVIEWPORTMENU1ITEMS1, -] = map(lambda _init_coll_menu1_Items: wxNewId(), range(2)) +[wxID_FRAGGLEVIEWPORTMENU1FMODULES, wxID_FRAGGLEVIEWPORTMENU1FPREFS, + wxID_FRAGGLEVIEWPORTMENU1ITEMS1, +] = map(lambda _init_coll_menu1_Items: wxNewId(), range(3)) [wxID_FRAGGLEVIEWPORTMENU2ABOUT, wxID_FRAGGLEVIEWPORTMENU2CONT, ] = map(lambda _init_coll_menu2_Items: wxNewId(), range(2)) @@ -54,7 +87,7 @@ def _init_coll_FraggleTaskBarMenu_Items(self, parent): # generated method, don't edit - restore = parent.Append(helpString='Restore', + parent.Append(helpString='Restore', id=wxID_FRAGGLEVIEWPORTFRAGGLETASKBARMENUITEMSRESTORE, item='Restore', kind=wxITEM_NORMAL) parent.Append(helpString='Sync enabled', @@ -63,12 +96,6 @@ parent.Append(helpString='Exit', id=wxID_FRAGGLEVIEWPORTFRAGGLETASKBARMENUITEMSEXIT, item='Exit', kind=wxITEM_NORMAL) - #EVT_MENU_OPEN(restore, - # self.OnFraggleTaskBarMenuItemsrestoreMenu) - #EVT_MENU_OPEN(restore, wxID_FRAGGLEVIEWPORTFRAGGLETASKBARMENUITEMSRESTORE, - # self.OnFraggleTaskBarMenuItemsrestoreMenu) - #EVT_MENU(self, wxID_FRAGGLEVIEWPORTFRAGGLETASKBARMENUITEMSEXIT, - # self.OnFraggleTaskBarMenuItemsexitMenu) def _init_coll_menu2_Items(self, parent): # generated method, don't edit @@ -81,12 +108,19 @@ def _init_coll_menu1_Items(self, parent): # generated method, don't edit + parent.Append(helpString='Configure Modules', + id=wxID_FRAGGLEVIEWPORTMENU1FMODULES, item='Modules', + kind=wxITEM_NORMAL) parent.Append(helpString='Configure Netfraggle', id=wxID_FRAGGLEVIEWPORTMENU1FPREFS, item='Preferences', kind=wxITEM_NORMAL) parent.Append(helpString='Exit Netfraggle', id=wxID_FRAGGLEVIEWPORTMENU1ITEMS1, item='Exit', kind=wxITEM_NORMAL) + EVT_MENU(self, wxID_FRAGGLEVIEWPORTMENU1FMODULES, + self.OnMenu1FmodulesMenu) + EVT_MENU(self, wxID_FRAGGLEVIEWPORTMENU1FPREFS, self.OnMenu1FprefsMenu) + EVT_MENU(self, wxID_FRAGGLEVIEWPORTMENU1ITEMS1, self.OnMenu1Items1Menu) def _init_coll_menuBar1_Menus(self, parent): # generated method, don't edit @@ -97,7 +131,7 @@ def _init_utils(self): # generated method, don't edit self.menuBar1 = wxMenuBar() - self.menuBar1.SetAutoLayout(1) + self.menuBar1.SetAutoLayout(0) self.menu1 = wxMenu(title='') @@ -113,24 +147,29 @@ def _init_ctrls(self, prnt): # generated method, don't edit wxMDIParentFrame.__init__(self, id=wxID_FRAGGLEVIEWPORT, - name='fraggleViewport', parent=prnt, pos=wxPoint(338, 296), - size=wxSize(435, 296), + name='fraggleViewport', parent=prnt, pos=wxPoint(335, 382), + size=wxSize(435, 250), style=wxDEFAULT_FRAME_STYLE | wxVSCROLL | wxHSCROLL, title='NetFraggle 0.0.1') self._init_utils() - self.SetClientSize(wxSize(427, 269)) + self.SetClientSize(wxSize(427, 223)) self.SetMenuBar(self.menuBar1) + def __init_modules__(self): + self.modulesCtl = self.engine.modules + self.modulesCtl.SetViewport(self) + self.dialogModules = FraggleDialogModules.create(self) + def __init_preferences__(self): - self.preferencesCtl = fraggleCtlPreferences.create(self) + self.preferencesCtl = self.engine.preferences self.dialogPrefs = fraggleDialogPrefs.create(self) self.dialogPrefs.loadConfig() self.dialogPrefs.updateConfig() # new as of 2004-08-26: TopicFrame # new as of 2004-08-27: pass configList to TopicFrame - self.topicFrame = FraggleTopicFrame.create(self, self.preferencesCtl.configList) - self.topicFrame.Move(wxPoint(10, 10)) + self.topicFrame = FraggleTopicFrame.create(self) + self.topicFrame.Move(wxPoint(5, 5)) #frame.Show() #frame.Destroy() @@ -151,11 +190,11 @@ EVT_MENU(self.tbicon, wxID_FRAGGLEVIEWPORTFRAGGLETASKBARMENUITEMSRESTORE, self.OnTaskBarAppRestore) EVT_MENU(self.tbicon, wxID_FRAGGLEVIEWPORTFRAGGLETASKBARMENUITEMSEXIT, self.OnTaskBarAppExit) - #EVT_BUTTON(self.updateButton, wxID_FRAGGLETOPICFRAMEUPDATEBUTTON, - # self.OnUpdateButtonButton) - def __init__(self, parent): + import __main__ + self.engine = __main__.engine self._init_ctrls(parent) + self.__init_modules__() self.__init_preferences__() self.__init_taskbar_icon__() self.__init_xmlrpc__() @@ -172,12 +211,12 @@ event.Skip() - def OnMenu2items0Menu(self, event): - try: - self.dialogPrefs.ShowModal() - finally: - pass - event.Skip() + #def OnMenu2items0Menu(self, event): + # try: + # self.dialogPrefs.ShowModal() + # finally: + # pass + # event.Skip() def OnMenu2items1Menu(self, event): """Show about screen""" @@ -205,4 +244,19 @@ #event.Skip() #self.Destroy() self.Close(True) + + def OnMenu1FmodulesMenu(self, event): + self.dialogModules.Show() + event.Skip() + + def OnMenu1FprefsMenu(self, event): + try: + self.dialogPrefs.ShowModal() + finally: + pass + event.Skip() + + def OnMenu1Items1Menu(self, event): + self.Destroy() + event.Skip()