source: sasview/sansview/welcome_panel.py @ f1aa385

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 f1aa385 was f1aa385, checked in by Jae Cho <jhjcho@…>, 15 years ago

mac font sized changed for these panels: note:)textctrl still to go.

  • Property mode set to 100644
File size: 3.7 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, sys
18import local_config as config
19
20#Font size width
21if sys.platform.count("win32")>0:
22    FONT_VARIANT = 0
23else:
24    FONT_VARIANT = 1 
25   
26class WelcomePanel(wx.Panel):
27    """
28        Panel created like about box  as a welcome page
29        Shows product name, current version, authors, and link to the product page.
30    """
31    ## Internal nickname for the window, used by the AUI manager
32    window_name = "default"
33    ## Name to appear on the window title bar
34    window_caption = "Welcome panel"
35    ## Flag to tell the AUI manager to put this panel in the center pane
36    CENTER_PANE = True
37   
38   
39    def __init__(self, *args, **kwds):
40
41        kwds["style"] = wx.DEFAULT_DIALOG_STYLE
42       
43        wx.Panel.__init__(self, *args, **kwds)
44       
45        image = os.path.join("images","SVwelcome.png")
46       
47        self.SetWindowVariant(variant = FONT_VARIANT)
48        self.bitmap_logo = wx.StaticBitmap(self, -1, wx.Bitmap(image))
49       
50        self.label_copyright = wx.StaticText(self, -1, config._copyright)
51        self.static_line_1 = wx.StaticLine(self, -1)
52        self.label_acknowledgement = wx.StaticText(self, -1, config._acknowledgement)
53       
54        self.hyperlink_license = wx.StaticText(self, -1, "Comments? Bugs? Requests?")
55        self.hyperlink_paper = wx.lib.hyperlink.HyperLinkCtrl(self, -1,
56                                         "Send us a ticket",URL=config._license)
57       
58        verwords = config.__version__.split('.')
59        version = '.'.join(verwords[:-1])
60        revision = verwords[-1]
61        self.label_title = wx.StaticText(self, -1, config.__appname__+ " "+str(config.__version__))#(version))
62        self.label_build = wx.StaticText(self, -1, "Build: "+str(config.__version__))
63     
64        sizer_main = wx.BoxSizer(wx.VERTICAL)
65        sizer_header = wx.BoxSizer(wx.HORIZONTAL)
66        sizer_build = wx.BoxSizer(wx.VERTICAL)
67       
68        sizer_header.Add(self.bitmap_logo, 0, wx.EXPAND|wx.LEFT, 5)
69       
70        sizer_build.Add(self.label_acknowledgement,0,wx.LEFT|wx.EXPAND|wx.ADJUST_MINSIZE, 15) 
71        sizer_build.Add((5,5))
72        sizer_build.Add(self.label_title ,0,wx.LEFT|wx.EXPAND|wx.ADJUST_MINSIZE, 15) 
73        sizer_build.Add(self.label_build,0,wx.LEFT|wx.EXPAND|wx.ADJUST_MINSIZE, 15) 
74        sizer_build.Add( self.label_copyright,0,wx.LEFT|wx.EXPAND|wx.ADJUST_MINSIZE, 15) 
75        sizer_build.Add((5,5))
76        sizer_build.Add( self.hyperlink_license,0,wx.LEFT|wx.EXPAND|wx.ADJUST_MINSIZE, 15) 
77        sizer_build.Add( self.hyperlink_paper,0,wx.LEFT|wx.EXPAND|wx.ADJUST_MINSIZE, 15) 
78       
79        sizer_main.Add(sizer_header, 0, wx.TOP|wx.EXPAND, 3)
80        sizer_main.Add(self.static_line_1, 0, wx.EXPAND, 0)
81        sizer_main.Add(sizer_build,0, wx.BOTTOM|wx.EXPAND, 3)
82       
83        self.SetAutoLayout(True)
84        self.SetSizer(sizer_main)
85        self.Fit()
86
87
88class ViewApp(wx.App):
89    def OnInit(self):
90        self.frame = WelcomeFrame(None, -1, "Test App")   
91        self.frame.Show(True)
92        return True
93
94class WelcomeFrame(wx.Frame):
95    def __init__(self, parent, id, title):
96        wx.Frame.__init__(self, parent, id, title, size=(570, 400))
97        WelcomePanel(self)
98        self.Centre()
99        self.Show(True)
100   
101if __name__ == "__main__": 
102    app = ViewApp(0)
103    app.MainLoop()
Note: See TracBrowser for help on using the repository browser.