--- nfo/projects/netfraggle/bin/fraggleViewport.py 2004/08/25 23:46:05 1.8 +++ nfo/projects/netfraggle/bin/fraggleViewport.py 2004/08/26 15:21:13 1.9 @@ -1,11 +1,19 @@ #Boa:MDIParent:fraggleViewport +# $Id: fraggleViewport.py,v 1.9 2004/08/26 15:21:13 joko Exp $ +# $Log: fraggleViewport.py,v $ +# Revision 1.9 2004/08/26 15:21:13 joko +# renamed namespaces +# added key shortcuts to menu-items +# correct "showAbout" code +# + import os from wxPython.wx import * import fraggleDialogPrefs import fraggleCtlPreferences -import fraggleDialogs +import FraggleAboutDialog def create(parent): return fraggleViewport(parent) @@ -15,13 +23,21 @@ [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)) +[wxID_FRAGGLEVIEWPORTMENU2ABOUT, wxID_FRAGGLEVIEWPORTMENU2CONT, +] = map(lambda _init_coll_menu2_Items: wxNewId(), range(2)) class fraggleViewport(wxMDIParentFrame): + 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) + 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) @@ -29,27 +45,11 @@ 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.menu2, title='&help') + parent.Append(menu=self.menu2, title='&Help') def _init_utils(self): # generated method, don't edit @@ -57,21 +57,22 @@ self.menuBar1.SetAutoLayout(1) 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) + self._init_coll_menu1_Items(self.menu1) + self._init_coll_menu2_Items(self.menu2) def _init_ctrls(self, prnt): # generated method, don't edit wxMDIParentFrame.__init__(self, id=wxID_FRAGGLEVIEWPORT, - name='fraggleViewport', parent=prnt, pos=wxPoint(277, 313), - size=wxSize(683, 307), + name='fraggleViewport', parent=prnt, pos=wxPoint(237, 287), + size=wxSize(485, 310), style=wxDEFAULT_FRAME_STYLE | wxVSCROLL | wxHSCROLL, - title='wxMDIParentFrame1') + title='NetFraggle') self._init_utils() - self.SetClientSize(wxSize(683, 284)) + self.SetClientSize(wxSize(477, 283)) self.SetMenuBar(self.menuBar1) def __init_preferences__(self): @@ -105,7 +106,8 @@ event.Skip() def OnMenu2items1Menu(self, event): - #self.Destroy() - #event.Skip() - fraggleDialogs.AboutDialog() + """Show about screen""" + dlg = FraggleAboutDialog.create(self) + dlg.ShowModal() + dlg.Destroy()