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