source: sasview/src/sas/plottools/LabelDialog.py @ f620870

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 f620870 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.7 KB
RevLine 
[a9d5684]1import wx
2import sys
3if sys.platform.count("win32") > 0:
4    FONT_VARIANT = 0
5    PNL_WIDTH = 270
6else:
7    FONT_VARIANT = 1
8    PNL_WIDTH = 300
9   
10class LabelDialog(wx.Dialog):
11    def __init__(self, parent, id, title, label):
12        wx.Dialog.__init__(self, parent, id, title, size=(PNL_WIDTH, 150))
13
14        #panel = wx.Panel(self, -1)
15        #Font
16        self.SetWindowVariant(variant=FONT_VARIANT)
17        mainbox = wx.BoxSizer(wx.VERTICAL)
18        vbox = wx.BoxSizer(wx.VERTICAL)
19        textbox = wx.BoxSizer(wx.HORIZONTAL)
20       
21        text1 = "Enter a new title/label:"
22        msg = wx.StaticText(self, -1, text1,(30,15), style=wx.ALIGN_LEFT)
23        msg.SetLabel(text1)
24        self.myTxtCtrl = wx.TextCtrl(self, -1, '', (200, 30))
25        self.myTxtCtrl.SetValue(str(label))
26        textbox.Add(self.myTxtCtrl, flag=wx.LEFT|wx.RIGHT|wx.ADJUST_MINSIZE, 
27                 border=10, proportion=2)
28        vbox.Add(msg, flag=wx.ALL, border=10, proportion=1)
29        vbox.Add(textbox, flag=wx.EXPAND|wx.TOP|wx.BOTTOM|wx.ADJUST_MINSIZE,
30                 border=5)
31        hbox = wx.BoxSizer(wx.HORIZONTAL)
32        okButton = wx.Button(self,wx.ID_OK, 'OK', size=(70, 25))
33        closeButton = wx.Button(self,wx.ID_CANCEL, 'Cancel', size=(70, 25))
34       
35        hbox.Add(okButton, wx.LEFT, 10)
36        hbox.Add((20, 20))
37        hbox.Add(closeButton, wx.LEFT, 10)
38
39        mainbox.Add(vbox, flag=wx.LEFT, border=5)
40        mainbox.Add(wx.StaticLine(self), 0, wx.ALL|wx.EXPAND, 5)
41        mainbox.Add(hbox, flag=wx.CENTER, 
42                    border=20)
43        self.SetSizer(mainbox)
44   
45    def getText(self):
46        return self.myTxtCtrl.GetValue()
Note: See TracBrowser for help on using the repository browser.