1 |
xabbu |
1.1 |
#!/usr/bin/env python |
2 |
|
|
#Boa:App:BoaApp |
3 |
|
|
|
4 |
joko |
1.7 |
# $Id: fraggleMain.py,v 1.6 2004/08/30 13:01:47 joko Exp $ |
5 |
joko |
1.5 |
# $Log: fraggleMain.py,v $ |
6 |
joko |
1.7 |
# Revision 1.6 2004/08/30 13:01:47 joko |
7 |
|
|
# U prepend "libs"-dir to path |
8 |
|
|
# |
9 |
joko |
1.6 |
# Revision 1.5 2004/08/27 03:22:30 joko |
10 |
|
|
# start singleton instance of FraggleEngine here |
11 |
|
|
# |
12 |
joko |
1.5 |
# Revision 1.4 2004/08/26 15:19:26 joko |
13 |
|
|
# get rid of urlOpener here |
14 |
|
|
# added key shortcuts to menu-items |
15 |
|
|
# |
16 |
joko |
1.4 |
|
17 |
joko |
1.5 |
import sys, os |
18 |
xabbu |
1.1 |
from wxPython.wx import * |
19 |
|
|
|
20 |
joko |
1.5 |
from fraggleConstants import * |
21 |
|
|
from fraggleEngine import * |
22 |
xabbu |
1.3 |
from fraggleViewport import * |
23 |
xabbu |
1.1 |
|
24 |
|
|
modules ={'fraggleDialogPrefs': [0, '', 'fraggleDialogPrefs.py'], |
25 |
|
|
'fraggleViewport': [1, '', 'fraggleViewport.py']} |
26 |
|
|
|
27 |
|
|
class BoaApp(wxApp): |
28 |
|
|
def OnInit(self): |
29 |
|
|
wxInitAllImageHandlers() |
30 |
xabbu |
1.3 |
self.main = fraggleMainWin(None) |
31 |
xabbu |
1.1 |
# needed when running from Boa under Windows 9X |
32 |
|
|
self.SetTopWindow(self.main) |
33 |
|
|
self.main.Show();self.main.Hide();self.main.Show() |
34 |
|
|
return True |
35 |
xabbu |
1.3 |
|
36 |
|
|
class fraggleMainWin(fraggleViewport): |
37 |
|
|
def _init_coll_menu1_Items(self, parent): |
38 |
|
|
|
39 |
|
|
if os.name == 'posix': |
40 |
|
|
fraggleViewport._init_coll_menu1_Items(self, parent) |
41 |
|
|
elif os.name == 'nt': |
42 |
joko |
1.4 |
parent.Append(wxID_FRAGGLEVIEWPORTMENU1FPREFS, '&Configure Netfraggle', "", wxITEM_NORMAL) |
43 |
|
|
parent.Append(wxID_FRAGGLEVIEWPORTMENU1ITEMS1, '&Exit Netfraggle', "", wxITEM_NORMAL) |
44 |
xabbu |
1.3 |
|
45 |
|
|
EVT_MENU(self, wxID_FRAGGLEVIEWPORTMENU1FPREFS, self.OnMenu1items0Menu) |
46 |
|
|
EVT_MENU(self, wxID_FRAGGLEVIEWPORTMENU1ITEMS1, self.OnMenu1items1Menu) |
47 |
|
|
|
48 |
|
|
def _init_coll_menu2_Items(self, parent): |
49 |
|
|
|
50 |
|
|
if os.name == 'posix': |
51 |
|
|
fraggleViewport._init_coll_menu2_Items(self, parent) |
52 |
|
|
elif os.name == 'nt': |
53 |
joko |
1.4 |
parent.Append(wxID_FRAGGLEVIEWPORTMENU2CONT, '&Contents', "", wxITEM_NORMAL) |
54 |
|
|
parent.Append(wxID_FRAGGLEVIEWPORTMENU2ABOUT, '&About', "", wxITEM_NORMAL) |
55 |
xabbu |
1.3 |
|
56 |
|
|
EVT_MENU(self, wxID_FRAGGLEVIEWPORTMENU2CONT, self.OnMenu2items0Menu) |
57 |
|
|
EVT_MENU(self, wxID_FRAGGLEVIEWPORTMENU2ABOUT, self.OnMenu2items1Menu) |
58 |
|
|
|
59 |
xabbu |
1.1 |
def main(): |
60 |
joko |
1.7 |
global engine, phpsessionid |
61 |
joko |
1.6 |
sys.path.insert(0, os.path.join(APPLOCATION, '..', 'libs')) |
62 |
joko |
1.5 |
engine = FraggleEngine() |
63 |
joko |
1.7 |
# TODO: move elsewhere! |
64 |
|
|
phpsessionid = "" |
65 |
xabbu |
1.1 |
application = BoaApp(0) |
66 |
|
|
application.MainLoop() |
67 |
|
|
|
68 |
|
|
if __name__ == '__main__': |
69 |
|
|
main() |