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