--- nfo/projects/netfraggle/bin/fraggleViewport.py 2004/08/25 16:56:59 1.2 +++ nfo/projects/netfraggle/bin/fraggleViewport.py 2004/08/25 23:46:05 1.8 @@ -1,9 +1,11 @@ #Boa:MDIParent:fraggleViewport +import os from wxPython.wx import * import fraggleDialogPrefs import fraggleCtlPreferences +import fraggleDialogs def create(parent): return fraggleViewport(parent) @@ -13,23 +15,41 @@ [wxID_FRAGGLEVIEWPORTMENU1FPREFS, wxID_FRAGGLEVIEWPORTMENU1ITEMS1, ] = map(lambda _init_coll_menu1_Items: wxNewId(), range(2)) +[wxID_FRAGGLEVIEWPORTMENU2CONT, wxID_FRAGGLEVIEWPORTMENU2ABOUT, +] = map(lambda _init_coll_menu1_Items: wxNewId(), range(2)) + class fraggleViewport(wxMDIParentFrame): def _init_coll_menu1_Items(self, parent): # generated method, don't edit - + 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_FRAGGLEVIEWPORTMENU1FPREFS, self.OnMenu1items0Menu) EVT_MENU(self, wxID_FRAGGLEVIEWPORTMENU1ITEMS1, self.OnMenu1items1Menu) + def _init_coll_menu2_Items(self, parent): + # generated method, don't edit + + parent.Append(helpString='Contents', + id=wxID_FRAGGLEVIEWPORTMENU2CONT, item='Contents', + kind=wxITEM_NORMAL) + parent.Append(helpString='About', + id=wxID_FRAGGLEVIEWPORTMENU2ABOUT, item='About', + kind=wxITEM_NORMAL) + + EVT_MENU(self, wxID_FRAGGLEVIEWPORTMENU2CONT, self.OnMenu2items0Menu) + EVT_MENU(self, wxID_FRAGGLEVIEWPORTMENU2ABOUT, self.OnMenu2items1Menu) + def _init_coll_menuBar1_Menus(self, parent): # generated method, don't edit - parent.Append(menu=self.menu1, title='File') + parent.Append(menu=self.menu1, title='&File') + parent.Append(menu=self.menu2, title='&help') def _init_utils(self): # generated method, don't edit @@ -38,6 +58,8 @@ self.menu1 = wxMenu(title='') self._init_coll_menu1_Items(self.menu1) + self.menu2 = wxMenu(title='') + self._init_coll_menu2_Items(self.menu2) self._init_coll_menuBar1_Menus(self.menuBar1) @@ -55,6 +77,8 @@ def __init_preferences__(self): self.preferencesCtl = fraggleCtlPreferences.create(self) self.dialogPrefs = fraggleDialogPrefs.create(self) + self.dialogPrefs.loadConfig() + self.dialogPrefs.updateConfig() def __init__(self, parent): self._init_ctrls(parent) @@ -65,9 +89,23 @@ try: self.dialogPrefs.ShowModal() finally: - self.dialogPrefs.Destroy() + pass event.Skip() def OnMenu1items1Menu(self, event): self.Destroy() event.Skip() + + + def OnMenu2items0Menu(self, event): + try: + self.dialogPrefs.ShowModal() + finally: + pass + event.Skip() + + def OnMenu2items1Menu(self, event): + #self.Destroy() + #event.Skip() + fraggleDialogs.AboutDialog() +