/[cvs]/nfo/projects/netfraggle/bin/fraggleViewport.py
ViewVC logotype

Contents of /nfo/projects/netfraggle/bin/fraggleViewport.py

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.12 - (show annotations)
Fri Aug 27 00:05:22 2004 UTC (19 years, 10 months ago) by joko
Branch: MAIN
Changes since 1.11: +25 -31 lines
File MIME type: text/x-python
fix for icon-path and wxTaskBarIcon-events

1 #Boa:MDIParent:fraggleViewport
2
3 # $Id: fraggleViewport.py,v 1.11 2004/08/26 23:10:12 xabbu Exp $
4 # $Log: fraggleViewport.py,v $
5 # Revision 1.11 2004/08/26 23:10:12 xabbu
6 # xmlrpc class added
7 #
8 # Revision 1.10 2004/08/26 18:19:27 joko
9 # now using FraggleTopicFrame
10 #
11 # Revision 1.9 2004/08/26 15:21:13 joko
12 # renamed namespaces
13 # added key shortcuts to menu-items
14 # correct "showAbout" code
15 #
16
17 import os
18 from wxPython.wx import *
19 from wxPython.stc import *
20
21 from fraggleConstants import *
22 import fraggleDialogPrefs
23 import fraggleCtlPreferences
24 import FraggleAboutDialog
25 import FraggleTopicFrame
26 import FraggleXMLRPC
27
28 def create(parent):
29 return fraggleViewport(parent)
30
31 [wxID_FRAGGLEVIEWPORT] = map(lambda _init_ctrls: wxNewId(), range(1))
32
33 [wxID_FRAGGLEVIEWPORTMENU1FPREFS, wxID_FRAGGLEVIEWPORTMENU1ITEMS1,
34 ] = map(lambda _init_coll_menu1_Items: wxNewId(), range(2))
35
36 [wxID_FRAGGLEVIEWPORTMENU2ABOUT, wxID_FRAGGLEVIEWPORTMENU2CONT,
37 ] = map(lambda _init_coll_menu2_Items: wxNewId(), range(2))
38
39 [wxID_FRAGGLEVIEWPORTMENU2ABOUT, wxID_FRAGGLEVIEWPORTMENU2CONT,
40 ] = map(lambda _init_coll_menu2_Items: wxNewId(), range(2))
41
42 class fraggleViewport(wxMDIParentFrame):
43 def _init_coll_menu2_Items(self, parent):
44 # generated method, don't edit
45
46 parent.Append(helpString='Contents', id=wxID_FRAGGLEVIEWPORTMENU2CONT,
47 item='Contents', kind=wxITEM_NORMAL)
48 parent.Append(helpString='About', id=wxID_FRAGGLEVIEWPORTMENU2ABOUT,
49 item='About', kind=wxITEM_NORMAL)
50
51 def _init_coll_menu1_Items(self, parent):
52 # generated method, don't edit
53
54 parent.Append(helpString='Configure Netfraggle',
55 id=wxID_FRAGGLEVIEWPORTMENU1FPREFS, item='Preferences',
56 kind=wxITEM_NORMAL)
57 parent.Append(helpString='Exit Netfraggle',
58 id=wxID_FRAGGLEVIEWPORTMENU1ITEMS1, item='Exit',
59 kind=wxITEM_NORMAL)
60
61 def _init_coll_menuBar1_Menus(self, parent):
62 # generated method, don't edit
63
64 parent.Append(menu=self.menu1, title='&File')
65 parent.Append(menu=self.menu2, title='&Help')
66
67 def _init_utils(self):
68 # generated method, don't edit
69 self.menuBar1 = wxMenuBar()
70 self.menuBar1.SetAutoLayout(1)
71
72 self.menu1 = wxMenu(title='')
73
74 self.menu2 = wxMenu(title='')
75
76 self._init_coll_menuBar1_Menus(self.menuBar1)
77 self._init_coll_menu1_Items(self.menu1)
78 self._init_coll_menu2_Items(self.menu2)
79
80 def _init_ctrls(self, prnt):
81 # generated method, don't edit
82 wxMDIParentFrame.__init__(self, id=wxID_FRAGGLEVIEWPORT,
83 name='fraggleViewport', parent=prnt, pos=wxPoint(338, 296),
84 size=wxSize(435, 296),
85 style=wxDEFAULT_FRAME_STYLE | wxVSCROLL | wxHSCROLL,
86 title='NetFraggle 0.0.1')
87 self._init_utils()
88 self.SetClientSize(wxSize(427, 269))
89 self.SetMenuBar(self.menuBar1)
90
91 def __init_preferences__(self):
92 self.preferencesCtl = fraggleCtlPreferences.create(self)
93 self.dialogPrefs = fraggleDialogPrefs.create(self)
94 self.dialogPrefs.loadConfig()
95 self.dialogPrefs.updateConfig()
96
97 # new as of 2004-08-26: TopicFrame
98 self.topicFrame = FraggleTopicFrame.create(self)
99 self.topicFrame.Move(wxPoint(10, 10))
100
101 #frame.Show()
102 #frame.Destroy()
103 def __init_xmlrpc__(self):
104 self.xml_rpc = FraggleXMLRPC.create(self, self.preferencesCtl.configList)
105
106 def __init_taskbar_icon__(self):
107 if os.name == 'posix':
108 pass
109 elif os.name == 'nt':
110 self.tbicon = wxTaskBarIcon()
111 #icon = wxIcon('mixxx.ico', wxBITMAP_TYPE_ICO)
112 icon = wxIcon(os.path.join(APPLOCATION, 'mixxx.ico'), wxBITMAP_TYPE_ICO)
113 self.tbicon.SetIcon(icon, '')
114 EVT_TASKBAR_LEFT_DCLICK(self.tbicon, self.OnTaskBarLeftDClick)
115 EVT_TASKBAR_RIGHT_UP(self.tbicon, self.OnTaskBarRightClick)
116
117 #EVT_BUTTON(self.updateButton, wxID_FRAGGLETOPICFRAMEUPDATEBUTTON,
118 # self.OnUpdateButtonButton)
119
120 def __init__(self, parent):
121 self._init_ctrls(parent)
122 self.__init_preferences__()
123 self.__init_taskbar_icon__()
124 self.__init_xmlrpc__()
125
126 def OnMenu1items0Menu(self, event):
127 try:
128 self.dialogPrefs.ShowModal()
129 finally:
130 self.dialogPrefs.Hide()
131 event.Skip()
132
133 def OnMenu1items1Menu(self, event):
134 self.Destroy()
135 event.Skip()
136
137
138 def OnMenu2items0Menu(self, event):
139 try:
140 self.dialogPrefs.ShowModal()
141 finally:
142 pass
143 event.Skip()
144
145 def OnMenu2items1Menu(self, event):
146 """Show about screen"""
147 dlg = FraggleAboutDialog.create(self)
148 dlg.ShowModal()
149 dlg.Destroy()
150
151 def OnTaskBarLeftDClick(self, event):
152 #event.Skip()
153 #self.SetFocus()
154 self.Restore()
155
156 def OnTaskBarRightClick(self, event):
157 event.Skip()
158
159 def OnButtonsyncButton(self, event):
160 fragglexml = self.xml_rpc.FraggleSync()
161 print fragglexml
162 #text = fragglexml.data
163 self.styledTextCtrl1.AddText(fragglexml)
164 event.Skip()

MailToCvsAdmin">MailToCvsAdmin
ViewVC Help
Powered by ViewVC 1.1.26 RSS 2.0 feed