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