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 |
9 |
|
# xmlrpc class added |
10 |
|
# |
11 |
# Revision 1.10 2004/08/26 18:19:27 joko |
# Revision 1.10 2004/08/26 18:19:27 joko |
12 |
# now using FraggleTopicFrame |
# now using FraggleTopicFrame |
13 |
# |
# |
19 |
|
|
20 |
import os |
import os |
21 |
from wxPython.wx import * |
from wxPython.wx import * |
22 |
|
from wxPython.stc import * |
23 |
|
|
24 |
|
from fraggleConstants import * |
25 |
import fraggleDialogPrefs |
import fraggleDialogPrefs |
26 |
import fraggleCtlPreferences |
import fraggleCtlPreferences |
27 |
import FraggleAboutDialog |
import FraggleAboutDialog |
28 |
import FraggleTopicFrame |
import FraggleTopicFrame |
29 |
|
import FraggleXMLRPC |
30 |
|
|
31 |
def create(parent): |
def create(parent): |
32 |
return fraggleViewport(parent) |
return fraggleViewport(parent) |
39 |
[wxID_FRAGGLEVIEWPORTMENU2ABOUT, wxID_FRAGGLEVIEWPORTMENU2CONT, |
[wxID_FRAGGLEVIEWPORTMENU2ABOUT, wxID_FRAGGLEVIEWPORTMENU2CONT, |
40 |
] = map(lambda _init_coll_menu2_Items: wxNewId(), range(2)) |
] = map(lambda _init_coll_menu2_Items: wxNewId(), range(2)) |
41 |
|
|
42 |
|
[wxID_FRAGGLEVIEWPORTMENU2ABOUT, wxID_FRAGGLEVIEWPORTMENU2CONT, |
43 |
|
] = map(lambda _init_coll_menu2_Items: wxNewId(), range(2)) |
44 |
|
|
45 |
class fraggleViewport(wxMDIParentFrame): |
class fraggleViewport(wxMDIParentFrame): |
46 |
def _init_coll_menu2_Items(self, parent): |
def _init_coll_menu2_Items(self, parent): |
47 |
# generated method, don't edit |
# generated method, don't edit |
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(237, 287), |
name='fraggleViewport', parent=prnt, pos=wxPoint(338, 296), |
87 |
size=wxSize(485, 310), |
size=wxSize(435, 296), |
88 |
style=wxDEFAULT_FRAME_STYLE | wxVSCROLL | wxHSCROLL, |
style=wxDEFAULT_FRAME_STYLE | wxVSCROLL | wxHSCROLL, |
89 |
title='NetFraggle') |
title='NetFraggle 0.0.1') |
90 |
self._init_utils() |
self._init_utils() |
91 |
self.SetClientSize(wxSize(477, 283)) |
self.SetClientSize(wxSize(427, 269)) |
92 |
self.SetMenuBar(self.menuBar1) |
self.SetMenuBar(self.menuBar1) |
93 |
|
|
94 |
def __init_preferences__(self): |
def __init_preferences__(self): |
103 |
|
|
104 |
#frame.Show() |
#frame.Show() |
105 |
#frame.Destroy() |
#frame.Destroy() |
106 |
|
def __init_xmlrpc__(self): |
107 |
|
self.xml_rpc = FraggleXMLRPC.create(self, self.preferencesCtl.configList) |
108 |
|
|
109 |
|
def __init_taskbar_icon__(self): |
110 |
|
if os.name == 'posix': |
111 |
|
pass |
112 |
|
elif os.name == 'nt': |
113 |
|
self.tbicon = wxTaskBarIcon() |
114 |
|
#icon = wxIcon('mixxx.ico', wxBITMAP_TYPE_ICO) |
115 |
|
icon = wxIcon(os.path.join(APPLOCATION, 'mixxx.ico'), wxBITMAP_TYPE_ICO) |
116 |
|
self.tbicon.SetIcon(icon, '') |
117 |
|
EVT_TASKBAR_LEFT_DCLICK(self.tbicon, self.OnTaskBarLeftDClick) |
118 |
|
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__() |
126 |
|
self.__init_taskbar_icon__() |
127 |
|
self.__init_xmlrpc__() |
128 |
|
|
|
|
|
129 |
def OnMenu1items0Menu(self, event): |
def OnMenu1items0Menu(self, event): |
130 |
try: |
try: |
131 |
self.dialogPrefs.ShowModal() |
self.dialogPrefs.ShowModal() |
132 |
finally: |
finally: |
133 |
pass |
self.dialogPrefs.Hide() |
134 |
event.Skip() |
event.Skip() |
135 |
|
|
136 |
def OnMenu1items1Menu(self, event): |
def OnMenu1items1Menu(self, event): |
151 |
dlg.ShowModal() |
dlg.ShowModal() |
152 |
dlg.Destroy() |
dlg.Destroy() |
153 |
|
|
154 |
|
def OnTaskBarLeftDClick(self, event): |
155 |
|
#event.Skip() |
156 |
|
#self.SetFocus() |
157 |
|
self.Restore() |
158 |
|
|
159 |
|
def OnTaskBarRightClick(self, event): |
160 |
|
event.Skip() |
161 |
|
|
162 |
|
def OnButtonsyncButton(self, event): |
163 |
|
fragglexml = self.xml_rpc.FraggleSync() |
164 |
|
print fragglexml |
165 |
|
#text = fragglexml.data |
166 |
|
self.styledTextCtrl1.AddText(fragglexml) |
167 |
|
event.Skip() |