--- nfo/projects/netfraggle/bin/fraggleViewport.py 2004/08/27 00:05:22 1.12 +++ nfo/projects/netfraggle/bin/fraggleViewport.py 2004/08/27 04:39:06 1.14 @@ -1,7 +1,13 @@ #Boa:MDIParent:fraggleViewport -# $Id: fraggleViewport.py,v 1.12 2004/08/27 00:05:22 joko Exp $ +# $Id: fraggleViewport.py,v 1.14 2004/08/27 04:39:06 joko Exp $ # $Log: fraggleViewport.py,v $ +# Revision 1.14 2004/08/27 04:39:06 joko +# cleanup +# +# Revision 1.13 2004/08/27 03:25:44 joko +# added FraggleTaskBarMenu +# # Revision 1.12 2004/08/27 00:05:22 joko # fix for icon-path and wxTaskBarIcon-events # @@ -42,7 +48,25 @@ [wxID_FRAGGLEVIEWPORTMENU2ABOUT, wxID_FRAGGLEVIEWPORTMENU2CONT, ] = map(lambda _init_coll_menu2_Items: wxNewId(), range(2)) +[wxID_FRAGGLEVIEWPORTFRAGGLETASKBARMENUITEMSEXIT, + wxID_FRAGGLEVIEWPORTFRAGGLETASKBARMENUITEMSRESTORE, + wxID_FRAGGLEVIEWPORTFRAGGLETASKBARMENUITEMSSYNC, +] = map(lambda _init_coll_FraggleTaskBarMenu_Items: wxNewId(), range(3)) + class fraggleViewport(wxMDIParentFrame): + def _init_coll_FraggleTaskBarMenu_Items(self, parent): + # generated method, don't edit + + parent.Append(helpString='Restore', + id=wxID_FRAGGLEVIEWPORTFRAGGLETASKBARMENUITEMSRESTORE, + item='Restore', kind=wxITEM_NORMAL) + parent.Append(helpString='Sync enabled', + id=wxID_FRAGGLEVIEWPORTFRAGGLETASKBARMENUITEMSSYNC, + item='Sync enabled', kind=wxITEM_CHECK) + parent.Append(helpString='Exit', + id=wxID_FRAGGLEVIEWPORTFRAGGLETASKBARMENUITEMSEXIT, item='Exit', + kind=wxITEM_NORMAL) + def _init_coll_menu2_Items(self, parent): # generated method, don't edit @@ -76,9 +100,12 @@ self.menu2 = wxMenu(title='') + self.FraggleTaskBarMenu = wxMenu(title=u'NetFraggle') + self._init_coll_menuBar1_Menus(self.menuBar1) self._init_coll_menu1_Items(self.menu1) self._init_coll_menu2_Items(self.menu2) + self._init_coll_FraggleTaskBarMenu_Items(self.FraggleTaskBarMenu) def _init_ctrls(self, prnt): # generated method, don't edit @@ -98,13 +125,15 @@ self.dialogPrefs.updateConfig() # new as of 2004-08-26: TopicFrame - self.topicFrame = FraggleTopicFrame.create(self) - self.topicFrame.Move(wxPoint(10, 10)) + # new as of 2004-08-27: pass configList to TopicFrame + self.topicFrame = FraggleTopicFrame.create(self, self.preferencesCtl.configList) + self.topicFrame.Move(wxPoint(5, 5)) #frame.Show() #frame.Destroy() def __init_xmlrpc__(self): - self.xml_rpc = FraggleXMLRPC.create(self, self.preferencesCtl.configList) + #self.xml_rpc = FraggleXMLRPC.create(self, self.preferencesCtl.configList) + pass def __init_taskbar_icon__(self): if os.name == 'posix': @@ -116,10 +145,9 @@ self.tbicon.SetIcon(icon, '') EVT_TASKBAR_LEFT_DCLICK(self.tbicon, self.OnTaskBarLeftDClick) EVT_TASKBAR_RIGHT_UP(self.tbicon, self.OnTaskBarRightClick) + 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): self._init_ctrls(parent) self.__init_preferences__() @@ -154,14 +182,21 @@ def OnTaskBarLeftDClick(self, event): #event.Skip() #self.SetFocus() - self.Restore() + if self.IsIconized(): + self.Restore() + else: + self.Iconize() def OnTaskBarRightClick(self, event): - event.Skip() + #event.Skip() + self.tbicon.PopupMenu(self.FraggleTaskBarMenu) + + def OnTaskBarAppRestore(self, event): + self.Restore() + #event.Skip() - def OnButtonsyncButton(self, event): - fragglexml = self.xml_rpc.FraggleSync() - print fragglexml - #text = fragglexml.data - self.styledTextCtrl1.AddText(fragglexml) - event.Skip() + def OnTaskBarAppExit(self, event): + #event.Skip() + #self.Destroy() + self.Close(True) +