source: sasview/src/sas/plottools/SizeDialog.py @ 27ab091

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 27ab091 was 79492222, checked in by krzywon, 10 years ago

Changed the file and folder names to remove all SANS references.

  • Property mode set to 100644
File size: 1.5 KB
Line 
1import wx
2
3
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)
12        text1 = "Enter in a custom size (> 0 accepted)"
13        msg = wx.StaticText(self, -1, text1, (30,15), style=wx.ALIGN_CENTRE)
14        msg.SetLabel(text1)
15        self.myTxtCtrl = wx.TextCtrl(self, -1, '', (100, 50))
16       
17        textbox.Add(self.myTxtCtrl, flag=wx.LEFT|wx.RIGHT|wx.ADJUST_MINSIZE,
18                 border=10)
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)
22        self.myTxtCtrl.SetValue(str(5))
23       
24        okButton = wx.Button(self, wx.ID_OK, 'OK', size=(70, 25))
25        closeButton = wx.Button(self, wx.ID_CANCEL, 'Cancel', size=(70, 25))
26
27        hbox.Add(okButton)
28        hbox.Add((20, 20))
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)
33        mainbox.Add(hbox, flag=wx.CENTER,
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.