source: sasview/guitools/PropertyDialog.py @ 831149e

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 831149e was 831149e, checked in by Gervaise Alina <gervyh@…>, 16 years ago

working better .Since have to think about the zoom

  • Property mode set to 100644
File size: 2.3 KB
Line 
1#!/usr/bin/python
2
3# myDialog.py
4
5import wx
6
7class Properties(wx.Dialog):
8    def __init__(self, parent, id, title):
9        wx.Dialog.__init__(self, parent, id, title, size=(300, 200))
10        """
11            for the properties window
12        """
13        self.parent = parent
14        panel = wx.Panel(self, -1, style=wx.SIMPLE_BORDER)   
15        vbox  = wx.BoxSizer(wx.VERTICAL)
16        sizer = wx.GridBagSizer(5,0)
17        vbox.Add(panel, 1, wx.EXPAND | wx.ALL)
18     
19        ix = 1
20        iy = 1
21        sizer.Add(wx.StaticText(panel, -1, 'X'),(iy, ix))
22        ix += 2
23        sizer.Add(wx.StaticText(panel, -1, 'Y'),(iy, ix))
24        ix += 2
25        sizer.Add(wx.StaticText(panel, -1, 'View'),(iy, ix))
26        iy += 1
27        ix = 1
28        self.xvalue = wx.ComboBox(panel, -1)
29        sizer.Add(self.xvalue,(iy,ix))
30        ix +=2
31        self.yvalue = wx.ComboBox(panel, -1)
32        sizer.Add( self.yvalue,(iy, ix))
33        ix +=2
34        view =wx.ComboBox(panel, -1, size=(60, -1))
35        sizer.Add(view,(iy,ix))
36        ix =3
37        iy +=3
38        btCancel=wx.Button(panel, wx.ID_CANCEL,'Cancel' )
39        sizer.Add(btCancel,(iy,ix))
40        ix +=2
41        btOk = wx.Button(panel, wx.ID_OK, "Ok")
42        sizer.Add(btOk,(iy, ix))
43       
44        # scale value for x
45        self.xvalue.SetValue("x")
46        self.xvalue.Insert("x",0)
47        self.xvalue.Insert("x^(2)",1)
48        self.xvalue.Insert("log10(x)",2)
49       
50       
51        # scale value for y
52        self.yvalue.SetValue("log10(y)")
53        self.yvalue.Insert("y",0)
54        self.yvalue.Insert("1/y",1)
55        self.yvalue.Insert("ln(y)",2)
56        self.yvalue.Insert("y^(2)",3)
57        self.yvalue.Insert("1/sqrt(y)",4)
58        self.yvalue.Insert("log10(y)",5)
59        self.yvalue.Insert("ln(y*x)",6)
60        self.yvalue.Insert("ln(y*x^(2))",7)
61        self.yvalue.Insert("ln(y*x^(4))",8)
62       
63        panel.SetSizer(sizer)
64        self.SetSizer(vbox)
65        self.Centre()
66           
67       
68    def setValues(self,x,y):
69        return  self.xvalue.SetValue(x),  self.yvalue.SetValue(y)
70       
71    def getValues(self):
72        return self.xvalue.GetValue(), self.yvalue.GetValue()
73
74if __name__ == "__main__": 
75    app = wx.App()
76    dialog = Properties(None, -1, 'Properties')
77    dialog.ShowModal()
78    app.MainLoop()
79
80
Note: See TracBrowser for help on using the repository browser.