/[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.5 - (hide annotations)
Wed Aug 25 19:54:07 2004 UTC (19 years, 10 months ago) by joko
Branch: MAIN
Changes since 1.4: +12 -6 lines
File MIME type: text/x-python
added possibly better fix for win32 (maybe also working on linux now): dispatch by OS (os.name) and do different methods of adding menu entries

1 xabbu 1.2 #Boa:MDIParent:fraggleViewport
2 xabbu 1.1
3 joko 1.5 import os
4 xabbu 1.1 from wxPython.wx import *
5    
6     import fraggleDialogPrefs
7 xabbu 1.2 import fraggleCtlPreferences
8 xabbu 1.1
9     def create(parent):
10 xabbu 1.2 return fraggleViewport(parent)
11 xabbu 1.1
12 xabbu 1.2 [wxID_FRAGGLEVIEWPORT] = map(lambda _init_ctrls: wxNewId(), range(1))
13 xabbu 1.1
14 xabbu 1.2 [wxID_FRAGGLEVIEWPORTMENU1FPREFS, wxID_FRAGGLEVIEWPORTMENU1ITEMS1,
15 xabbu 1.1 ] = map(lambda _init_coll_menu1_Items: wxNewId(), range(2))
16    
17 xabbu 1.2 class fraggleViewport(wxMDIParentFrame):
18 xabbu 1.1 def _init_coll_menu1_Items(self, parent):
19     # generated method, don't edit
20    
21 joko 1.5 if os.name == "posix":
22     parent.Append(helpString='Configure Netfraggle',
23     id=wxID_FRAGGLEVIEWPORTMENU1FPREFS, item='Preferences',
24     kind=wxITEM_NORMAL)
25     parent.Append(helpString='Exit Netfraggle',
26     id=wxID_FRAGGLEVIEWPORTMENU1ITEMS1, item='Exit',
27     kind=wxITEM_NORMAL)
28     elif os.name == "nt":
29     parent.Append(wxID_FRAGGLEVIEWPORTMENU1FPREFS, 'Configure Netfraggle', "", wxITEM_NORMAL)
30     parent.Append(wxID_FRAGGLEVIEWPORTMENU1FPREFS, 'Exit Netfraggle', "", wxITEM_NORMAL)
31    
32 xabbu 1.2 EVT_MENU(self, wxID_FRAGGLEVIEWPORTMENU1FPREFS, self.OnMenu1items0Menu)
33     EVT_MENU(self, wxID_FRAGGLEVIEWPORTMENU1ITEMS1, self.OnMenu1items1Menu)
34 xabbu 1.1
35     def _init_coll_menuBar1_Menus(self, parent):
36     # generated method, don't edit
37    
38     parent.Append(menu=self.menu1, title='File')
39    
40     def _init_utils(self):
41     # generated method, don't edit
42     self.menuBar1 = wxMenuBar()
43     self.menuBar1.SetAutoLayout(1)
44    
45     self.menu1 = wxMenu(title='')
46     self._init_coll_menu1_Items(self.menu1)
47    
48     self._init_coll_menuBar1_Menus(self.menuBar1)
49    
50     def _init_ctrls(self, prnt):
51     # generated method, don't edit
52 xabbu 1.2 wxMDIParentFrame.__init__(self, id=wxID_FRAGGLEVIEWPORT,
53     name='fraggleViewport', parent=prnt, pos=wxPoint(277, 313),
54     size=wxSize(683, 307),
55 xabbu 1.1 style=wxDEFAULT_FRAME_STYLE | wxVSCROLL | wxHSCROLL,
56     title='wxMDIParentFrame1')
57     self._init_utils()
58 xabbu 1.2 self.SetClientSize(wxSize(683, 284))
59 xabbu 1.1 self.SetMenuBar(self.menuBar1)
60    
61 xabbu 1.2 def __init_preferences__(self):
62     self.preferencesCtl = fraggleCtlPreferences.create(self)
63     self.dialogPrefs = fraggleDialogPrefs.create(self)
64    
65 xabbu 1.1 def __init__(self, parent):
66     self._init_ctrls(parent)
67 xabbu 1.2 self.__init_preferences__()
68    
69 xabbu 1.1
70     def OnMenu1items0Menu(self, event):
71     try:
72     self.dialogPrefs.ShowModal()
73     finally:
74     self.dialogPrefs.Destroy()
75     event.Skip()
76    
77     def OnMenu1items1Menu(self, event):
78     self.Destroy()
79     event.Skip()
80 joko 1.4

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