source: sasview/src/sas/sasgui/guiframe/releasebox.py @ 5e88e27c

magnetic_scattrelease-4.2.2ticket-1009ticket-1094-headlessticket-1242-2d-resolutionticket-1243ticket-1249unittest-saveload
Last change on this file since 5e88e27c was 5e88e27c, checked in by smk78, 6 years ago

Create Release Notes option in Help Menu and popup box

  • Property mode set to 100644
File size: 2.4 KB
Line 
1'''
2Created on Sep 17, 2018
3Developed from acknowledgebox.py
4@author: sking
5'''
6
7__id__ = "$Id: releasebox.py 2018-17-09 sking $"
8# What is this and is it important?
9__revision__ = "$Revision: 1193 $"
10
11import wx
12import wx.richtext
13import wx.lib.hyperlink
14from wx.lib.expando import ExpandoTextCtrl
15
16from sas import get_local_config
17config = get_local_config()
18
19class DialogRelease(wx.Dialog):
20    """
21    "Release Notes" Dialog Box
22
23    Shows the current SasView Release Notes.
24    """
25
26    def __init__(self, *args, **kwds):
27
28        kwds["style"] = wx.DEFAULT_DIALOG_STYLE
29        wx.Dialog.__init__(self, *args, **kwds)
30
31        self.preamble = wx.StaticText(self, -1, config._release_preamble)
32        items = [config._release_location1,
33                 config._release_location2]
34        self.list1 = wx.StaticText(self, -1, "DEVELOPERS  " + items[0])
35        self.list2 = wx.StaticText(self, -1, "USERS              " + items[1])
36        self.static_line = wx.StaticLine(self, 0)
37        self.__set_properties()
38        self.__do_layout()
39
40    def __set_properties(self):
41        """
42        :TODO - add method documentation
43        """
44        self.preamble.SetFont(wx.Font(11, wx.DEFAULT, wx.NORMAL, wx.NORMAL, 0, ""))
45        self.preamble.SetFont(wx.Font(10, wx.DEFAULT, wx.NORMAL, wx.NORMAL, 0, ""))
46        self.SetTitle("SasView Release Notes & Known Issues")
47        self.SetClientSize((600, 320))
48
49    def __do_layout(self):
50        """
51        :TODO - add method documentation
52        """
53        sizer_main = wx.BoxSizer(wx.VERTICAL)
54        sizer_titles = wx.BoxSizer(wx.VERTICAL)
55        sizer_titles.Add(self.preamble, 0, wx.ALL|wx.EXPAND, 5)
56        sizer_titles.Add(self.list1, 0, wx.ALL|wx.EXPAND, 5)
57        sizer_titles.Add(self.list2, 0, wx.ALL|wx.EXPAND, 5)
58        sizer_main.Add(sizer_titles, -1, wx.ALL|wx.EXPAND, 5)
59        self.SetAutoLayout(True)
60        self.SetSizer(sizer_main)
61        self.Layout()
62        self.Centre()
63
64
65##### testing code ############################################################
66class MyApp(wx.App):
67    """
68    Class for running module as stand alone for testing
69    """
70    def OnInit(self):
71        """
72        Defines an init when running as standalone
73        """
74        wx.InitAllImageHandlers()
75        dialog = DialogRelease(None, -1, "")
76        self.SetTopWindow(dialog)
77        dialog.ShowModal()
78        dialog.Destroy()
79        return 1
80
81# end of class MyApp
82
83if __name__ == "__main__":
84    app = MyApp(0)
85    app.MainLoop()
Note: See TracBrowser for help on using the repository browser.