Changeset caf273b in sasview for src/sans/guiframe/gui_statusbar.py
- Timestamp:
- Apr 3, 2014 7:03:28 AM (11 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:
- eea3ffa
- Parents:
- ea67541
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sans/guiframe/gui_statusbar.py
r5777106 rcaf273b 4 4 from wx.lib import newevent 5 5 import wx.richtext 6 import time7 6 from sans.guiframe.gui_style import GUIFRAME_ICON 8 #numner of fields of the status bar 7 8 # Number of fields on the status bar 9 9 NB_FIELDS = 4 10 10 #position of the status bar's fields … … 14 14 CONSOLE_POSITION = 3 15 15 BUTTON_SIZE = 40 16 16 STATUS_BAR_ICON_SIZE = 12 17 17 CONSOLE_WIDTH = 500 18 18 CONSOLE_HEIGHT = 300 … … 49 49 color = (0, 0, 0) #black 50 50 icon_bmp = wx.ArtProvider.GetBitmap(wx.ART_INFORMATION, 51 51 wx.ART_TOOLBAR) 52 52 if hasattr(event, "info"): 53 53 icon_type = event.info.lower() … … 55 55 color = (0, 0, 255) # blue 56 56 icon_bmp = wx.ArtProvider.GetBitmap(wx.ART_WARNING, 57 57 wx.ART_TOOLBAR) 58 58 if icon_type == "error": 59 59 color = (255, 0, 0) # red … … 70 70 self.msg_txt.EndTextColour() 71 71 72 73 72 74 73 class Console(wx.Frame): … … 84 83 wx.EVT_CLOSE(self, self.Close) 85 84 86 87 85 def set_multiple_messages(self, messages=[]): 88 86 """ … … 112 110 113 111 #Layout of status bar 114 width, height = wx.ArtProvider.GetSizeHint(wx.ART_TOOLBAR) 112 width = STATUS_BAR_ICON_SIZE 113 height = STATUS_BAR_ICON_SIZE 115 114 self.SetFieldsCount(NB_FIELDS) 116 115 # Leave some space for the resize handle in the last field 117 116 self.SetStatusWidths([width+4, -2, -1, width+15]) 118 117 self.SetMinHeight(height) 119 120 rect = self.GetFieldRect(ICON_POSITION)121 if rect.height > height:122 height = rect.GetHeight()123 width = rect.GetWidth()124 118 125 119 #display default message … … 150 144 self.bitmap_bt_console.SetToolTipString(console_hint) 151 145 self.bitmap_bt_console.Bind(wx.EVT_BUTTON, self._onMonitor, 152 146 id=self.bitmap_bt_console.GetId()) 153 147 154 148 self.reposition() … … 174 168 self.frame.set_multiple_messages(self.list_msg) 175 169 self.frame.Hide() 176 self.progress = 0 177 self.timer = wx.Timer(self, -1) 178 self.timer_stop = wx.Timer(self, -1) 170 self.progress = 0 171 self.timer = wx.Timer(self, -1) 172 self.timer_stop = wx.Timer(self, -1) 179 173 self.thread = None 180 174 self.Bind(wx.EVT_TIMER, self._on_time, self.timer) … … 219 213 icon_bmp = wx.ArtProvider.GetBitmap(wx.ART_INFORMATION, wx.ART_TOOLBAR) 220 214 self.bitmap_bt_warning.SetBitmapLabel(icon_bmp) 221 215 222 216 if self.frame is not None : 223 217 self.frame.set_message(status=text, event=event) … … 297 291 298 292 # Get the size of the button images 299 width, height = wx.ArtProvider.GetSizeHint(wx.ART_TOOLBAR) 300 301 # Get the size of the field and choose the size of the 302 # image accordingly 303 rect = self.GetFieldRect(ICON_POSITION) 304 if rect.height > height: 305 height = rect.GetHeight() 306 width = rect.GetWidth() 293 height = STATUS_BAR_ICON_SIZE 307 294 308 295 msg = event.info.lower() … … 340 327 self.SetStatusText(text=str(event.status), event=event) 341 328 342 343 329 def set_gauge(self, event): 344 330 """
Note: See TracChangeset
for help on using the changeset viewer.