Changeset caf273b in sasview


Ignore:
Timestamp:
Apr 3, 2014 5:03:28 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:
eea3ffa
Parents:
ea67541
Message:

Re #216 Fix toolbar issue.

Location:
src/sans/guiframe
Files:
2 edited

Legend:

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

    r76cd1ae rcaf273b  
    229229        """ 
    230230 
    231         PARENT_FRAME.__init__(self, parent=parent, title=title, pos=pos, size=size) 
     231        PARENT_FRAME.__init__(self, parent=parent, title=title, pos=pos, size=size, style=wx.SYSTEM_MENU | wx.CAPTION | wx.CLOSE_BOX) 
    232232        # title 
    233233        self.title = title 
     
    978978        # Look for plug-in panels 
    979979        panels = []   
    980         mac_pos_y = 40   
     980        mac_pos_y = 85 
    981981        for item in self.plugins: 
    982982            if hasattr(item, "get_panels"): 
     
    10481048            win_height = mac_pos_y 
    10491049            if IS_LINUX: 
    1050                 win_height = mac_pos_y + 55 
     1050                win_height = mac_pos_y + 10 
    10511051                self.SetMaxSize((-1, win_height)) 
    10521052            else: 
     
    12391239        add toolbar to the frame 
    12401240        """ 
    1241         #set toolbar 
    1242         self._toolbar = GUIToolBar(self, -1) 
    1243         self.SetToolBar(self._toolbar) 
     1241        # Set toolbar 
     1242        self._toolbar = GUIToolBar(self) 
     1243        sizer = wx.BoxSizer(wx.VERTICAL) 
     1244        sizer.Add(self._toolbar, 0, wx.EXPAND) 
     1245        self.SetSizer(sizer) 
    12441246        self._update_toolbar_helper() 
    12451247        self._on_toggle_toolbar(event=None) 
  • src/sans/guiframe/gui_statusbar.py

    r5777106 rcaf273b  
    44from wx.lib import newevent 
    55import wx.richtext 
    6 import time 
    76from sans.guiframe.gui_style import GUIFRAME_ICON 
    8 #numner of fields of the status bar  
     7 
     8# Number of fields on the status bar  
    99NB_FIELDS = 4 
    1010#position of the status bar's fields 
     
    1414CONSOLE_POSITION  = 3 
    1515BUTTON_SIZE = 40 
    16  
     16STATUS_BAR_ICON_SIZE = 12 
    1717CONSOLE_WIDTH = 500 
    1818CONSOLE_HEIGHT = 300 
     
    4949        color = (0, 0, 0) #black 
    5050        icon_bmp =  wx.ArtProvider.GetBitmap(wx.ART_INFORMATION, 
    51                                                  wx.ART_TOOLBAR) 
     51                                             wx.ART_TOOLBAR) 
    5252        if hasattr(event, "info"): 
    5353            icon_type = event.info.lower() 
     
    5555                color = (0, 0, 255) # blue 
    5656                icon_bmp =  wx.ArtProvider.GetBitmap(wx.ART_WARNING, 
    57                                                       wx.ART_TOOLBAR) 
     57                                                     wx.ART_TOOLBAR) 
    5858            if icon_type == "error": 
    5959                color = (255, 0, 0) # red 
     
    7070        self.msg_txt.EndTextColour() 
    7171         
    72             
    7372         
    7473class Console(wx.Frame): 
     
    8483        wx.EVT_CLOSE(self, self.Close) 
    8584         
    86          
    8785    def set_multiple_messages(self, messages=[]): 
    8886        """ 
     
    112110 
    113111        #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 
    115114        self.SetFieldsCount(NB_FIELDS)  
    116115        # Leave some space for the resize handle in the last field 
    117116        self.SetStatusWidths([width+4, -2, -1, width+15]) 
    118117        self.SetMinHeight(height) 
    119          
    120         rect = self.GetFieldRect(ICON_POSITION) 
    121         if rect.height > height: 
    122             height = rect.GetHeight()   
    123             width = rect.GetWidth() 
    124118         
    125119        #display default message 
     
    150144        self.bitmap_bt_console.SetToolTipString(console_hint) 
    151145        self.bitmap_bt_console.Bind(wx.EVT_BUTTON, self._onMonitor, 
    152                                             id=self.bitmap_bt_console.GetId()) 
     146                                    id=self.bitmap_bt_console.GetId()) 
    153147         
    154148        self.reposition() 
     
    174168        self.frame.set_multiple_messages(self.list_msg) 
    175169        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) 
    179173        self.thread = None 
    180174        self.Bind(wx.EVT_TIMER, self._on_time, self.timer)  
     
    219213        icon_bmp = wx.ArtProvider.GetBitmap(wx.ART_INFORMATION, wx.ART_TOOLBAR) 
    220214        self.bitmap_bt_warning.SetBitmapLabel(icon_bmp) 
    221        
     215 
    222216        if self.frame is not None : 
    223217            self.frame.set_message(status=text, event=event) 
     
    297291         
    298292        # 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 
    307294         
    308295        msg = event.info.lower() 
     
    340327            self.SetStatusText(text=str(event.status), event=event) 
    341328        
    342   
    343329    def set_gauge(self, event): 
    344330        """ 
Note: See TracChangeset for help on using the changeset viewer.