Ignore:
Timestamp:
Mar 29, 2015 11:05:43 PM (9 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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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 
Note: See TracChangeset for help on using the changeset viewer.