[f53cd30] | 1 | ''' |
---|
| 2 | Created on Feb 18, 2015 |
---|
| 3 | |
---|
| 4 | @author: jkrzywon |
---|
| 5 | ''' |
---|
| 6 | |
---|
| 7 | __id__ = "$Id: acknoweldgebox.py 2015-18-02 jkrzywon $" |
---|
| 8 | __revision__ = "$Revision: 1193 $" |
---|
| 9 | |
---|
[efe730d] | 10 | import os |
---|
| 11 | |
---|
[f53cd30] | 12 | import wx |
---|
[0ea31ca] | 13 | import wx.richtext |
---|
[f53cd30] | 14 | import wx.lib.hyperlink |
---|
[c8d22ec] | 15 | |
---|
[efe730d] | 16 | from sas.sasgui import get_local_config |
---|
| 17 | config = get_local_config() |
---|
[f53cd30] | 18 | |
---|
| 19 | class DialogAcknowledge(wx.Dialog): |
---|
| 20 | """ |
---|
| 21 | "Acknowledgement" Dialog Box |
---|
[c8d22ec] | 22 | |
---|
[f53cd30] | 23 | Shows the current method for acknowledging SasView in |
---|
| 24 | scholarly publications. |
---|
[c8d22ec] | 25 | |
---|
[f53cd30] | 26 | """ |
---|
[c8d22ec] | 27 | |
---|
[f53cd30] | 28 | def __init__(self, *args, **kwds): |
---|
[c8d22ec] | 29 | |
---|
[f53cd30] | 30 | kwds["style"] = wx.DEFAULT_DIALOG_STYLE |
---|
| 31 | wx.Dialog.__init__(self, *args, **kwds) |
---|
[c8d22ec] | 32 | |
---|
[f53cd30] | 33 | self.ack = wx.TextCtrl(self, style=wx.TE_LEFT|wx.TE_MULTILINE|wx.TE_BESTWRAP|wx.TE_READONLY|wx.TE_NO_VSCROLL) |
---|
| 34 | self.ack.SetValue(config._acknowledgement_publications) |
---|
[c8d22ec] | 35 | self.ack.SetMinSize((-1, 55)) |
---|
[f53cd30] | 36 | self.preamble = wx.StaticText(self, -1, config._acknowledgement_preamble) |
---|
[0ea31ca] | 37 | items = [config._acknowledgement_preamble_bullet1, |
---|
| 38 | config._acknowledgement_preamble_bullet2, |
---|
[c8d22ec] | 39 | config._acknowledgement_preamble_bullet3, |
---|
| 40 | config._acknowledgement_preamble_bullet4] |
---|
[0ea31ca] | 41 | self.list1 = wx.StaticText(self, -1, "\t(1) " + items[0]) |
---|
| 42 | self.list2 = wx.StaticText(self, -1, "\t(2) " + items[1]) |
---|
| 43 | self.list3 = wx.StaticText(self, -1, "\t(3) " + items[2]) |
---|
[c8d22ec] | 44 | self.list4 = wx.StaticText(self, -1, "\t(4) " + items[3]) |
---|
[f53cd30] | 45 | self.static_line = wx.StaticLine(self, 0) |
---|
| 46 | self.__set_properties() |
---|
| 47 | self.__do_layout() |
---|
[c8d22ec] | 48 | |
---|
[f53cd30] | 49 | def __set_properties(self): |
---|
| 50 | """ |
---|
[c8d22ec] | 51 | :TODO - add method documentation |
---|
[f53cd30] | 52 | """ |
---|
| 53 | # begin wxGlade: DialogAbout.__set_properties |
---|
[0ea31ca] | 54 | self.preamble.SetFont(wx.Font(11, wx.DEFAULT, wx.NORMAL, wx.NORMAL, 0, "")) |
---|
| 55 | self.preamble.SetFont(wx.Font(10, wx.DEFAULT, wx.NORMAL, wx.NORMAL, 0, "")) |
---|
[f53cd30] | 56 | self.SetTitle("Acknowledging SasView") |
---|
[0ea31ca] | 57 | self.SetSize((525, 225)) |
---|
[f53cd30] | 58 | # end wxGlade |
---|
| 59 | |
---|
| 60 | def __do_layout(self): |
---|
| 61 | """ |
---|
[c8d22ec] | 62 | :TODO - add method documentation |
---|
[f53cd30] | 63 | """ |
---|
| 64 | # begin wxGlade: DialogAbout.__do_layout |
---|
| 65 | sizer_main = wx.BoxSizer(wx.VERTICAL) |
---|
| 66 | sizer_titles = wx.BoxSizer(wx.VERTICAL) |
---|
[0ea31ca] | 67 | sizer_titles.Add(self.preamble, 0, wx.ALL|wx.EXPAND, 5) |
---|
| 68 | sizer_titles.Add(self.list1, 0, wx.ALL|wx.EXPAND, 5) |
---|
| 69 | sizer_titles.Add(self.list2, 0, wx.ALL|wx.EXPAND, 5) |
---|
| 70 | sizer_titles.Add(self.list3, 0, wx.ALL|wx.EXPAND, 5) |
---|
[c8d22ec] | 71 | sizer_titles.Add(self.list4, 0, wx.ALL|wx.EXPAND, 5) |
---|
[0ea31ca] | 72 | sizer_titles.Add(self.static_line, 0, wx.ALL|wx.EXPAND, 0) |
---|
| 73 | sizer_titles.Add(self.ack, 0, wx.ALL|wx.EXPAND, 5) |
---|
[f53cd30] | 74 | sizer_main.Add(sizer_titles, -1, wx.ALL|wx.EXPAND, 5) |
---|
| 75 | self.SetAutoLayout(True) |
---|
| 76 | self.SetSizer(sizer_main) |
---|
| 77 | self.Layout() |
---|
| 78 | self.Centre() |
---|
| 79 | # end wxGlade |
---|
[c8d22ec] | 80 | |
---|
[f53cd30] | 81 | |
---|
| 82 | ##### testing code ############################################################ |
---|
| 83 | class MyApp(wx.App): |
---|
| 84 | """ |
---|
[c8d22ec] | 85 | Class for running module as stand alone for testing |
---|
[f53cd30] | 86 | """ |
---|
| 87 | def OnInit(self): |
---|
| 88 | """ |
---|
[c8d22ec] | 89 | Defines an init when running as standalone |
---|
[f53cd30] | 90 | """ |
---|
| 91 | wx.InitAllImageHandlers() |
---|
| 92 | dialog = DialogAcknowledge(None, -1, "") |
---|
| 93 | self.SetTopWindow(dialog) |
---|
| 94 | dialog.ShowModal() |
---|
| 95 | dialog.Destroy() |
---|
| 96 | return 1 |
---|
| 97 | |
---|
| 98 | # end of class MyApp |
---|
| 99 | |
---|
| 100 | if __name__ == "__main__": |
---|
| 101 | app = MyApp(0) |
---|
[c8d22ec] | 102 | app.MainLoop() |
---|