Changeset 6e4d543 in sasview


Ignore:
Timestamp:
Apr 19, 2012 7:48:04 AM (12 years ago)
Author:
Mathieu Doucet <doucetm@…>
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:
9690fbf
Parents:
b1432b9
Message:

trying to improve the status bar

Location:
sansguiframe/src/sans/guiframe
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • sansguiframe/src/sans/guiframe/gui_manager.py

    rb1432b9 r6e4d543  
    728728        self._mgr = wx.aui.AuiManager(self, flags=default_flag) 
    729729        self._mgr.SetDockSizeConstraint(0.5, 0.5) 
    730         # border color 
    731         #self.b_color = wx.aui.AUI_DOCKART_BORDER_COLOUR   
    732         #self._mgr.GetArtProvider().SetColor(self.b_color, self.color) 
    733         #self._mgr.SetArtProvider(wx.aui.AuiDockArt(wx.AuiDefaultDockArt)) 
    734         #print "set", self._dockart.GetColour(13) 
    735730        # Load panels 
    736731        self._load_panels() 
  • sansguiframe/src/sans/guiframe/gui_statusbar.py

    r6184b4e r6e4d543  
    9898class StatusBar(wxStatusB): 
    9999    """ 
    100     """ 
    101     def __init__(self, parent, *args, **kargs): 
    102         wxStatusB.__init__(self, parent, *args, **kargs) 
    103         """ 
    104         Implement statusbar functionalities  
    105         """ 
     100        Application status bar 
     101    """ 
     102    def __init__(self, parent, id): 
     103        wxStatusB.__init__(self, parent, id) 
    106104        self.parent = parent 
    107105        self.parent.SetStatusBarPane(MSG_POSITION) 
     106 
    108107        #Layout of status bar 
     108        hint_w, hint_h = wx.ArtProvider.GetSizeHint(wx.ART_TOOLBAR)         
    109109        self.SetFieldsCount(NB_FIELDS)  
    110         self.SetStatusWidths([BUTTON_SIZE, -2, -1, BUTTON_SIZE]) 
     110        # Leave some space for the resize handle in the last field 
     111        self.SetStatusWidths([hint_w+4, -2, -1, hint_w+15]) 
     112        self.SetMinHeight(hint_h+4) 
     113         
    111114        #display default message 
    112115        self.msg_position = MSG_POSITION  
    113         #save the position of the gauge 
    114         width, height = self.GetSize() 
    115         self.gauge = wx.Gauge(self, size=(width/10, height-3), 
     116         
     117        # Create progress bar 
     118        self.gauge = wx.Gauge(self, size=(hint_w, hint_h), 
    116119                               style=wx.GA_HORIZONTAL) 
    117120        self.gauge.Hide() 
    118         #status bar icon 
     121         
     122        # Create status bar icon reflecting the type of status 
     123        # for the last message 
    119124        self.bitmap_bt_warning = wx.BitmapButton(self, -1, 
    120                                                  size=(BUTTON_SIZE,-1), 
    121                                                   style=wx.NO_BORDER) 
    122         console_bmp = wx.ArtProvider.GetBitmap(wx.ART_TIP, wx.ART_TOOLBAR, 
    123                                                 size = (16,16)) 
     125                                                 size=(hint_w, hint_h), 
     126                                                 style=wx.NO_BORDER) 
     127                 
     128        # Create the button used to show the console dialog 
     129        console_bmp = wx.ArtProvider.GetBitmap(wx.ART_INFORMATION, wx.ART_TOOLBAR, 
     130                                                size = (hint_w, hint_h)) 
    124131        self.bitmap_bt_console = wx.BitmapButton(self, -1,  
    125                                  size=(BUTTON_SIZE-5, height-4)) 
     132                                 size=(hint_w, hint_h), 
     133                                 style=wx.NO_BORDER) 
    126134        self.bitmap_bt_console.SetBitmapLabel(console_bmp) 
    127135        console_hint = "History of status bar messages" 
     
    165173        """ 
    166174        rect = self.GetFieldRect(GAUGE_POSITION) 
    167         self.gauge.SetPosition((rect.x + 5, rect.y)) 
     175        self.gauge.SetPosition((rect.x, rect.y)) 
    168176        rect = self.GetFieldRect(ICON_POSITION) 
    169         self.bitmap_bt_warning.SetPosition((rect.x + 5, rect.y)) 
     177        self.bitmap_bt_warning.SetPosition((rect.x, rect.y)) 
    170178        rect = self.GetFieldRect(CONSOLE_POSITION) 
    171         self.bitmap_bt_console.SetPosition((rect.x - 5, rect.y)) 
     179        self.bitmap_bt_console.SetPosition((rect.x, rect.y)) 
    172180        self.sizeChanged = False 
    173181         
     
    269277        if not hasattr(event, "info"): 
    270278            return  
     279         
     280        rect = self.GetFieldRect(ICON_POSITION) 
     281        width = rect.GetWidth() 
     282        height = rect.GetHeight()   
     283         
    271284        msg = event.info.lower() 
    272285        if msg == "warning": 
    273             icon_bmp =  wx.ArtProvider.GetBitmap(wx.ART_WARNING, wx.ART_TOOLBAR) 
     286            icon_bmp =  wx.ArtProvider.GetBitmap(wx.ART_WARNING, wx.ART_TOOLBAR, 
     287                                                 size = (height,height)) 
    274288            self.bitmap_bt_warning.SetBitmapLabel(icon_bmp) 
    275         if msg == "error": 
    276             icon_bmp =  wx.ArtProvider.GetBitmap(wx.ART_ERROR, wx.ART_TOOLBAR) 
     289        elif msg == "error": 
     290            icon_bmp =  wx.ArtProvider.GetBitmap(wx.ART_ERROR, wx.ART_TOOLBAR, 
     291                                                 size = (height,height)) 
    277292            self.bitmap_bt_warning.SetBitmapLabel(icon_bmp) 
    278         if msg == "info": 
     293        else: 
    279294            icon_bmp =  wx.ArtProvider.GetBitmap(wx.ART_INFORMATION, 
    280                                                  wx.ART_TOOLBAR) 
     295                                                 wx.ART_TOOLBAR, 
     296                                                 size = (height,height)) 
    281297            self.bitmap_bt_warning.SetBitmapLabel(icon_bmp) 
    282298     
Note: See TracChangeset for help on using the changeset viewer.