Changeset b50b057 in sasview


Ignore:
Timestamp:
Apr 5, 2014 7:24:36 AM (10 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:
caf8dd4
Parents:
1c03e14
Message:

Fix wx2.8 issue with fonts

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/sans/guiframe/gui_statusbar.py

    rbeda555 rb50b057  
    2121else: 
    2222    FONT_VARIANT = 1 
     23 
     24GREEN = wx.Colour(95, 190, 95) 
     25YELLOW = wx.Colour(247, 214, 49) 
     26RED = wx.Colour(234, 89, 78) 
    2327 
    2428class ConsolePanel(wx.Panel): 
     
    129133        # Create status bar icon reflecting the type of status 
    130134        # for the last message 
    131         self.bitmap_bt_warning = \ 
    132             wx.BitmapButton(self, -1, 
    133                             size=(width, height), 
    134                             style=wx.NO_BORDER) 
     135        self.bitmap_bt_warning = wx.Button(self, wx.NewId(), "",  
     136                                 size=(width, height), style=wx.NO_BORDER) 
     137        self.bitmap_bt_warning.SetBackgroundColour(GREEN) 
    135138 
    136139        # Create the button used to show the console dialog 
    137         self.bitmap_bt_console = wx.Button(self, wx.NewId(), "Console",  
     140        self.console_button = wx.Button(self, wx.NewId(), "Console",  
    138141                                 size=(console_btn_width, 10), 
    139142                                 style=wx.BU_EXACTFIT) 
    140         font = self.bitmap_bt_console.GetFont() 
    141         font = font.Smaller() 
    142         self.bitmap_bt_console.SetFont(font) 
    143  
    144         console_hint = "History of status bar messages" 
    145         self.bitmap_bt_console.SetToolTipString(console_hint) 
    146         self.bitmap_bt_console.Bind(wx.EVT_BUTTON, self._onMonitor, 
    147                                     id=self.bitmap_bt_console.GetId()) 
     143        font = self.console_button.GetFont() 
     144        font.SetPixelSize(wx.Size(0,10)) 
     145        self.console_button.SetFont(font) 
     146        self.console_button.SetToolTipString("History of status bar messages") 
     147        self.console_button.Bind(wx.EVT_BUTTON, self._onMonitor, 
     148                                id=self.console_button.GetId()) 
    148149         
    149150        self.reposition() 
     
    187188        self.bitmap_bt_warning.SetPosition((rect.x, rect.y)) 
    188189        rect = self.GetFieldRect(CONSOLE_POSITION) 
    189         self.bitmap_bt_console.SetPosition((rect.x, rect.y)) 
     190        self.console_button.SetPosition((rect.x, rect.y)) 
    190191        self.sizeChanged = False 
    191192         
     
    212213        wxStatusB.SetStatusText(self, text, number) 
    213214        self.list_msg.append(text) 
    214         icon_bmp = wx.ArtProvider.GetBitmap(wx.ART_INFORMATION, wx.ART_TOOLBAR) 
    215         self.bitmap_bt_warning.SetBitmapLabel(icon_bmp) 
     215        self.bitmap_bt_warning.SetBackgroundColour(GREEN) 
    216216 
    217217        if self.frame is not None : 
     
    296296        msg = event.info.lower() 
    297297        if msg == "warning": 
    298             icon_bmp =  wx.ArtProvider.GetBitmap(wx.ART_WARNING, wx.ART_TOOLBAR, 
    299                                                  size = (height,height)) 
    300             self.bitmap_bt_warning.SetBitmapLabel(icon_bmp) 
     298            self.bitmap_bt_warning.SetBackgroundColour(YELLOw) 
    301299        elif msg == "error": 
    302             icon_bmp =  wx.ArtProvider.GetBitmap(wx.ART_ERROR, wx.ART_TOOLBAR, 
    303                                                  size = (height,height)) 
    304             self.bitmap_bt_warning.SetBitmapLabel(icon_bmp) 
     300            self.bitmap_bt_warning.SetBackgroundColour(RED) 
    305301        else: 
    306             icon_bmp =  wx.ArtProvider.GetBitmap(wx.ART_INFORMATION, 
    307                                                  wx.ART_TOOLBAR, 
    308                                                  size = (height,height)) 
    309             self.bitmap_bt_warning.SetBitmapLabel(icon_bmp) 
     302            self.bitmap_bt_warning.SetBackgroundColour(GREEN) 
    310303     
    311304    def set_dialog(self, event): 
Note: See TracChangeset for help on using the changeset viewer.