--- nfo/projects/netfraggle/bin/fraggleViewport.py 2004/08/26 18:19:27 1.10 +++ nfo/projects/netfraggle/bin/fraggleViewport.py 2004/08/27 00:05:22 1.12 @@ -1,7 +1,13 @@ #Boa:MDIParent:fraggleViewport -# $Id: fraggleViewport.py,v 1.10 2004/08/26 18:19:27 joko Exp $ +# $Id: fraggleViewport.py,v 1.12 2004/08/27 00:05:22 joko Exp $ # $Log: fraggleViewport.py,v $ +# Revision 1.12 2004/08/27 00:05:22 joko +# fix for icon-path and wxTaskBarIcon-events +# +# Revision 1.11 2004/08/26 23:10:12 xabbu +# xmlrpc class added +# # Revision 1.10 2004/08/26 18:19:27 joko # now using FraggleTopicFrame # @@ -13,11 +19,14 @@ import os from wxPython.wx import * +from wxPython.stc import * +from fraggleConstants import * import fraggleDialogPrefs import fraggleCtlPreferences import FraggleAboutDialog import FraggleTopicFrame +import FraggleXMLRPC def create(parent): return fraggleViewport(parent) @@ -30,6 +39,9 @@ [wxID_FRAGGLEVIEWPORTMENU2ABOUT, wxID_FRAGGLEVIEWPORTMENU2CONT, ] = map(lambda _init_coll_menu2_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 @@ -71,12 +83,12 @@ def _init_ctrls(self, prnt): # generated method, don't edit wxMDIParentFrame.__init__(self, id=wxID_FRAGGLEVIEWPORT, - name='fraggleViewport', parent=prnt, pos=wxPoint(237, 287), - size=wxSize(485, 310), + name='fraggleViewport', parent=prnt, pos=wxPoint(338, 296), + size=wxSize(435, 296), style=wxDEFAULT_FRAME_STYLE | wxVSCROLL | wxHSCROLL, - title='NetFraggle') + title='NetFraggle 0.0.1') self._init_utils() - self.SetClientSize(wxSize(477, 283)) + self.SetClientSize(wxSize(427, 269)) self.SetMenuBar(self.menuBar1) def __init_preferences__(self): @@ -91,17 +103,34 @@ #frame.Show() #frame.Destroy() + def __init_xmlrpc__(self): + self.xml_rpc = FraggleXMLRPC.create(self, self.preferencesCtl.configList) + def __init_taskbar_icon__(self): + if os.name == 'posix': + pass + elif os.name == 'nt': + self.tbicon = wxTaskBarIcon() + #icon = wxIcon('mixxx.ico', wxBITMAP_TYPE_ICO) + icon = wxIcon(os.path.join(APPLOCATION, 'mixxx.ico'), wxBITMAP_TYPE_ICO) + self.tbicon.SetIcon(icon, '') + EVT_TASKBAR_LEFT_DCLICK(self.tbicon, self.OnTaskBarLeftDClick) + EVT_TASKBAR_RIGHT_UP(self.tbicon, self.OnTaskBarRightClick) + + #EVT_BUTTON(self.updateButton, wxID_FRAGGLETOPICFRAMEUPDATEBUTTON, + # self.OnUpdateButtonButton) + def __init__(self, parent): self._init_ctrls(parent) self.__init_preferences__() + self.__init_taskbar_icon__() + self.__init_xmlrpc__() - def OnMenu1items0Menu(self, event): try: self.dialogPrefs.ShowModal() finally: - pass + self.dialogPrefs.Hide() event.Skip() def OnMenu1items1Menu(self, event): @@ -122,3 +151,17 @@ dlg.ShowModal() dlg.Destroy() + def OnTaskBarLeftDClick(self, event): + #event.Skip() + #self.SetFocus() + self.Restore() + + def OnTaskBarRightClick(self, event): + event.Skip() + + def OnButtonsyncButton(self, event): + fragglexml = self.xml_rpc.FraggleSync() + print fragglexml + #text = fragglexml.data + self.styledTextCtrl1.AddText(fragglexml) + event.Skip()