source: sasview/src/danse/common/plottools/SizeDialog.py @ f468791

ESS_GUIESS_GUI_DocsESS_GUI_batch_fittingESS_GUI_bumps_abstractionESS_GUI_iss1116ESS_GUI_iss879ESS_GUI_iss959ESS_GUI_openclESS_GUI_orderingESS_GUI_sync_sascalccostrafo411magnetic_scattrelease-4.1.1release-4.1.2release-4.2.2release_4.0.1ticket-1009ticket-1094-headlessticket-1242-2d-resolutionticket-1243ticket-1249ticket885unittest-saveload
Last change on this file since f468791 was 5777106, checked in by Mathieu Doucet <doucetm@…>, 11 years ago

Moving things around. Will definitely not build.

  • Property mode set to 100644
File size: 1.5 KB
RevLine 
[82a54b8]1import wx
2
[10bfeb3]3
[82a54b8]4class SizeDialog(wx.Dialog):
5    def __init__(self, parent, id, title):
6        wx.Dialog.__init__(self, parent, id, title, size=(300, 175))
7
8        mainbox = wx.BoxSizer(wx.VERTICAL)
9        vbox = wx.BoxSizer(wx.VERTICAL)
10        textbox = wx.BoxSizer(wx.HORIZONTAL)
11        hbox = wx.BoxSizer(wx.HORIZONTAL)
[940aca7]12        text1 = "Enter in a custom size (> 0 accepted)"
[10bfeb3]13        msg = wx.StaticText(self, -1, text1, (30,15), style=wx.ALIGN_CENTRE)
[82a54b8]14        msg.SetLabel(text1)
15        self.myTxtCtrl = wx.TextCtrl(self, -1, '', (100, 50))
16       
[10bfeb3]17        textbox.Add(self.myTxtCtrl, flag=wx.LEFT|wx.RIGHT|wx.ADJUST_MINSIZE,
[940aca7]18                 border=10)
[82a54b8]19        vbox.Add(msg, flag=wx.ALL, border=10, proportion=1)
20        vbox.Add(textbox, flag=wx.EXPAND|wx.TOP|wx.BOTTOM|wx.ADJUST_MINSIZE,
21                 border=10)
[940aca7]22        self.myTxtCtrl.SetValue(str(5))
[82a54b8]23       
[10bfeb3]24        okButton = wx.Button(self, wx.ID_OK, 'OK', size=(70, 25))
25        closeButton = wx.Button(self, wx.ID_CANCEL, 'Cancel', size=(70, 25))
[82a54b8]26
27        hbox.Add(okButton)
[10bfeb3]28        hbox.Add((20, 20))
[82a54b8]29        hbox.Add(closeButton)
30       
31        mainbox.Add(vbox, flag=wx.ALL, border=10)
32        mainbox.Add(wx.StaticLine(self), 0, wx.ALL|wx.EXPAND, 5)
[10bfeb3]33        mainbox.Add(hbox, flag=wx.CENTER,
[82a54b8]34                    border=10)
35        self.SetSizer(mainbox)
36   
37    def getText(self):
38        """
39        Get text typed
40        """
41        return self.myTxtCtrl.GetValue()
Note: See TracBrowser for help on using the repository browser.