Changeset d5419f7f in sasview


Ignore:
Timestamp:
Mar 29, 2015 11:05:43 PM (10 years ago)
Author:
butler
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:
a3f125f0
Parents:
60dca65c
Message:
  • Fixed problem with mac vs pc positioning of tool panels for now -

opened ticket to completely rethink panels in mac vs pc

  • Added close button/activated close method for tool panels that did not

have it. Tool panels are now much more consistant.

Location:
src/sas/perspectives/calculator
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • src/sas/perspectives/calculator/data_operator.py

    r49ab5d7 rd5419f7f  
    11""" 
    2 GUI for the data operation 
     2GUI for the data operations panel (sum and multiply) 
    33""" 
    44import wx 
     
    1717#Control panel width  
    1818if sys.platform.count("win32") > 0: 
     19    PANEL_TOP = 0 
    1920    PANEL_WIDTH = 790 
    2021    PANEL_HEIGTH = 370 
     
    2324    ON_MAC = False 
    2425else: 
     26    PANEL_TOP = 60 
    2527    _BOX_WIDTH = 230 
    2628    PANEL_WIDTH = 900 
     
    963965        self.panel = DataOperPanel(parent=self) 
    964966        wx.EVT_CLOSE(self, self.OnClose) 
    965         self.SetPosition((25, 10)) 
     967        self.SetPosition((wx.LEFT, PANEL_TOP)) 
    966968        self.Show() 
    967969 
  • src/sas/perspectives/calculator/density_panel.py

    r49ab5d7 rd5419f7f  
    1818#Density panel size  
    1919if sys.platform.count("win32") > 0: 
     20    PANEL_TOP = 0 
    2021    _STATICBOX_WIDTH = 410 
    2122    _BOX_WIDTH = 200 
     
    2324    FONT_VARIANT = 0 
    2425else: 
     26    PANEL_TOP = 60 
    2527    _STATICBOX_WIDTH = 430 
    2628    _BOX_WIDTH = 200 
     
    4951        # Object that receive status event 
    5052        self.base = base 
     53        self.parent = parent 
    5154        # chemeical formula, string 
    5255        self.compound = '' 
     
    211214        self.Bind(wx.EVT_BUTTON, self.on_help, id=id) 
    212215 
    213         sizer_button.Add((150, 20), 1, wx.EXPAND | wx.ADJUST_MINSIZE, 0) 
     216        self.button_close = wx.Button(self, wx.ID_CANCEL, 'Close') 
     217        self.button_close.Bind(wx.EVT_BUTTON, self.on_close) 
     218        self.button_close.SetToolTipString("Close this window.") 
     219 
     220        sizer_button.Add((100, 20), 1, wx.EXPAND | wx.ADJUST_MINSIZE, 0) 
    214221        sizer_button.Add(self.button_calculate, 0, 
    215222                                        wx.RIGHT | wx.ADJUST_MINSIZE, 20) 
    216223        sizer_button.Add(self.button_help, 0, 
     224                                        wx.RIGHT | wx.ADJUST_MINSIZE, 20) 
     225        sizer_button.Add(self.button_close, 0, 
    217226                                        wx.RIGHT | wx.ADJUST_MINSIZE, 20) 
    218227        sizer3.Add(sizer_button) 
     
    379388             _TreeLocation, "Density/Volume Calculator Help") 
    380389 
     390    def on_close(self, event): 
     391        """ 
     392        close the window containing this panel 
     393        """ 
     394        self.parent.Close() 
     395 
    381396    def clear_outputs(self): 
    382397        """ 
     
    415430        self.panel = DensityPanel(self, base=base) 
    416431        self.Bind(wx.EVT_CLOSE, self.on_close) 
    417         self.SetPosition((25, 10)) 
     432        self.SetPosition((wx.LEFT, PANEL_TOP)) 
    418433        self.Show(True) 
    419434 
  • src/sas/perspectives/calculator/gen_scatter_panel.py

    r60dca65c rd5419f7f  
    4747    FONT_VARIANT = 0 
    4848else: 
    49     PANEL_TOP = 40 
     49    PANEL_TOP = 60 
    5050    PANEL_WIDTH = 620 
    5151    PANEL_HEIGHT = 370 
     
    379379        self.orient_combo = self._fill_orient_combo() 
    380380        self.orient_combo.Show(False) 
     381 
    381382        self.bt_compute = wx.Button(self, wx.NewId(), 'Compute') 
    382383        self.bt_compute.Bind(wx.EVT_BUTTON, self.on_compute) 
    383384        self.bt_compute.SetToolTipString("Compute 2D Scattering Pattern.") 
     385 
    384386        self.bt_help = wx.Button(self, wx.NewId(), 'HELP') 
    385387        self.bt_help.Bind(wx.EVT_BUTTON, self.on_help) 
    386388        self.bt_help.SetToolTipString("Help on Scatter Calculator") 
     389 
     390        self.bt_close = wx.Button(self, wx.ID_CANCEL, 'Close') 
     391        self.bt_close.Bind(wx.EVT_BUTTON, self.on_panel_close) 
     392        self.bt_close.SetToolTipString("Close this window") 
     393 
    387394        self.button_sizer.AddMany([(self.time_text , 0, wx.LEFT, 20), 
    388395                                   (self.orient_combo , 0, wx.LEFT, 20), 
    389396                                   (self.bt_compute, 0, wx.LEFT, 20), 
    390                                    (self.bt_help, 0, wx.LEFT, 5)]) 
     397                                   (self.bt_help, 0, wx.LEFT, 20), 
     398                                   (self.bt_close, 0, wx.LEFT, 5)]) 
    391399 
    392400    def estimate_ctime(self): 
     
    12121220    def on_panel_close(self, event): 
    12131221        """ 
    1214         On Close SLD panel 
    1215         """ 
    1216         #Not implemented    
     1222        close the window containing this panel 
     1223        """ 
     1224        self.parent.Close() 
    12171225 
    12181226class OmfPanel(ScrolledPanel, PanelBase): 
  • src/sas/perspectives/calculator/kiessig_calculator_panel.py

    r26d2d88 rd5419f7f  
    2222#Slit length panel size 
    2323if sys.platform.count("win32") > 0: 
     24    PANEL_TOP = 0 
    2425    PANEL_WIDTH = 500 
    2526    PANEL_HEIGHT = 230 
    2627    FONT_VARIANT = 0 
    2728else: 
     29    PANEL_TOP = 60 
    2830    PANEL_WIDTH = 560 
    2931    PANEL_HEIGHT = 230 
     
    228230        self.panel = KiessigThicknessCalculatorPanel(parent=self) 
    229231        self.Bind(wx.EVT_CLOSE, self.on_close) 
    230         self.SetPosition((25, 10)) 
     232        self.SetPosition((wx.LEFT, PANEL_TOP)) 
    231233        self.Show(True) 
    232234         
  • src/sas/perspectives/calculator/resolution_calculator_panel.py

    raf6b53c rd5419f7f  
    3939#Slit length panel size 
    4040if sys.platform.count("win32") > 0: 
     41    PANEL_TOP = 0 
    4142    PANEL_WIDTH = 525 
    4243    PANEL_HEIGHT = 653 
     
    4445    IS_WIN = True 
    4546else: 
     47    PANEL_TOP = 60 
    4648    PANEL_WIDTH = 540 
    4749    PANEL_HEIGHT = 662 
     
    13351337        self.panel = ResolutionCalculatorPanel(parent=self) 
    13361338        self.Bind(wx.EVT_CLOSE, self.OnClose) 
    1337         self.SetPosition((25, 10)) 
     1339        self.SetPosition((wx.LEFT, PANEL_TOP)) 
    13381340        self.Show(True) 
    13391341 
  • src/sas/perspectives/calculator/sld_panel.py

    r49ab5d7 rd5419f7f  
    3030#SLD panel size  
    3131if sys.platform.count("win32") > 0: 
     32    PANEL_TOP = 0 
    3233    _STATICBOX_WIDTH = 350 
    3334    PANEL_SIZE = 400 
    3435    FONT_VARIANT = 0 
    3536else: 
     37    PANEL_TOP = 60 
    3638    _STATICBOX_WIDTH = 380 
    3739    PANEL_SIZE = 410 
     
    5961        self.base = base 
    6062        self.wavelength = WAVELENGTH 
     63        self.parent = parent 
    6164        #layout attribute 
    6265        self.compound_ctl = None 
     
    290293        self.Bind(wx.EVT_BUTTON, self.on_help, id=id) 
    291294 
     295        self.button_close = wx.Button(self, wx.ID_CANCEL, 'Close') 
     296        self.button_close.Bind(wx.EVT_BUTTON, self.on_close) 
     297        self.button_close.SetToolTipString("Close this window.") 
     298 
    292299        sizer_button.Add((150, 20), 1, wx.EXPAND | wx.ADJUST_MINSIZE, 0) 
    293300        sizer_button.Add(self.button_calculate, 0, wx.RIGHT | wx.ADJUST_MINSIZE, 20) 
    294301        sizer_button.Add(self.button_help, 0, wx.RIGHT | wx.ADJUST_MINSIZE, 20) 
     302        sizer_button.Add(self.button_close, 0, wx.RIGHT | wx.ADJUST_MINSIZE, 20) 
    295303        sizer3.Add(sizer_button) 
    296304        #---------layout---------------- 
     
    320328        _doc_viewer = DocumentationWindow(self, -1, \ 
    321329             _TreeLocation, "General Scattering Calculator Help") 
     330 
     331    def on_close(self, event): 
     332        """ 
     333        close the window containing this panel 
     334        """ 
     335        self.parent.Close() 
    322336 
    323337    def calculate_xray_sld(self, element): 
     
    482496        self.panel = SldPanel(self, base=base) 
    483497        self.Bind(wx.EVT_CLOSE, self.on_close) 
    484         self.SetPosition((20, 10)) 
     498        self.SetPosition((wx.LEFT, PANEL_TOP)) 
    485499        self.Show(True) 
    486500 
  • src/sas/perspectives/calculator/slit_length_calculator_panel.py

    r49ab5d7 rd5419f7f  
    2525#Slit length panel size  
    2626if sys.platform.count("win32") > 0: 
     27    PANEL_TOP = 0 
    2728    PANEL_WIDTH = 500 
    2829    PANEL_HEIGHT = 210 
    2930    FONT_VARIANT = 0 
    3031else: 
     32    PANEL_TOP = 60 
    3133    PANEL_WIDTH = 530 
    3234    PANEL_HEIGHT = 210 
     
    293295        self.panel = SlitLengthCalculatorPanel(parent=self) 
    294296        self.Bind(wx.EVT_CLOSE, self.on_close) 
    295         self.SetPosition((25, 10)) 
     297        self.SetPosition((wx.LEFT, PANEL_TOP)) 
    296298        self.Show(True) 
    297299 
Note: See TracChangeset for help on using the changeset viewer.