/[cvs]/nfo/projects/netfraggle/bin/fraggleViewport.py
ViewVC logotype

Diff of /nfo/projects/netfraggle/bin/fraggleViewport.py

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.6 by xabbu, Wed Aug 25 21:40:54 2004 UTC revision 1.7 by joko, Wed Aug 25 22:53:41 2004 UTC
# Line 1  Line 1 
1  #Boa:MDIParent:fraggleViewport  4#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 *
9    
10  def create(parent):  def create(parent):
11      return fraggleViewport(parent)      return fraggleMainWin(parent)
12    
13  [wxID_FRAGGLEVIEWPORT] = map(lambda _init_ctrls: wxNewId(), range(1))  [wxID_FRAGGLEVIEWPORT] = map(lambda _init_ctrls: wxNewId(), range(1))
14    
15  [wxID_FRAGGLEVIEWPORTMENU1FPREFS, wxID_FRAGGLEVIEWPORTMENU1ITEMS1,  [wxID_FRAGGLEVIEWPORTMENU1FPREFS, wxID_FRAGGLEVIEWPORTMENU1ITEMS1,
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,
19    ] = map(lambda _init_coll_menu2_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):
23          # generated method, don't edit          # generated method, don't edit
# Line 28  class fraggleViewport(wxMDIParentFrame): Line 32  class fraggleViewport(wxMDIParentFrame):
32          EVT_MENU(self, wxID_FRAGGLEVIEWPORTMENU1FPREFS, self.OnMenu1items0Menu)          EVT_MENU(self, wxID_FRAGGLEVIEWPORTMENU1FPREFS, self.OnMenu1items0Menu)
33          EVT_MENU(self, wxID_FRAGGLEVIEWPORTMENU1ITEMS1, self.OnMenu1items1Menu)          EVT_MENU(self, wxID_FRAGGLEVIEWPORTMENU1ITEMS1, self.OnMenu1items1Menu)
34    
35        def _init_coll_menu2_Items(self, parent):
36            # generated method, don't edit
37    
38            parent.Append(helpString='Documentation',
39                  id=wxID_FRAGGLEVIEWPORTMENU2CONT, item='Contents',
40                  kind=wxITEM_NORMAL)
41            parent.Append(helpString='About Netfraggle',
42                  id=wxID_FRAGGLEVIEWPORTMENU2ABOUT, item='About',
43                  kind=wxITEM_NORMAL)
44                
45            EVT_MENU(self, wxID_FRAGGLEVIEWPORTMENU2CONT, self.OnMenu2items0Menu)
46            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')
53    
54      def _init_utils(self):      def _init_utils(self):
55          # generated method, don't edit          # generated method, don't edit
# Line 41  class fraggleViewport(wxMDIParentFrame): Line 59  class fraggleViewport(wxMDIParentFrame):
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    
62            self.menu2 = wxMenu(title='')
63            self._init_coll_menu2_Items(self.menu2)
64    
65          self._init_coll_menuBar1_Menus(self.menuBar1)          self._init_coll_menuBar1_Menus(self.menuBar1)
66    
67      def _init_ctrls(self, prnt):      def _init_ctrls(self, prnt):
# Line 63  class fraggleViewport(wxMDIParentFrame): Line 84  class fraggleViewport(wxMDIParentFrame):
84      def __init__(self, parent):      def __init__(self, parent):
85          self._init_ctrls(parent)          self._init_ctrls(parent)
86          self.__init_preferences__()          self.__init_preferences__()
           
87    
88      def OnMenu1items0Menu(self, event):      def showPrefs(self, event):
89            """Show preferences screen"""
90          try:          try:
91              self.dialogPrefs.ShowModal()              self.dialogPrefs.ShowModal()
92          finally:          finally:
93              pass              self.dialogPrefs.Destroy()
94          event.Skip()          #event.Skip()
95            
96        def showHelp(self):
97            """Show help"""
98            try:
99                import webbrowser
100                webbrowser.open("file://"+os.path.join(PEARSLOCATION, "docs/index.html"), 1)
101            except:
102                dlg = wxScrolledMessageDialog(parent=self,
103                        caption="Help",
104                        msg="""PEARS - alternative help (see the docs directory in your Pears folder for more elaborate information)
105                        
106        Pears is a relatively simple three-pane news feed aggregator (RSS/RDF reader).
107            
108        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.
109            
110        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.
111            
112        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.
113        """)
114                dlg.ShowModal()
115                dlg.Destroy()
116            
117        def showAbout(self):
118            """Show about screen"""
119            dlg = AboutDialog(parent=self, id=-1, title="About Pears")
120            dlg.ShowModal()
121            dlg.Destroy()
122            
123        def doExit(self):
124            """Shut down the program"""
125            self.Close(True)
126            self.Destroy()
127            
128        def OnMenu1items0Menu(self, event):
129            self.showPrefs(event)
130            #event.Skip()
131    
132      def OnMenu1items1Menu(self, event):      def OnMenu1items1Menu(self, event):
133          self.Destroy()          self.doExit()
134          event.Skip()  
135        def OnMenu2items0Menu(self, event):
136            self.showHelp()
137    
138        def OnMenu2items1Menu(self, event):
139            self.showAbout()
140    
141    class fraggleMainWin(fraggleViewport):
142        def _init_coll_menu1_Items(self, parent):
143    
144            if os.name == 'posix':
145                super(fraggleMainWin, self)._init_coll_menu1_Items(parent)
146            elif os.name == 'nt':
147                parent.Append(wxID_FRAGGLEVIEWPORTMENU1FPREFS, 'Configure Netfraggle', "", wxITEM_NORMAL)
148                parent.Append(wxID_FRAGGLEVIEWPORTMENU1ITEMS1, 'Exit Netfraggle', "", wxITEM_NORMAL)
149    
150            EVT_MENU(self, wxID_FRAGGLEVIEWPORTMENU1FPREFS, self.OnMenu1items0Menu)
151            EVT_MENU(self, wxID_FRAGGLEVIEWPORTMENU1ITEMS1, self.OnMenu1items1Menu)
152    
153        def _init_coll_menu2_Items(self, parent):
154    
155            if os.name == 'posix':
156                super(fraggleMainWin, self)._init_coll_menu2_Items(parent)
157            elif os.name == 'nt':
158                parent.Append(wxID_FRAGGLEVIEWPORTMENU2CONT, 'Contents', "", wxITEM_NORMAL)
159                parent.Append(wxID_FRAGGLEVIEWPORTMENU2ABOUT, 'About', "", wxITEM_NORMAL)
160                
161            EVT_MENU(self, wxID_FRAGGLEVIEWPORTMENU2CONT, self.OnMenu2items0Menu)
162            EVT_MENU(self, wxID_FRAGGLEVIEWPORTMENU2ABOUT, self.OnMenu2items1Menu)
163    

Legend:
Removed from v.1.6  
changed lines
  Added in v.1.7

MailToCvsAdmin">MailToCvsAdmin
ViewVC Help
Powered by ViewVC 1.1.26 RSS 2.0 feed