source: sasview/sansview/welcome_panel.py @ d40a9cd

ESS_GUIESS_GUI_DocsESS_GUI_batch_fittingESS_GUI_bumps_abstractionESS_GUI_iss1116ESS_GUI_iss879ESS_GUI_iss959ESS_GUI_openclESS_GUI_orderingESS_GUI_sync_sascalccostrafo411magnetic_scattrelease-4.1.1release-4.1.2release-4.2.2release_4.0.1ticket-1009ticket-1094-headlessticket-1242-2d-resolutionticket-1243ticket-1249ticket885unittest-saveload
Last change on this file since d40a9cd was e2da832, checked in by Mathieu Doucet <doucetm@…>, 15 years ago

sansview: modified the application to pass a welcome panel class to the gui manager instead of making it part of the fit perspective.

  • Property mode set to 100644
File size: 3.5 KB
Line 
1"""
2    Welcome panel for SansView
3"""
4"""
5This software was developed by the University of Tennessee as part of the
6Distributed Data Analysis of Neutron Scattering Experiments (DANSE)
7project funded by the US National Science Foundation.
8
9See the license text in license.txt
10
11copyright 2009, University of Tennessee
12"""
13
14import wx
15import wx.lib.hyperlink
16import os.path
17import os
18
19import local_config as config
20
21class WelcomePanel(wx.Panel):
22    """
23        Panel created like about box  as a welcome page
24        Shows product name, current version, authors, and link to the product page.
25    """
26    ## Internal nickname for the window, used by the AUI manager
27    window_name = "default"
28    ## Name to appear on the window title bar
29    window_caption = "Welcome panel"
30    ## Flag to tell the AUI manager to put this panel in the center pane
31    CENTER_PANE = True
32   
33    def __init__(self, *args, **kwds):
34
35        kwds["style"] = wx.DEFAULT_DIALOG_STYLE
36       
37        wx.Panel.__init__(self, *args, **kwds)
38       
39        image = "images\SVwelcome.png"
40       
41        self.bitmap_logo = wx.StaticBitmap(self, -1, wx.Bitmap(image))
42       
43        self.label_copyright = wx.StaticText(self, -1, config._copyright)
44        self.static_line_1 = wx.StaticLine(self, -1)
45        self.label_acknowledgement = wx.StaticText(self, -1, config._acknowledgement)
46       
47        self.hyperlink_license = wx.StaticText(self, -1, "Comments? Bugs? Requests?")
48        self.hyperlink_paper = wx.lib.hyperlink.HyperLinkCtrl(self, -1,
49                                         "Send us a ticket",URL=config._license)
50       
51        verwords = config.__version__.split('.')
52        version = '.'.join(verwords[:-1])
53        revision = verwords[-1]
54        self.label_title = wx.StaticText(self, -1, config.__appname__+ " "+str(config.__version__))#(version))
55        self.label_build = wx.StaticText(self, -1, "Build: "+str(config.__version__))
56     
57        sizer_main = wx.BoxSizer(wx.VERTICAL)
58        sizer_header = wx.BoxSizer(wx.HORIZONTAL)
59        sizer_build = wx.BoxSizer(wx.VERTICAL)
60       
61        sizer_header.Add(self.bitmap_logo, 0, wx.EXPAND|wx.LEFT, 5)
62       
63        sizer_build.Add(self.label_acknowledgement,0,wx.LEFT|wx.EXPAND|wx.ADJUST_MINSIZE, 15) 
64        sizer_build.Add((5,5))
65        sizer_build.Add(self.label_title ,0,wx.LEFT|wx.EXPAND|wx.ADJUST_MINSIZE, 15) 
66        sizer_build.Add(self.label_build,0,wx.LEFT|wx.EXPAND|wx.ADJUST_MINSIZE, 15) 
67        sizer_build.Add( self.label_copyright,0,wx.LEFT|wx.EXPAND|wx.ADJUST_MINSIZE, 15) 
68        sizer_build.Add((5,5))
69        sizer_build.Add( self.hyperlink_license,0,wx.LEFT|wx.EXPAND|wx.ADJUST_MINSIZE, 15) 
70        sizer_build.Add( self.hyperlink_paper,0,wx.LEFT|wx.EXPAND|wx.ADJUST_MINSIZE, 15) 
71       
72        sizer_main.Add(sizer_header, 0, wx.TOP|wx.EXPAND, 3)
73        sizer_main.Add(self.static_line_1, 0, wx.EXPAND, 0)
74        sizer_main.Add(sizer_build,0, wx.BOTTOM|wx.EXPAND, 3)
75       
76        self.SetAutoLayout(True)
77        self.SetSizer(sizer_main)
78        self.Fit()
79
80
81class ViewApp(wx.App):
82    def OnInit(self):
83        self.frame = WelcomeFrame(None, -1, "Test App")   
84        self.frame.Show(True)
85        return True
86
87class WelcomeFrame(wx.Frame):
88    def __init__(self, parent, id, title):
89        wx.Frame.__init__(self, parent, id, title, size=(570, 400))
90        WelcomePanel(self)
91        self.Centre()
92        self.Show(True)
93   
94if __name__ == "__main__": 
95    app = ViewApp(0)
96    app.MainLoop()
Note: See TracBrowser for help on using the repository browser.