1 |
4#Boa:MDIParent:fraggleViewport |
#Boa:MDIParent:fraggleViewport |
2 |
|
|
3 |
import os |
import os |
4 |
from wxPython.wx import * |
from wxPython.wx import * |
5 |
|
|
6 |
import fraggleDialogPrefs |
import fraggleDialogPrefs |
7 |
import fraggleCtlPreferences |
import fraggleCtlPreferences |
8 |
from fraggleDialogs import * |
import fraggleDialogs |
9 |
|
|
10 |
def create(parent): |
def create(parent): |
11 |
return fraggleMainWin(parent) |
return fraggleViewport(parent) |
12 |
|
|
13 |
[wxID_FRAGGLEVIEWPORT] = map(lambda _init_ctrls: wxNewId(), range(1)) |
[wxID_FRAGGLEVIEWPORT] = map(lambda _init_ctrls: wxNewId(), range(1)) |
14 |
|
|
16 |
] = map(lambda _init_coll_menu1_Items: wxNewId(), range(2)) |
] = map(lambda _init_coll_menu1_Items: wxNewId(), range(2)) |
17 |
|
|
18 |
[wxID_FRAGGLEVIEWPORTMENU2CONT, wxID_FRAGGLEVIEWPORTMENU2ABOUT, |
[wxID_FRAGGLEVIEWPORTMENU2CONT, wxID_FRAGGLEVIEWPORTMENU2ABOUT, |
19 |
] = map(lambda _init_coll_menu2_Items: wxNewId(), range(2)) |
] = map(lambda _init_coll_menu1_Items: wxNewId(), range(2)) |
20 |
|
|
21 |
class fraggleViewport(wxMDIParentFrame): |
class fraggleViewport(wxMDIParentFrame): |
22 |
def _init_coll_menu1_Items(self, parent): |
def _init_coll_menu1_Items(self, parent): |
34 |
|
|
35 |
def _init_coll_menu2_Items(self, parent): |
def _init_coll_menu2_Items(self, parent): |
36 |
# generated method, don't edit |
# generated method, don't edit |
37 |
|
|
38 |
parent.Append(helpString='Documentation', |
parent.Append(helpString='Contents', |
39 |
id=wxID_FRAGGLEVIEWPORTMENU2CONT, item='Contents', |
id=wxID_FRAGGLEVIEWPORTMENU2CONT, item='Contents', |
40 |
kind=wxITEM_NORMAL) |
kind=wxITEM_NORMAL) |
41 |
parent.Append(helpString='About Netfraggle', |
parent.Append(helpString='About', |
42 |
id=wxID_FRAGGLEVIEWPORTMENU2ABOUT, item='About', |
id=wxID_FRAGGLEVIEWPORTMENU2ABOUT, item='About', |
43 |
kind=wxITEM_NORMAL) |
kind=wxITEM_NORMAL) |
44 |
|
|
45 |
EVT_MENU(self, wxID_FRAGGLEVIEWPORTMENU2CONT, self.OnMenu2items0Menu) |
EVT_MENU(self, wxID_FRAGGLEVIEWPORTMENU2CONT, self.OnMenu2items0Menu) |
46 |
EVT_MENU(self, wxID_FRAGGLEVIEWPORTMENU2ABOUT, self.OnMenu2items1Menu) |
EVT_MENU(self, wxID_FRAGGLEVIEWPORTMENU2ABOUT, self.OnMenu2items1Menu) |
47 |
|
|
48 |
def _init_coll_menuBar1_Menus(self, parent): |
def _init_coll_menuBar1_Menus(self, parent): |
49 |
# generated method, don't edit |
# generated method, don't edit |
50 |
|
|
51 |
parent.Append(menu=self.menu1, title='File') |
parent.Append(menu=self.menu1, title='&File') |
52 |
parent.Append(menu=self.menu2, title='Help') |
parent.Append(menu=self.menu2, title='&help') |
53 |
|
|
54 |
def _init_utils(self): |
def _init_utils(self): |
55 |
# generated method, don't edit |
# generated method, don't edit |
58 |
|
|
59 |
self.menu1 = wxMenu(title='') |
self.menu1 = wxMenu(title='') |
60 |
self._init_coll_menu1_Items(self.menu1) |
self._init_coll_menu1_Items(self.menu1) |
|
|
|
61 |
self.menu2 = wxMenu(title='') |
self.menu2 = wxMenu(title='') |
62 |
self._init_coll_menu2_Items(self.menu2) |
self._init_coll_menu2_Items(self.menu2) |
63 |
|
|
83 |
def __init__(self, parent): |
def __init__(self, parent): |
84 |
self._init_ctrls(parent) |
self._init_ctrls(parent) |
85 |
self.__init_preferences__() |
self.__init_preferences__() |
86 |
|
|
87 |
|
|
88 |
def showPrefs(self, event): |
def OnMenu1items0Menu(self, event): |
|
"""Show preferences screen""" |
|
89 |
try: |
try: |
90 |
self.dialogPrefs.ShowModal() |
self.dialogPrefs.ShowModal() |
91 |
finally: |
finally: |
92 |
self.dialogPrefs.Destroy() |
pass |
93 |
#event.Skip() |
event.Skip() |
|
|
|
|
def showHelp(self): |
|
|
"""Show help""" |
|
|
try: |
|
|
import webbrowser |
|
|
webbrowser.open("file://"+os.path.join(PEARSLOCATION, "docs/index.html"), 1) |
|
|
except: |
|
|
dlg = wxScrolledMessageDialog(parent=self, |
|
|
caption="Help", |
|
|
msg="""PEARS - alternative help (see the docs directory in your Pears folder for more elaborate information) |
|
|
|
|
|
Pears is a relatively simple three-pane news feed aggregator (RSS/RDF reader). |
|
|
|
|
|
The left pane contains the list of feeds. You can add feeds using the Feeds menu. Right-click on a feed to update, single-click to view cached contents. |
|
|
|
|
|
The right pane contains a list of the topics available in the feed. Single-click to open the contents of a topic in the viewer window at the bottom. Right-click to toggle read/unread status. |
|
|
|
|
|
Everything is cached in Python structures stored as plain text in your Home directory (in a subdirectory called '.pears'). Use the About screen to see exactly where that is on your system. |
|
|
""") |
|
|
dlg.ShowModal() |
|
|
dlg.Destroy() |
|
|
|
|
|
def showAbout(self): |
|
|
"""Show about screen""" |
|
|
dlg = AboutDialog(parent=self, id=-1, title="About Pears") |
|
|
dlg.ShowModal() |
|
|
dlg.Destroy() |
|
|
|
|
|
def doExit(self): |
|
|
"""Shut down the program""" |
|
|
self.Close(True) |
|
|
self.Destroy() |
|
|
|
|
|
def OnMenu1items0Menu(self, event): |
|
|
self.showPrefs(event) |
|
|
#event.Skip() |
|
94 |
|
|
95 |
def OnMenu1items1Menu(self, event): |
def OnMenu1items1Menu(self, event): |
96 |
self.doExit() |
self.Destroy() |
97 |
|
event.Skip() |
98 |
|
|
99 |
|
|
100 |
def OnMenu2items0Menu(self, event): |
def OnMenu2items0Menu(self, event): |
101 |
self.showHelp() |
try: |
102 |
|
self.dialogPrefs.ShowModal() |
103 |
|
finally: |
104 |
|
pass |
105 |
|
event.Skip() |
106 |
|
|
107 |
def OnMenu2items1Menu(self, event): |
def OnMenu2items1Menu(self, event): |
108 |
self.showAbout() |
#self.Destroy() |
109 |
|
#event.Skip() |
110 |
class fraggleMainWin(fraggleViewport): |
fraggleDialogs.AboutDialog() |
|
def _init_coll_menu1_Items(self, parent): |
|
|
|
|
|
if os.name == 'posix': |
|
|
super(fraggleMainWin, self)._init_coll_menu1_Items(parent) |
|
|
elif os.name == 'nt': |
|
|
parent.Append(wxID_FRAGGLEVIEWPORTMENU1FPREFS, 'Configure Netfraggle', "", wxITEM_NORMAL) |
|
|
parent.Append(wxID_FRAGGLEVIEWPORTMENU1ITEMS1, 'Exit Netfraggle', "", wxITEM_NORMAL) |
|
|
|
|
|
EVT_MENU(self, wxID_FRAGGLEVIEWPORTMENU1FPREFS, self.OnMenu1items0Menu) |
|
|
EVT_MENU(self, wxID_FRAGGLEVIEWPORTMENU1ITEMS1, self.OnMenu1items1Menu) |
|
|
|
|
|
def _init_coll_menu2_Items(self, parent): |
|
|
|
|
|
if os.name == 'posix': |
|
|
super(fraggleMainWin, self)._init_coll_menu2_Items(parent) |
|
|
elif os.name == 'nt': |
|
|
parent.Append(wxID_FRAGGLEVIEWPORTMENU2CONT, 'Contents', "", wxITEM_NORMAL) |
|
|
parent.Append(wxID_FRAGGLEVIEWPORTMENU2ABOUT, 'About', "", wxITEM_NORMAL) |
|
|
|
|
|
EVT_MENU(self, wxID_FRAGGLEVIEWPORTMENU2CONT, self.OnMenu2items0Menu) |
|
|
EVT_MENU(self, wxID_FRAGGLEVIEWPORTMENU2ABOUT, self.OnMenu2items1Menu) |
|
111 |
|
|