source: sasview/src/sas/plottools/SizeDialog.py @ 892a2cc

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 892a2cc was 3477478, checked in by Mathieu Doucet <doucetm@…>, 10 years ago

pylint fixes

  • Property mode set to 100644
File size: 1.4 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.text_ctrl = wx.TextCtrl(self, -1, '', (100, 50))
16
17        textbox.Add(self.text_ctrl, flag=wx.LEFT | wx.RIGHT | wx.ADJUST_MINSIZE, border=10)
18        vbox.Add(msg, flag=wx.ALL, border=10, proportion=1)
19        vbox.Add(textbox, flag=wx.EXPAND | wx.TOP | wx.BOTTOM | wx.ADJUST_MINSIZE, border=10)
20        self.text_ctrl.SetValue(str(5))
21
22        ok_button = wx.Button(self, wx.ID_OK, 'OK', size=(70, 25))
23        close_button = wx.Button(self, wx.ID_CANCEL, 'Cancel', size=(70, 25))
24
25        hbox.Add(ok_button)
26        hbox.Add((20, 20))
27        hbox.Add(close_button)
28
29        mainbox.Add(vbox, flag=wx.ALL, border=10)
30        mainbox.Add(wx.StaticLine(self), 0, wx.ALL | wx.EXPAND, 5)
31        mainbox.Add(hbox, flag=wx.CENTER, border=10)
32        self.SetSizer(mainbox)
33
34    def getText(self):
35        """
36        Get text typed
37        """
38        return self.text_ctrl.GetValue()
Note: See TracBrowser for help on using the repository browser.