source: sasview/src/sas/guiframe/acknowledgebox.py @ 491e916

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 491e916 was f53cd30, checked in by krzywon, 9 years ago

Created and implemented an acknowledgement window that can be accessed
under the Help menu.

  • Property mode set to 100644
File size: 2.7 KB
Line 
1'''
2Created on Feb 18, 2015
3
4@author: jkrzywon
5'''
6
7__id__ = "$Id: acknoweldgebox.py 2015-18-02 jkrzywon $"
8__revision__ = "$Revision: 1193 $"
9
10import wx
11import wx.lib.hyperlink
12import random
13import os.path
14import os
15try:
16    # Try to find a local config
17    import imp
18    path = os.getcwd()
19    if(os.path.isfile("%s/%s.py" % (path, 'local_config'))) or \
20      (os.path.isfile("%s/%s.pyc" % (path, 'local_config'))):
21        fObj, path, descr = imp.find_module('local_config', [path])
22        config = imp.load_module('local_config', fObj, path, descr) 
23    else:
24        # Try simply importing local_config
25        import local_config as config
26except:
27    # Didn't find local config, load the default
28    import config
29   
30
31class DialogAcknowledge(wx.Dialog):
32    """
33    "Acknowledgement" Dialog Box
34   
35    Shows the current method for acknowledging SasView in
36    scholarly publications.
37   
38    """
39   
40    def __init__(self, *args, **kwds):
41       
42        kwds["style"] = wx.DEFAULT_DIALOG_STYLE
43        wx.Dialog.__init__(self, *args, **kwds)
44       
45        self.ack = wx.TextCtrl(self, style=wx.TE_LEFT|wx.TE_MULTILINE|wx.TE_BESTWRAP|wx.TE_READONLY|wx.TE_NO_VSCROLL)
46        self.ack.SetBackgroundColour(wx.NullColour)
47        self.ack.SetValue(config._acknowledgement_publications)
48        self.ack.SetMinSize((-1,60))
49        self.preamble = wx.StaticText(self, -1, config._acknowledgement_preamble)
50        self.static_line = wx.StaticLine(self, 0)
51       
52        self.__set_properties()
53        self.__do_layout()
54       
55    def __set_properties(self):
56        """
57        """
58        # begin wxGlade: DialogAbout.__set_properties
59        self.SetTitle("Acknowledging SasView")
60        self.SetSize((500, 225))
61        # end wxGlade
62
63    def __do_layout(self):
64        """
65        """
66        # begin wxGlade: DialogAbout.__do_layout
67        sizer_main = wx.BoxSizer(wx.VERTICAL)
68        sizer_titles = wx.BoxSizer(wx.VERTICAL)
69        sizer_titles.Add(self.preamble, 0, wx.ALL|wx.EXPAND, 0)
70        sizer_titles.Add(self.static_line, 0, wx.EXPAND, 0)
71        sizer_titles.Add(self.ack, 0, wx.ALL|wx.EXPAND, 0)
72        sizer_main.Add(sizer_titles, -1, wx.ALL|wx.EXPAND, 5)
73        self.SetAutoLayout(True)
74        self.SetSizer(sizer_main)
75        self.Layout()
76        self.Centre()
77        # end wxGlade
78       
79
80##### testing code ############################################################
81class MyApp(wx.App):
82    """
83    """
84    def OnInit(self):
85        """
86        """
87        wx.InitAllImageHandlers()
88        dialog = DialogAcknowledge(None, -1, "")
89        self.SetTopWindow(dialog)
90        dialog.ShowModal()
91        dialog.Destroy()
92        return 1
93
94# end of class MyApp
95
96if __name__ == "__main__":
97    app = MyApp(0)
98    app.MainLoop()
Note: See TracBrowser for help on using the repository browser.