| 2 |
|
|
| 3 |
# $Id$ |
# $Id$ |
| 4 |
# $Log$ |
# $Log$ |
| 5 |
|
# Revision 1.12 2004/08/27 00:05:22 joko |
| 6 |
|
# fix for icon-path and wxTaskBarIcon-events |
| 7 |
|
# |
| 8 |
# Revision 1.11 2004/08/26 23:10:12 xabbu |
# Revision 1.11 2004/08/26 23:10:12 xabbu |
| 9 |
# xmlrpc class added |
# xmlrpc class added |
| 10 |
# |
# |
| 21 |
from wxPython.wx import * |
from wxPython.wx import * |
| 22 |
from wxPython.stc import * |
from wxPython.stc import * |
| 23 |
|
|
| 24 |
|
from fraggleConstants import * |
| 25 |
import fraggleDialogPrefs |
import fraggleDialogPrefs |
| 26 |
import fraggleCtlPreferences |
import fraggleCtlPreferences |
| 27 |
import FraggleAboutDialog |
import FraggleAboutDialog |
| 31 |
def create(parent): |
def create(parent): |
| 32 |
return fraggleViewport(parent) |
return fraggleViewport(parent) |
| 33 |
|
|
| 34 |
[wxID_FRAGGLEVIEWPORT, wxID_FRAGGLEVIEWPORTBUTTONSYNC, |
[wxID_FRAGGLEVIEWPORT] = map(lambda _init_ctrls: wxNewId(), range(1)) |
|
wxID_FRAGGLEVIEWPORTSTYLEDTEXTCTRL1, |
|
|
] = map(lambda _init_ctrls: wxNewId(), range(3)) |
|
| 35 |
|
|
| 36 |
[wxID_FRAGGLEVIEWPORTMENU1FPREFS, wxID_FRAGGLEVIEWPORTMENU1ITEMS1, |
[wxID_FRAGGLEVIEWPORTMENU1FPREFS, wxID_FRAGGLEVIEWPORTMENU1ITEMS1, |
| 37 |
] = map(lambda _init_coll_menu1_Items: wxNewId(), range(2)) |
] = map(lambda _init_coll_menu1_Items: wxNewId(), range(2)) |
| 73 |
self.menuBar1.SetAutoLayout(1) |
self.menuBar1.SetAutoLayout(1) |
| 74 |
|
|
| 75 |
self.menu1 = wxMenu(title='') |
self.menu1 = wxMenu(title='') |
|
self._init_coll_menu1_Items(self.menu1) |
|
| 76 |
|
|
| 77 |
self.menu2 = wxMenu(title='') |
self.menu2 = wxMenu(title='') |
|
self._init_coll_menu2_Items(self.menu2) |
|
| 78 |
|
|
| 79 |
self._init_coll_menuBar1_Menus(self.menuBar1) |
self._init_coll_menuBar1_Menus(self.menuBar1) |
| 80 |
|
self._init_coll_menu1_Items(self.menu1) |
| 81 |
|
self._init_coll_menu2_Items(self.menu2) |
| 82 |
|
|
| 83 |
def _init_ctrls(self, prnt): |
def _init_ctrls(self, prnt): |
| 84 |
# generated method, don't edit |
# generated method, don't edit |
| 85 |
wxMDIParentFrame.__init__(self, id=wxID_FRAGGLEVIEWPORT, |
wxMDIParentFrame.__init__(self, id=wxID_FRAGGLEVIEWPORT, |
| 86 |
name='fraggleViewport', parent=prnt, pos=wxPoint(525, 292), |
name='fraggleViewport', parent=prnt, pos=wxPoint(338, 296), |
| 87 |
size=wxSize(341, 296), |
size=wxSize(435, 296), |
| 88 |
style=wxDEFAULT_FRAME_STYLE | wxVSCROLL | wxHSCROLL, |
style=wxDEFAULT_FRAME_STYLE | wxVSCROLL | wxHSCROLL, |
| 89 |
title='NetFraggle 0.0.1') |
title='NetFraggle 0.0.1') |
| 90 |
self._init_utils() |
self._init_utils() |
| 91 |
self.SetClientSize(wxSize(341, 273)) |
self.SetClientSize(wxSize(427, 269)) |
| 92 |
self.SetMenuBar(self.menuBar1) |
self.SetMenuBar(self.menuBar1) |
| 93 |
|
|
|
self.buttonsync = wxButton(id=wxID_FRAGGLEVIEWPORTBUTTONSYNC, |
|
|
label='Sync', name='buttonsync', parent=self, pos=wxPoint(104, |
|
|
240), size=wxSize(136, 24), style=0) |
|
|
EVT_BUTTON(self.buttonsync, wxID_FRAGGLEVIEWPORTBUTTONSYNC, |
|
|
self.OnButtonsyncButton) |
|
|
|
|
|
self.styledTextCtrl1 = wxStyledTextCtrl(id=wxID_FRAGGLEVIEWPORTSTYLEDTEXTCTRL1, |
|
|
name='styledTextCtrl1', parent=self, pos=wxPoint(8, 16), |
|
|
size=wxSize(328, 216), style=0) |
|
|
|
|
| 94 |
def __init_preferences__(self): |
def __init_preferences__(self): |
| 95 |
self.preferencesCtl = fraggleCtlPreferences.create(self) |
self.preferencesCtl = fraggleCtlPreferences.create(self) |
| 96 |
self.dialogPrefs = fraggleDialogPrefs.create(self) |
self.dialogPrefs = fraggleDialogPrefs.create(self) |
| 111 |
pass |
pass |
| 112 |
elif os.name == 'nt': |
elif os.name == 'nt': |
| 113 |
self.tbicon = wxTaskBarIcon() |
self.tbicon = wxTaskBarIcon() |
| 114 |
icon = wxIcon('mixxx.ico', wxBITMAP_TYPE_ICO) |
#icon = wxIcon('mixxx.ico', wxBITMAP_TYPE_ICO) |
| 115 |
|
icon = wxIcon(os.path.join(APPLOCATION, 'mixxx.ico'), wxBITMAP_TYPE_ICO) |
| 116 |
self.tbicon.SetIcon(icon, '') |
self.tbicon.SetIcon(icon, '') |
| 117 |
wxEVT_TASKBAR_LEFT_DCLICK(self.tbicon, self.OnTaskBarLeftDClick) |
EVT_TASKBAR_LEFT_DCLICK(self.tbicon, self.OnTaskBarLeftDClick) |
| 118 |
wxEVT_TASKBAR_RIGHT_UP(self.tbicon, self.OnTaskBarRightClick) |
EVT_TASKBAR_RIGHT_UP(self.tbicon, self.OnTaskBarRightClick) |
| 119 |
|
|
| 120 |
|
#EVT_BUTTON(self.updateButton, wxID_FRAGGLETOPICFRAMEUPDATEBUTTON, |
| 121 |
|
# self.OnUpdateButtonButton) |
| 122 |
|
|
| 123 |
def __init__(self, parent): |
def __init__(self, parent): |
| 124 |
self._init_ctrls(parent) |
self._init_ctrls(parent) |
| 125 |
self.__init_preferences__() |
self.__init_preferences__() |
| 152 |
dlg.Destroy() |
dlg.Destroy() |
| 153 |
|
|
| 154 |
def OnTaskBarLeftDClick(self, event): |
def OnTaskBarLeftDClick(self, event): |
| 155 |
event.Skip() |
#event.Skip() |
| 156 |
|
#self.SetFocus() |
| 157 |
|
self.Restore() |
| 158 |
|
|
| 159 |
def OnTaskBarRightClick(self, event): |
def OnTaskBarRightClick(self, event): |
| 160 |
event.Skip() |
event.Skip() |
| 162 |
def OnButtonsyncButton(self, event): |
def OnButtonsyncButton(self, event): |
| 163 |
fragglexml = self.xml_rpc.FraggleSync() |
fragglexml = self.xml_rpc.FraggleSync() |
| 164 |
print fragglexml |
print fragglexml |
|
import codecs |
|
|
(UTF8_encode, UTF8_decode, |
|
|
UTF8_streamreader, UTF8_streamwriter) = codecs.lookup('UTF-8') |
|
|
text = UTF8_decode(repr(fragglexml))[0] |
|
|
text = fragglexml.data |
|
|
self.styledTextCtrl1.AddText(text) |
|
|
event.Skip() |
|
| 165 |
|
#text = fragglexml.data |
| 166 |
|
self.styledTextCtrl1.AddText(fragglexml) |
| 167 |
|
event.Skip() |