2 |
|
|
3 |
# $Id$ |
# $Id$ |
4 |
# $Log$ |
# $Log$ |
5 |
|
# Revision 1.14 2004/08/27 04:39:06 joko |
6 |
|
# cleanup |
7 |
|
# |
8 |
|
# Revision 1.13 2004/08/27 03:25:44 joko |
9 |
|
# added FraggleTaskBarMenu |
10 |
|
# |
11 |
# Revision 1.12 2004/08/27 00:05:22 joko |
# Revision 1.12 2004/08/27 00:05:22 joko |
12 |
# fix for icon-path and wxTaskBarIcon-events |
# fix for icon-path and wxTaskBarIcon-events |
13 |
# |
# |
48 |
[wxID_FRAGGLEVIEWPORTMENU2ABOUT, wxID_FRAGGLEVIEWPORTMENU2CONT, |
[wxID_FRAGGLEVIEWPORTMENU2ABOUT, wxID_FRAGGLEVIEWPORTMENU2CONT, |
49 |
] = map(lambda _init_coll_menu2_Items: wxNewId(), range(2)) |
] = map(lambda _init_coll_menu2_Items: wxNewId(), range(2)) |
50 |
|
|
51 |
|
[wxID_FRAGGLEVIEWPORTFRAGGLETASKBARMENUITEMSEXIT, |
52 |
|
wxID_FRAGGLEVIEWPORTFRAGGLETASKBARMENUITEMSRESTORE, |
53 |
|
wxID_FRAGGLEVIEWPORTFRAGGLETASKBARMENUITEMSSYNC, |
54 |
|
] = map(lambda _init_coll_FraggleTaskBarMenu_Items: wxNewId(), range(3)) |
55 |
|
|
56 |
class fraggleViewport(wxMDIParentFrame): |
class fraggleViewport(wxMDIParentFrame): |
57 |
|
def _init_coll_FraggleTaskBarMenu_Items(self, parent): |
58 |
|
# generated method, don't edit |
59 |
|
|
60 |
|
parent.Append(helpString='Restore', |
61 |
|
id=wxID_FRAGGLEVIEWPORTFRAGGLETASKBARMENUITEMSRESTORE, |
62 |
|
item='Restore', kind=wxITEM_NORMAL) |
63 |
|
parent.Append(helpString='Sync enabled', |
64 |
|
id=wxID_FRAGGLEVIEWPORTFRAGGLETASKBARMENUITEMSSYNC, |
65 |
|
item='Sync enabled', kind=wxITEM_CHECK) |
66 |
|
parent.Append(helpString='Exit', |
67 |
|
id=wxID_FRAGGLEVIEWPORTFRAGGLETASKBARMENUITEMSEXIT, item='Exit', |
68 |
|
kind=wxITEM_NORMAL) |
69 |
|
|
70 |
def _init_coll_menu2_Items(self, parent): |
def _init_coll_menu2_Items(self, parent): |
71 |
# generated method, don't edit |
# generated method, don't edit |
72 |
|
|
100 |
|
|
101 |
self.menu2 = wxMenu(title='') |
self.menu2 = wxMenu(title='') |
102 |
|
|
103 |
|
self.FraggleTaskBarMenu = wxMenu(title=u'NetFraggle') |
104 |
|
|
105 |
self._init_coll_menuBar1_Menus(self.menuBar1) |
self._init_coll_menuBar1_Menus(self.menuBar1) |
106 |
self._init_coll_menu1_Items(self.menu1) |
self._init_coll_menu1_Items(self.menu1) |
107 |
self._init_coll_menu2_Items(self.menu2) |
self._init_coll_menu2_Items(self.menu2) |
108 |
|
self._init_coll_FraggleTaskBarMenu_Items(self.FraggleTaskBarMenu) |
109 |
|
|
110 |
def _init_ctrls(self, prnt): |
def _init_ctrls(self, prnt): |
111 |
# generated method, don't edit |
# generated method, don't edit |
125 |
self.dialogPrefs.updateConfig() |
self.dialogPrefs.updateConfig() |
126 |
|
|
127 |
# new as of 2004-08-26: TopicFrame |
# new as of 2004-08-26: TopicFrame |
128 |
self.topicFrame = FraggleTopicFrame.create(self) |
# new as of 2004-08-27: pass configList to TopicFrame |
129 |
self.topicFrame.Move(wxPoint(10, 10)) |
self.topicFrame = FraggleTopicFrame.create(self, self.preferencesCtl.configList) |
130 |
|
self.topicFrame.Move(wxPoint(5, 5)) |
131 |
|
|
132 |
#frame.Show() |
#frame.Show() |
133 |
#frame.Destroy() |
#frame.Destroy() |
134 |
def __init_xmlrpc__(self): |
def __init_xmlrpc__(self): |
135 |
self.xml_rpc = FraggleXMLRPC.create(self, self.preferencesCtl.configList) |
#self.xml_rpc = FraggleXMLRPC.create(self, self.preferencesCtl.configList) |
136 |
|
pass |
137 |
|
|
138 |
def __init_taskbar_icon__(self): |
def __init_taskbar_icon__(self): |
139 |
if os.name == 'posix': |
if os.name == 'posix': |
145 |
self.tbicon.SetIcon(icon, '') |
self.tbicon.SetIcon(icon, '') |
146 |
EVT_TASKBAR_LEFT_DCLICK(self.tbicon, self.OnTaskBarLeftDClick) |
EVT_TASKBAR_LEFT_DCLICK(self.tbicon, self.OnTaskBarLeftDClick) |
147 |
EVT_TASKBAR_RIGHT_UP(self.tbicon, self.OnTaskBarRightClick) |
EVT_TASKBAR_RIGHT_UP(self.tbicon, self.OnTaskBarRightClick) |
148 |
|
EVT_MENU(self.tbicon, wxID_FRAGGLEVIEWPORTFRAGGLETASKBARMENUITEMSRESTORE, self.OnTaskBarAppRestore) |
149 |
|
EVT_MENU(self.tbicon, wxID_FRAGGLEVIEWPORTFRAGGLETASKBARMENUITEMSEXIT, self.OnTaskBarAppExit) |
150 |
|
|
|
#EVT_BUTTON(self.updateButton, wxID_FRAGGLETOPICFRAMEUPDATEBUTTON, |
|
|
# self.OnUpdateButtonButton) |
|
|
|
|
151 |
def __init__(self, parent): |
def __init__(self, parent): |
152 |
self._init_ctrls(parent) |
self._init_ctrls(parent) |
153 |
self.__init_preferences__() |
self.__init_preferences__() |
182 |
def OnTaskBarLeftDClick(self, event): |
def OnTaskBarLeftDClick(self, event): |
183 |
#event.Skip() |
#event.Skip() |
184 |
#self.SetFocus() |
#self.SetFocus() |
185 |
self.Restore() |
if self.IsIconized(): |
186 |
|
self.Restore() |
187 |
|
else: |
188 |
|
self.Iconize() |
189 |
|
|
190 |
def OnTaskBarRightClick(self, event): |
def OnTaskBarRightClick(self, event): |
191 |
event.Skip() |
#event.Skip() |
192 |
|
self.tbicon.PopupMenu(self.FraggleTaskBarMenu) |
193 |
|
|
194 |
|
def OnTaskBarAppRestore(self, event): |
195 |
|
self.Restore() |
196 |
|
#event.Skip() |
197 |
|
|
198 |
def OnButtonsyncButton(self, event): |
def OnTaskBarAppExit(self, event): |
199 |
fragglexml = self.xml_rpc.FraggleSync() |
#event.Skip() |
200 |
print fragglexml |
#self.Destroy() |
201 |
#text = fragglexml.data |
self.Close(True) |
202 |
self.styledTextCtrl1.AddText(fragglexml) |
|
|
event.Skip() |
|