1 | ''' |
---|
2 | Created on Sep 17, 2018 |
---|
3 | Developed 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 | |
---|
11 | import wx |
---|
12 | import wx.richtext |
---|
13 | import wx.lib.hyperlink |
---|
14 | from wx.lib.expando import ExpandoTextCtrl |
---|
15 | |
---|
16 | from sas import get_local_config |
---|
17 | config = get_local_config() |
---|
18 | |
---|
19 | class 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 ############################################################ |
---|
66 | class 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 | |
---|
83 | if __name__ == "__main__": |
---|
84 | app = MyApp(0) |
---|
85 | app.MainLoop() |
---|