Changeset 7425bcf in sasview
- Timestamp:
- Mar 3, 2015 11:48:01 AM (10 years ago)
- Branches:
- master, ESS_GUI, ESS_GUI_Docs, ESS_GUI_batch_fitting, ESS_GUI_bumps_abstraction, ESS_GUI_iss1116, ESS_GUI_iss879, ESS_GUI_iss959, ESS_GUI_opencl, ESS_GUI_ordering, ESS_GUI_sync_sascalc, costrafo411, magnetic_scatt, release-4.1.1, release-4.1.2, release-4.2.2, release_4.0.1, ticket-1009, ticket-1094-headless, ticket-1242-2d-resolution, ticket-1243, ticket-1249, ticket885, unittest-saveload
- Children:
- aa720c4
- Parents:
- 3c3a440
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sasview/welcome_panel.py
r3a39c2e r7425bcf 1 1 """ 2 2 Welcome page 3 4 3 """ 5 4 import wx … … 11 10 from wx.lib.scrolledpanel import ScrolledPanel 12 11 from sas.guiframe.panel_base import PanelBase 13 #Font size width 14 if sys.platform.count("win32") >0:12 #Font size width 13 if sys.platform.count("win32") > 0: 15 14 FONT_VARIANT = 0 16 15 else: 17 FONT_VARIANT = 1 18 16 FONT_VARIANT = 1 17 19 18 class WelcomePanel(wx.aui.AuiNotebook, PanelBase): 20 19 """ 21 20 Panel created like about box as a welcome page 22 Shows product name, current version, authors, and link to the product page. 21 Shows product name, current version, authors, 22 and link to the product page. 23 23 """ 24 24 ## Internal nickname for the window, used by the AUI manager … … 28 28 ## Flag to tell the AUI manager to put this panel in the center pane 29 29 CENTER_PANE = True 30 31 30 31 32 32 def __init__(self, parent, *args, **kwds): 33 33 kwds["style"] = wx.aui.AUI_NB_DEFAULT_STYLE 34 34 35 35 wx.aui.AuiNotebook.__init__(self, parent, *args, **kwds) 36 36 PanelBase.__init__(self) … … 38 38 self.parent = parent.parent 39 39 self.frame = None 40 40 self.manager = None 41 41 42 welcome_page = WelcomePage(self) 42 43 self.AddPage(welcome_page, "Welcome") 43 44 44 45 self.Bind(wx.aui.EVT_AUINOTEBOOK_PAGE_CLOSE, self.on_close_page) 45 46 self.Center() 46 47 47 48 def set_manager(self, manager): 48 49 """ … … 50 51 """ 51 52 self.manager = manager 52 53 53 54 def on_close_page(self, event): 54 55 """ 55 56 Called when the welcome panel is closed 56 57 """ 57 58 if self.parent is not None: 58 59 self.parent.on_close_welcome_panel() 59 event.Veto() 60 61 def set_data(self, list=None):60 event.Veto() 61 62 def set_data(self, data=None): 62 63 """ 63 64 """ 64 65 pass 65 66 66 67 def set_frame(self, frame): 67 68 """ … … 70 71 if frame != None: 71 72 self.frame.Bind(wx.EVT_CLOSE, self.on_close_page) 72 73 73 74 def get_frame(self): 74 75 """ 75 76 """ 76 77 return self.frame 77 78 78 79 79 80 class WelcomePage(ScrolledPanel): 80 81 """ 81 82 Panel created like about box as a welcome page 82 Shows product name, current version, authors, and link to the product page. 83 Shows product name, current version, authors, 84 and link to the product page. 83 85 """ 84 86 ## Internal nickname for the window, used by the AUI manager … … 88 90 ## Flag to tell the AUI manager to put this panel in the center pane 89 91 CENTER_PANE = True 90 91 92 93 92 94 def __init__(self, parent, *args, **kwds): 93 import local_config94 95 kwds["style"] = wx.DEFAULT_DIALOG_STYLE 95 96 96 97 ScrolledPanel.__init__(self, parent, **kwds) 97 98 self.SetupScrolling() 98 image = os.path.join( local_config._welcome_image)99 self.SetWindowVariant(variant =FONT_VARIANT)99 image = os.path.join(config._welcome_image) 100 self.SetWindowVariant(variant=FONT_VARIANT) 100 101 self.bitmap_logo = wx.StaticBitmap(self, -1, wx.Bitmap(image)) 101 102 102 103 self.label_copyright = wx.StaticText(self, -1, config._copyright) 103 104 self.static_line_1 = wx.StaticLine(self, -1) 104 self.label_acknowledgement = wx.StaticText(self, -1, config._acknowledgement) 105 106 self.hyperlink_license = wx.StaticText(self, -1, 105 self.label_acknowledgement = wx.StaticText(self, -1, 106 config._acknowledgement) 107 108 self.hyperlink_license = wx.StaticText(self, -1, 107 109 "Comments? Bugs? Requests?") 108 110 send_ticket = "Send us a ticket at: " 109 111 send_ticket += "help@sasview.org" 110 self.hyperlink_paper = wx.lib.hyperlink.HyperLinkCtrl(self, -1, 111 send_ticket, URL=config._license) 112 113 self.label_title = wx.StaticText(self, -1, 114 config.__appname__+ " "+str(config.__version__)) 112 self.hyperlink_paper = \ 113 wx.lib.hyperlink.HyperLinkCtrl(self, -1, 114 send_ticket, URL=config._license) 115 116 self.label_title = \ 117 wx.StaticText(self, -1, 118 config.__appname__ + " " + str(config.__version__)) 115 119 try: 116 120 build_num = str(config.__build__) … … 118 122 build_num = str(config.__version__) 119 123 self.label_build = wx.StaticText(self, -1, "Build: " + build_num) 120 124 121 125 sizer_main = wx.BoxSizer(wx.VERTICAL) 122 126 sizer_header = wx.BoxSizer(wx.HORIZONTAL) 123 127 sizer_build = wx.BoxSizer(wx.VERTICAL) 124 125 sizer_header.Add(self.bitmap_logo, 0, wx.EXPAND |wx.LEFT, 5)126 128 129 sizer_header.Add(self.bitmap_logo, 0, wx.EXPAND | wx.LEFT, 5) 130 127 131 sizer_build.Add(self.label_acknowledgement, 0, 128 wx.LEFT |wx.EXPAND|wx.ADJUST_MINSIZE, 15)129 sizer_build.Add((5, 5))132 wx.LEFT | wx.EXPAND | wx.ADJUST_MINSIZE, 15) 133 sizer_build.Add((5, 5)) 130 134 sizer_build.Add(self.label_title, 0, 131 wx.LEFT |wx.EXPAND|wx.ADJUST_MINSIZE, 15)132 sizer_build.Add(self.label_build, 0, 133 wx.LEFT |wx.EXPAND|wx.ADJUST_MINSIZE, 15)135 wx.LEFT | wx.EXPAND | wx.ADJUST_MINSIZE, 15) 136 sizer_build.Add(self.label_build, 0, 137 wx.LEFT | wx.EXPAND | wx.ADJUST_MINSIZE, 15) 134 138 sizer_build.Add(self.label_copyright, 0, 135 wx.LEFT |wx.EXPAND|wx.ADJUST_MINSIZE, 15)139 wx.LEFT | wx.EXPAND | wx.ADJUST_MINSIZE, 15) 136 140 sizer_build.Add((5, 5)) 137 141 sizer_build.Add(self.hyperlink_license, 0, 138 wx.LEFT |wx.EXPAND|wx.ADJUST_MINSIZE, 15)142 wx.LEFT | wx.EXPAND | wx.ADJUST_MINSIZE, 15) 139 143 sizer_build.Add(self.hyperlink_paper, 0, 140 wx.LEFT |wx.EXPAND|wx.ADJUST_MINSIZE, 15)141 142 sizer_main.Add(sizer_header, 0, wx.TOP |wx.EXPAND, 3)144 wx.LEFT | wx.EXPAND | wx.ADJUST_MINSIZE, 15) 145 146 sizer_main.Add(sizer_header, 0, wx.TOP | wx.EXPAND, 3) 143 147 sizer_main.Add(self.static_line_1, 0, wx.EXPAND, 0) 144 sizer_main.Add(sizer_build, 0 , wx.BOTTOM|wx.EXPAND, 3)145 148 sizer_main.Add(sizer_build, 0, wx.BOTTOM | wx.EXPAND, 3) 149 146 150 self.SetAutoLayout(True) 147 151 self.SetSizer(sizer_main) 148 152 self.Fit() 149 150 def set_data(self, list=None):153 154 def set_data(self, data=None): 151 155 """ 152 156 """ … … 158 162 """ 159 163 def OnInit(self): 160 self.frame = WelcomeFrame(None, -1, "Test App") 164 self.frame = WelcomeFrame(None, -1, "Test App") 161 165 self.frame.Show(True) 162 166 return True … … 171 175 self.Centre() 172 176 self.Show(True) 173 174 if __name__ == "__main__": 177 178 if __name__ == "__main__": 175 179 app = ViewApp(0) 176 180 app.MainLoop()
Note: See TracChangeset
for help on using the changeset viewer.