""" Welcome panel for SansView """ """ This software was developed by the University of Tennessee as part of the Distributed Data Analysis of Neutron Scattering Experiments (DANSE) project funded by the US National Science Foundation. See the license text in license.txt copyright 2009, University of Tennessee """ import wx import wx.lib.hyperlink import os.path import os import local_config as config class WelcomePanel(wx.Panel): """ Panel created like about box as a welcome page Shows product name, current version, authors, and link to the product page. """ ## Internal nickname for the window, used by the AUI manager window_name = "default" ## Name to appear on the window title bar window_caption = "Welcome panel" ## Flag to tell the AUI manager to put this panel in the center pane CENTER_PANE = True def __init__(self, *args, **kwds): kwds["style"] = wx.DEFAULT_DIALOG_STYLE wx.Panel.__init__(self, *args, **kwds) image = os.path.join("images","SVwelcome.png") self.bitmap_logo = wx.StaticBitmap(self, -1, wx.Bitmap(image)) self.label_copyright = wx.StaticText(self, -1, config._copyright) self.static_line_1 = wx.StaticLine(self, -1) self.label_acknowledgement = wx.StaticText(self, -1, config._acknowledgement) self.hyperlink_license = wx.StaticText(self, -1, "Comments? Bugs? Requests?") self.hyperlink_paper = wx.lib.hyperlink.HyperLinkCtrl(self, -1, "Send us a ticket",URL=config._license) verwords = config.__version__.split('.') version = '.'.join(verwords[:-1]) revision = verwords[-1] self.label_title = wx.StaticText(self, -1, config.__appname__+ " "+str(config.__version__))#(version)) self.label_build = wx.StaticText(self, -1, "Build: "+str(config.__version__)) sizer_main = wx.BoxSizer(wx.VERTICAL) sizer_header = wx.BoxSizer(wx.HORIZONTAL) sizer_build = wx.BoxSizer(wx.VERTICAL) sizer_header.Add(self.bitmap_logo, 0, wx.EXPAND|wx.LEFT, 5) sizer_build.Add(self.label_acknowledgement,0,wx.LEFT|wx.EXPAND|wx.ADJUST_MINSIZE, 15) sizer_build.Add((5,5)) sizer_build.Add(self.label_title ,0,wx.LEFT|wx.EXPAND|wx.ADJUST_MINSIZE, 15) sizer_build.Add(self.label_build,0,wx.LEFT|wx.EXPAND|wx.ADJUST_MINSIZE, 15) sizer_build.Add( self.label_copyright,0,wx.LEFT|wx.EXPAND|wx.ADJUST_MINSIZE, 15) sizer_build.Add((5,5)) sizer_build.Add( self.hyperlink_license,0,wx.LEFT|wx.EXPAND|wx.ADJUST_MINSIZE, 15) sizer_build.Add( self.hyperlink_paper,0,wx.LEFT|wx.EXPAND|wx.ADJUST_MINSIZE, 15) sizer_main.Add(sizer_header, 0, wx.TOP|wx.EXPAND, 3) sizer_main.Add(self.static_line_1, 0, wx.EXPAND, 0) sizer_main.Add(sizer_build,0, wx.BOTTOM|wx.EXPAND, 3) self.SetAutoLayout(True) self.SetSizer(sizer_main) self.Fit() class ViewApp(wx.App): def OnInit(self): self.frame = WelcomeFrame(None, -1, "Test App") self.frame.Show(True) return True class WelcomeFrame(wx.Frame): def __init__(self, parent, id, title): wx.Frame.__init__(self, parent, id, title, size=(570, 400)) WelcomePanel(self) self.Centre() self.Show(True) if __name__ == "__main__": app = ViewApp(0) app.MainLoop()