Changeset 7a955a9 in sasview
- Timestamp:
- Apr 28, 2011 4:19:20 PM (14 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:
- cf14ceb
- Parents:
- 5e8e615
- Location:
- guiframe
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
guiframe/config.py
rea4dfe0 r7a955a9 59 59 SPLASH_SCREEN_WIDTH = 500 60 60 SPLASH_SCREEN_HEIGHT = 300 61 SS_MAX_DISPLAY_TIME = 3000 #3sec61 SS_MAX_DISPLAY_TIME = 4000 #4 sec 62 62 PLOPANEL_WIDTH = 350 63 63 PLOPANEL_HEIGTH = 350 -
guiframe/gui_manager.py
r5e8e615 r7a955a9 264 264 self.post_init() 265 265 #self.show_welcome_panel(None) 266 self.Show(True)266 #self.Show(True) 267 267 #self._check_update(None) 268 268 … … 2185 2185 gui_style = DEFAULT_STYLE, 2186 2186 size=size) 2187 self.frame.Hide() 2187 2188 self.s_screen = None 2188 2189 try: … … 2203 2204 self.frame.Show() 2204 2205 except: 2205 msg = "Cannot display splash screen\n" 2206 msg += str (sys.exc_value) 2207 logging.error(msg) 2208 self.frame.Show() 2206 if self.s_screen is not None: 2207 self.s_screen.Close() 2208 msg = "Cannot display splash screen\n" 2209 msg += str (sys.exc_value) 2210 logging.error(msg) 2211 self.frame.Show() 2209 2212 2210 2213 if hasattr(self.frame, 'special'): … … 2255 2258 raise 2256 2259 self.frame.build_gui() 2257 if self.s_screen is not None and self.s_screen.IsShown():2258 self.s_screen.Close()2260 #if self.s_screen is not None and self.s_screen.IsShown(): 2261 # self.s_screen.Close() 2259 2262 2260 2263 def set_welcome_panel(self, panel_class): … … 2335 2338 parent=parent, 2336 2339 id=wx.ID_ANY) 2337 2340 from gui_statusbar import SPageStatusbar 2341 statusBar = SPageStatusbar(s_screen) 2342 s_screen.SetStatusBar(statusBar) 2338 2343 s_screen.Bind(wx.EVT_CLOSE, self.on_close_splash_screen) 2339 2344 s_screen.Show() -
guiframe/gui_statusbar.py
r783940c r7a955a9 295 295 296 296 297 class SPageStatusbar(wxStatusB): 298 def __init__(self, parent, timeout=None, *args, **kwds): 299 wxStatusB.__init__(self, parent, *args, **kwds) 300 self.SetFieldsCount(1) 301 self.timeout = timeout 302 self.gauge = wx.Gauge(self,style=wx.GA_HORIZONTAL, size=parent.GetSize()) 303 rect = self.GetFieldRect(0) 304 self.gauge.SetPosition((rect.x , rect.y )) 305 if self.timeout is not None: 306 self.gauge.SetRange(int(self.timeout)) 307 self.timer = wx.Timer(self, -1) 308 self.Bind(wx.EVT_TIMER, self._on_time, self.timer) 309 self.timer.Start(1) 310 self.pos = 0 311 312 def _on_time(self, evt): 313 """ 314 Update the progress bar while the timer is running 315 316 :param evt: wx.EVT_TIMER 317 318 """ 319 # Check stop flag that can be set from non main thread 320 if self.timeout is None and self.timer.IsRunning(): 321 self.gauge.Pulse() 322 323 297 324 if __name__ == "__main__": 298 325 app = wx.PySimpleApp() 299 326 frame = wx.Frame(None, wx.ID_ANY, 'test frame') 300 statusBar = StatusBar(frame, wx.ID_ANY) 327 #statusBar = StatusBar(frame, wx.ID_ANY) 328 statusBar = SPageStatusbar(frame) 301 329 frame.SetStatusBar(statusBar) 302 330 frame.Show(True) 303 event = MessageEvent()304 event.type = "progress"305 event.status = "statusbar...."306 event.info = "error"307 statusBar.set_status(event=event)331 #event = MessageEvent() 332 #event.type = "progress" 333 #event.status = "statusbar...." 334 #event.info = "error" 335 #statusBar.set_status(event=event) 308 336 app.MainLoop() 309 337
Note: See TracChangeset
for help on using the changeset viewer.