| 1 |
#Boa:MDIParent:fraggleViewport |
| 2 |
|
| 3 |
# $Id$ |
| 4 |
# $Log$ |
| 5 |
|
| 6 |
import os |
| 7 |
from wxPython.wx import * |
| 8 |
|
| 9 |
import fraggleDialogPrefs |
| 10 |
import fraggleCtlPreferences |
| 11 |
import FraggleAboutDialog |
| 12 |
|
| 13 |
def create(parent): |
| 14 |
return fraggleViewport(parent) |
| 15 |
|
| 16 |
[wxID_FRAGGLEVIEWPORT] = map(lambda _init_ctrls: wxNewId(), range(1)) |
| 17 |
|
| 18 |
[wxID_FRAGGLEVIEWPORTMENU1FPREFS, wxID_FRAGGLEVIEWPORTMENU1ITEMS1, |
| 19 |
] = map(lambda _init_coll_menu1_Items: wxNewId(), range(2)) |
| 20 |
|
| 21 |
[wxID_FRAGGLEVIEWPORTMENU2ABOUT, wxID_FRAGGLEVIEWPORTMENU2CONT, |
| 22 |
] = map(lambda _init_coll_menu2_Items: wxNewId(), range(2)) |
| 23 |
|
| 24 |
class fraggleViewport(wxMDIParentFrame): |
| 25 |
def _init_coll_menu2_Items(self, parent): |
| 26 |
# generated method, don't edit |
| 27 |
|
| 28 |
parent.Append(helpString='Contents', id=wxID_FRAGGLEVIEWPORTMENU2CONT, |
| 29 |
item='Contents', kind=wxITEM_NORMAL) |
| 30 |
parent.Append(helpString='About', id=wxID_FRAGGLEVIEWPORTMENU2ABOUT, |
| 31 |
item='About', kind=wxITEM_NORMAL) |
| 32 |
|
| 33 |
def _init_coll_menu1_Items(self, parent): |
| 34 |
# generated method, don't edit |
| 35 |
|
| 36 |
parent.Append(helpString='Configure Netfraggle', |
| 37 |
id=wxID_FRAGGLEVIEWPORTMENU1FPREFS, item='Preferences', |
| 38 |
kind=wxITEM_NORMAL) |
| 39 |
parent.Append(helpString='Exit Netfraggle', |
| 40 |
id=wxID_FRAGGLEVIEWPORTMENU1ITEMS1, item='Exit', |
| 41 |
kind=wxITEM_NORMAL) |
| 42 |
|
| 43 |
def _init_coll_menuBar1_Menus(self, parent): |
| 44 |
# generated method, don't edit |
| 45 |
|
| 46 |
parent.Append(menu=self.menu1, title='&File') |
| 47 |
parent.Append(menu=self.menu2, title='&Help') |
| 48 |
|
| 49 |
def _init_utils(self): |
| 50 |
# generated method, don't edit |
| 51 |
self.menuBar1 = wxMenuBar() |
| 52 |
self.menuBar1.SetAutoLayout(1) |
| 53 |
|
| 54 |
self.menu1 = wxMenu(title='') |
| 55 |
|
| 56 |
self.menu2 = wxMenu(title='') |
| 57 |
|
| 58 |
self._init_coll_menuBar1_Menus(self.menuBar1) |
| 59 |
self._init_coll_menu1_Items(self.menu1) |
| 60 |
self._init_coll_menu2_Items(self.menu2) |
| 61 |
|
| 62 |
def _init_ctrls(self, prnt): |
| 63 |
# generated method, don't edit |
| 64 |
wxMDIParentFrame.__init__(self, id=wxID_FRAGGLEVIEWPORT, |
| 65 |
name='fraggleViewport', parent=prnt, pos=wxPoint(237, 287), |
| 66 |
size=wxSize(485, 310), |
| 67 |
style=wxDEFAULT_FRAME_STYLE | wxVSCROLL | wxHSCROLL, |
| 68 |
title='NetFraggle') |
| 69 |
self._init_utils() |
| 70 |
self.SetClientSize(wxSize(477, 283)) |
| 71 |
self.SetMenuBar(self.menuBar1) |
| 72 |
|
| 73 |
def __init_preferences__(self): |
| 74 |
self.preferencesCtl = fraggleCtlPreferences.create(self) |
| 75 |
self.dialogPrefs = fraggleDialogPrefs.create(self) |
| 76 |
self.dialogPrefs.loadConfig() |
| 77 |
self.dialogPrefs.updateConfig() |
| 78 |
|
| 79 |
def __init__(self, parent): |
| 80 |
self._init_ctrls(parent) |
| 81 |
self.__init_preferences__() |
| 82 |
|
| 83 |
|
| 84 |
def OnMenu1items0Menu(self, event): |
| 85 |
try: |
| 86 |
self.dialogPrefs.ShowModal() |
| 87 |
finally: |
| 88 |
pass |
| 89 |
event.Skip() |
| 90 |
|
| 91 |
def OnMenu1items1Menu(self, event): |
| 92 |
self.Destroy() |
| 93 |
event.Skip() |
| 94 |
|
| 95 |
|
| 96 |
def OnMenu2items0Menu(self, event): |
| 97 |
try: |
| 98 |
self.dialogPrefs.ShowModal() |
| 99 |
finally: |
| 100 |
pass |
| 101 |
event.Skip() |
| 102 |
|
| 103 |
def OnMenu2items1Menu(self, event): |
| 104 |
"""Show about screen""" |
| 105 |
dlg = FraggleAboutDialog.create(self) |
| 106 |
dlg.ShowModal() |
| 107 |
dlg.Destroy() |
| 108 |
|