Changeset 9fdf302 in sasview for src/sas/sasgui/perspectives/fitting


Ignore:
Timestamp:
Nov 29, 2016 5:25:14 AM (8 years ago)
Author:
wojciech
Children:
2e63860
Parents:
16c1297
Message:

Boxsizer instead of FlexGridSizer? introduced

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/sas/sasgui/perspectives/fitting/gpu_options.py

    r16c1297 r9fdf302  
    4343 
    4444        clinfo = self._get_clinfo() 
     45 
    4546        self.panel1 = wx.Panel(self, -1) 
    4647        static_box1 = wx.StaticBox(self.panel1, -1, "Available OpenCL Options:") 
    4748 
    48         rows = len(clinfo) 
    49  
    50         flexsizer = wx.FlexGridSizer(rows, 1, hgap=20, vgap=10) 
     49        boxsizer = wx.BoxSizer(orient=wx.VERTICAL) 
    5150        self.option_button = {} 
    5251        for index, fitter in enumerate(clinfo): 
     
    5857                self.option_button[fitter] = "None" 
    5958            self.Bind(wx.EVT_RADIOBUTTON, self.OnRadio, id=button.GetId()) 
    60             flexsizer.Add(button, 0, 0) 
     59            boxsizer.Add(button, 0, 0) 
    6160 
    6261        fit_hsizer = wx.StaticBoxSizer(static_box1, orient=wx.VERTICAL) 
    63         fit_hsizer.Add(flexsizer, 0, wx.ALL, 5) 
     62        fit_hsizer.Add(boxsizer, 0, wx.ALL, 5) 
    6463 
    6564        self.panel1.SetSizer(fit_hsizer) 
     
    7271 
    7372        help_btn = wx.Button(self, wx.ID_HELP, 'Help') 
    74         #help_btn = wx.Button(self, wx.ID_ANY, 'Help') 
    7573        help_btn.SetToolTipString("Help on the GPU options") 
    7674 
    7775        self.Bind(wx.EVT_BUTTON, self.OnAccept, accept_btn) 
    78         #self.Bind(wx.EVT_BUTTON, self.OnCancel, cancel_btn) 
    7976        if help is not None: 
    8077            self.Bind(wx.EVT_BUTTON, self.OnHelp, help_btn) 
     
    8279        self.Bind(wx.EVT_CLOSE, self.OnClose) 
    8380 
    84         # Create the button sizer that will put the buttons in a row, right 
    85         # justified, and with a fixed amount of space between them.  This 
    86         # emulates the Windows convention for placing a set of buttons at the 
    87         # bottom right of the window. 
    8881        btn_sizer = wx.BoxSizer(wx.HORIZONTAL) 
    8982        btn_sizer.Add((10,20), 1)  # stretchable whitespace 
    9083        btn_sizer.Add(accept_btn, 0) 
    91         #btn_sizer.Add((10,20), 0)  # non-stretchable whitespace 
    92         #btn_sizer.Add(cancel_btn, 0) 
    93         #btn_sizer.Add((10,20), 0)  # non-stretchable whitespace 
    9484        btn_sizer.Add((10,20), 0)  # non-stretchable whitespace 
    9585        btn_sizer.Add(help_btn, 0) 
     
    9888        self.vbox.Add(btn_sizer, 0, wx.EXPAND|wx.ALL, 10) 
    9989 
    100         # Finalize the sizer and establish the dimensions of the dialog box. 
    101         # The minimum width is explicitly set because the sizer is not able to 
    102         # take into consideration the width of the enclosing frame's title. 
    10390        self.SetSizer(self.vbox) 
    104         #self.vbox.SetMinSize((size[0], -1)) 
    10591        self.vbox.Fit(self) 
    10692 
     
    128114    def OnAccept(self, event): 
    129115        """ 
    130         Save the current fitter and options to the fit config. 
     116        Close window on accpetance 
    131117        """ 
    132118        event.Skip() 
     
    134120    def OnHelp(self, event): 
    135121        """ 
    136         Provide help on the selected fitter. 
     122        Provide help on opencl options. 
    137123        """ 
    138124        _TreeLocation = "user/gpu_computations.html" 
     
    143129    def OnClose(self, event): 
    144130        """ 
    145         Don't close the window, just hide it. 
     131        Close window 
    146132        """ 
    147133        event.Skip() 
Note: See TracChangeset for help on using the changeset viewer.