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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.18 - (hide annotations)
Sat Sep 4 20:26:01 2004 UTC (19 years, 10 months ago) by xabbu
Branch: MAIN
Changes since 1.17: +30 -7 lines
File MIME type: text/x-python
+Added a button to the Preferences tab for showing the Modules Dialog.
 Todo: When the module dialog is shown, it is still being blocked by the    preferences dialog. I am not sure why but will have to look into it further.

+Added modules directory

1 xabbu 1.8 #Boa:MDIParent:fraggleViewport
2 xabbu 1.1
3 xabbu 1.18 # $Id: fraggleViewport.py,v 1.17 2004/09/01 21:43:30 xabbu Exp $
4 joko 1.10 # $Log: fraggleViewport.py,v $
5 xabbu 1.18 # Revision 1.17 2004/09/01 21:43:30 xabbu
6     # +Moved funtion getDefaultDir from FraggleCtlPreferences to FraggleEngine for more convenience
7     # +FraggleCtlModules class creation for handling content modules
8     #
9 xabbu 1.17 # Revision 1.16 2004/08/30 13:06:40 joko
10     # U now gets preferences via self.engine
11     #
12 joko 1.16 # Revision 1.15 2004/08/27 21:14:02 xabbu
13     # TopicDetails can now be closed.
14     # GUI change on Preferences Dialog in order to prepare multiple server profiles.
15     # Small bugfixes to get the new topic windows working on posix platform.
16     #
17 xabbu 1.15 # Revision 1.14 2004/08/27 04:39:06 joko
18     # cleanup
19     #
20 joko 1.14 # Revision 1.13 2004/08/27 03:25:44 joko
21     # added FraggleTaskBarMenu
22     #
23 joko 1.13 # Revision 1.12 2004/08/27 00:05:22 joko
24     # fix for icon-path and wxTaskBarIcon-events
25     #
26 joko 1.12 # Revision 1.11 2004/08/26 23:10:12 xabbu
27     # xmlrpc class added
28     #
29 xabbu 1.11 # Revision 1.10 2004/08/26 18:19:27 joko
30     # now using FraggleTopicFrame
31     #
32 joko 1.10 # Revision 1.9 2004/08/26 15:21:13 joko
33     # renamed namespaces
34     # added key shortcuts to menu-items
35     # correct "showAbout" code
36     #
37 joko 1.9
38 joko 1.5 import os
39 xabbu 1.1 from wxPython.wx import *
40 xabbu 1.11 from wxPython.stc import *
41 xabbu 1.1
42 joko 1.12 from fraggleConstants import *
43 xabbu 1.1 import fraggleDialogPrefs
44 xabbu 1.18 import FraggleDialogModules
45 joko 1.9 import FraggleAboutDialog
46 joko 1.10 import FraggleTopicFrame
47 xabbu 1.11 import FraggleXMLRPC
48 xabbu 1.1
49     def create(parent):
50 xabbu 1.8 return fraggleViewport(parent)
51 xabbu 1.1
52 joko 1.12 [wxID_FRAGGLEVIEWPORT] = map(lambda _init_ctrls: wxNewId(), range(1))
53 xabbu 1.1
54 xabbu 1.18 [wxID_FRAGGLEVIEWPORTMENU1FMODULES, wxID_FRAGGLEVIEWPORTMENU1FPREFS,
55     wxID_FRAGGLEVIEWPORTMENU1ITEMS1,
56     ] = map(lambda _init_coll_menu1_Items: wxNewId(), range(3))
57 xabbu 1.1
58 joko 1.9 [wxID_FRAGGLEVIEWPORTMENU2ABOUT, wxID_FRAGGLEVIEWPORTMENU2CONT,
59     ] = map(lambda _init_coll_menu2_Items: wxNewId(), range(2))
60 joko 1.7
61 xabbu 1.11 [wxID_FRAGGLEVIEWPORTMENU2ABOUT, wxID_FRAGGLEVIEWPORTMENU2CONT,
62     ] = map(lambda _init_coll_menu2_Items: wxNewId(), range(2))
63    
64 joko 1.13 [wxID_FRAGGLEVIEWPORTFRAGGLETASKBARMENUITEMSEXIT,
65     wxID_FRAGGLEVIEWPORTFRAGGLETASKBARMENUITEMSRESTORE,
66     wxID_FRAGGLEVIEWPORTFRAGGLETASKBARMENUITEMSSYNC,
67     ] = map(lambda _init_coll_FraggleTaskBarMenu_Items: wxNewId(), range(3))
68    
69 xabbu 1.2 class fraggleViewport(wxMDIParentFrame):
70 joko 1.13 def _init_coll_FraggleTaskBarMenu_Items(self, parent):
71     # generated method, don't edit
72    
73 joko 1.14 parent.Append(helpString='Restore',
74 joko 1.13 id=wxID_FRAGGLEVIEWPORTFRAGGLETASKBARMENUITEMSRESTORE,
75     item='Restore', kind=wxITEM_NORMAL)
76     parent.Append(helpString='Sync enabled',
77     id=wxID_FRAGGLEVIEWPORTFRAGGLETASKBARMENUITEMSSYNC,
78     item='Sync enabled', kind=wxITEM_CHECK)
79     parent.Append(helpString='Exit',
80     id=wxID_FRAGGLEVIEWPORTFRAGGLETASKBARMENUITEMSEXIT, item='Exit',
81     kind=wxITEM_NORMAL)
82    
83 joko 1.9 def _init_coll_menu2_Items(self, parent):
84     # generated method, don't edit
85    
86     parent.Append(helpString='Contents', id=wxID_FRAGGLEVIEWPORTMENU2CONT,
87     item='Contents', kind=wxITEM_NORMAL)
88     parent.Append(helpString='About', id=wxID_FRAGGLEVIEWPORTMENU2ABOUT,
89     item='About', kind=wxITEM_NORMAL)
90    
91 xabbu 1.1 def _init_coll_menu1_Items(self, parent):
92     # generated method, don't edit
93 joko 1.9
94 xabbu 1.18 parent.Append(helpString='Configure Modules',
95     id=wxID_FRAGGLEVIEWPORTMENU1FMODULES, item='Modules',
96     kind=wxITEM_NORMAL)
97 xabbu 1.6 parent.Append(helpString='Configure Netfraggle',
98     id=wxID_FRAGGLEVIEWPORTMENU1FPREFS, item='Preferences',
99     kind=wxITEM_NORMAL)
100     parent.Append(helpString='Exit Netfraggle',
101     id=wxID_FRAGGLEVIEWPORTMENU1ITEMS1, item='Exit',
102     kind=wxITEM_NORMAL)
103 xabbu 1.18 EVT_MENU(self, wxID_FRAGGLEVIEWPORTMENU1FMODULES,
104     self.OnMenu1FmodulesMenu)
105     EVT_MENU(self, wxID_FRAGGLEVIEWPORTMENU1FPREFS, self.OnMenu1FprefsMenu)
106     EVT_MENU(self, wxID_FRAGGLEVIEWPORTMENU1ITEMS1, self.OnMenu1Items1Menu)
107 xabbu 1.1
108     def _init_coll_menuBar1_Menus(self, parent):
109     # generated method, don't edit
110    
111 xabbu 1.8 parent.Append(menu=self.menu1, title='&File')
112 joko 1.9 parent.Append(menu=self.menu2, title='&Help')
113 xabbu 1.1
114     def _init_utils(self):
115     # generated method, don't edit
116     self.menuBar1 = wxMenuBar()
117     self.menuBar1.SetAutoLayout(1)
118    
119     self.menu1 = wxMenu(title='')
120 joko 1.9
121 joko 1.7 self.menu2 = wxMenu(title='')
122    
123 joko 1.13 self.FraggleTaskBarMenu = wxMenu(title=u'NetFraggle')
124    
125 xabbu 1.1 self._init_coll_menuBar1_Menus(self.menuBar1)
126 xabbu 1.18 self._init_coll_menu1_Items(self.menu1)
127     self._init_coll_menu2_Items(self.menu2)
128     self._init_coll_FraggleTaskBarMenu_Items(self.FraggleTaskBarMenu)
129 xabbu 1.1
130     def _init_ctrls(self, prnt):
131     # generated method, don't edit
132 xabbu 1.2 wxMDIParentFrame.__init__(self, id=wxID_FRAGGLEVIEWPORT,
133 xabbu 1.15 name='fraggleViewport', parent=prnt, pos=wxPoint(335, 382),
134 xabbu 1.18 size=wxSize(435, 273),
135 xabbu 1.1 style=wxDEFAULT_FRAME_STYLE | wxVSCROLL | wxHSCROLL,
136 xabbu 1.11 title='NetFraggle 0.0.1')
137 xabbu 1.1 self._init_utils()
138 xabbu 1.15 self.SetClientSize(wxSize(427, 246))
139 xabbu 1.1 self.SetMenuBar(self.menuBar1)
140    
141 xabbu 1.17 def __init_modules__(self):
142     self.modulesCtl = self.engine.modules
143     self.dialogModules = FraggleDialogModules.create(self)
144    
145 xabbu 1.2 def __init_preferences__(self):
146 joko 1.16 self.preferencesCtl = self.engine.preferences
147 xabbu 1.2 self.dialogPrefs = fraggleDialogPrefs.create(self)
148 xabbu 1.6 self.dialogPrefs.loadConfig()
149     self.dialogPrefs.updateConfig()
150 joko 1.10
151     # new as of 2004-08-26: TopicFrame
152 joko 1.13 # new as of 2004-08-27: pass configList to TopicFrame
153 joko 1.16 self.topicFrame = FraggleTopicFrame.create(self)
154 joko 1.14 self.topicFrame.Move(wxPoint(5, 5))
155 joko 1.10
156     #frame.Show()
157     #frame.Destroy()
158 xabbu 1.11 def __init_xmlrpc__(self):
159 joko 1.13 #self.xml_rpc = FraggleXMLRPC.create(self, self.preferencesCtl.configList)
160     pass
161 xabbu 1.2
162 xabbu 1.11 def __init_taskbar_icon__(self):
163     if os.name == 'posix':
164     pass
165     elif os.name == 'nt':
166     self.tbicon = wxTaskBarIcon()
167 joko 1.12 #icon = wxIcon('mixxx.ico', wxBITMAP_TYPE_ICO)
168     icon = wxIcon(os.path.join(APPLOCATION, 'mixxx.ico'), wxBITMAP_TYPE_ICO)
169 xabbu 1.11 self.tbicon.SetIcon(icon, '')
170 joko 1.12 EVT_TASKBAR_LEFT_DCLICK(self.tbicon, self.OnTaskBarLeftDClick)
171     EVT_TASKBAR_RIGHT_UP(self.tbicon, self.OnTaskBarRightClick)
172 joko 1.13 EVT_MENU(self.tbicon, wxID_FRAGGLEVIEWPORTFRAGGLETASKBARMENUITEMSRESTORE, self.OnTaskBarAppRestore)
173     EVT_MENU(self.tbicon, wxID_FRAGGLEVIEWPORTFRAGGLETASKBARMENUITEMSEXIT, self.OnTaskBarAppExit)
174 joko 1.12
175 xabbu 1.1 def __init__(self, parent):
176 joko 1.16 import __main__
177     self.engine = __main__.engine
178 xabbu 1.1 self._init_ctrls(parent)
179 xabbu 1.18 self.__init_modules__()
180 xabbu 1.2 self.__init_preferences__()
181 xabbu 1.11 self.__init_taskbar_icon__()
182     self.__init_xmlrpc__()
183 xabbu 1.8
184     def OnMenu1items0Menu(self, event):
185 xabbu 1.1 try:
186     self.dialogPrefs.ShowModal()
187     finally:
188 xabbu 1.11 self.dialogPrefs.Hide()
189 xabbu 1.8 event.Skip()
190    
191     def OnMenu1items1Menu(self, event):
192 joko 1.7 self.Destroy()
193 xabbu 1.8 event.Skip()
194 xabbu 1.1
195 joko 1.7
196     def OnMenu2items0Menu(self, event):
197 xabbu 1.8 try:
198     self.dialogPrefs.ShowModal()
199     finally:
200     pass
201     event.Skip()
202 joko 1.7
203     def OnMenu2items1Menu(self, event):
204 joko 1.9 """Show about screen"""
205     dlg = FraggleAboutDialog.create(self)
206     dlg.ShowModal()
207     dlg.Destroy()
208 joko 1.4
209 xabbu 1.11 def OnTaskBarLeftDClick(self, event):
210 joko 1.12 #event.Skip()
211     #self.SetFocus()
212 joko 1.13 if self.IsIconized():
213     self.Restore()
214     else:
215     self.Iconize()
216 xabbu 1.11
217     def OnTaskBarRightClick(self, event):
218 joko 1.13 #event.Skip()
219     self.tbicon.PopupMenu(self.FraggleTaskBarMenu)
220    
221     def OnTaskBarAppRestore(self, event):
222     self.Restore()
223     #event.Skip()
224 xabbu 1.11
225 joko 1.13 def OnTaskBarAppExit(self, event):
226     #event.Skip()
227     #self.Destroy()
228     self.Close(True)
229 xabbu 1.18
230     def OnMenu1FmodulesMenu(self, event):
231     event.Skip()
232    
233     def OnMenu1FprefsMenu(self, event):
234     event.Skip()
235    
236     def OnMenu1Items1Menu(self, event):
237     event.Skip()
238 joko 1.13

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