Example #1
0
    def __init__(self, parent, id=wx.ID_ANY, *args, **kargs):
        super(MarginWidget, self).__init__(parent, id, *args, **kargs)
        self.use_def = wx.CheckBox(self, -1, 'Use Global Setting', (10, 10))

        self.st1 = wx.StaticText(self, label="   X  ")
        self.h_slider = CustomDoubleSlider(self, wx.ID_ANY)
        self.st2 = wx.StaticText(self, label="   Y  ")
        self.v_slider = CustomDoubleSlider(self, wx.ID_ANY)

        big_sizer = wx.BoxSizer(wx.VERTICAL)
        big_sizer2 = wx.BoxSizer(wx.HORIZONTAL)
        sizer = FlexGridSizer(2, 2)
        sizer.AddGrowableCol(1)
        sizer.Add(self.st1, 0, wx.ALIGN_CENTER_VERTICAL, 3)
        sizer.Add(self.h_slider, 1,
                  wx.EXPAND | wx.ALIGN_CENTER_VERTICAL | wx.ALL, 3)
        sizer.Add(self.st2, 0, wx.ALIGN_CENTER_VERTICAL, 3)
        sizer.Add(self.v_slider, 1,
                  wx.EXPAND | wx.ALIGN_CENTER_VERTICAL | wx.ALL, 3)
        big_sizer.Add(self.use_def, 0)
        big_sizer.Add(sizer, 1, wx.EXPAND)
        big_sizer2.Add(big_sizer, 1, wx.EXPAND)
        self.SetSizer(big_sizer2, wx.EXPAND)

        self.Bind(EVT_CDS_CHANGED, self.onEvent)
        #        self.Bind(wx.EVT_SCROLL_CHANGED, self.onEvent)
        self.Bind(wx.EVT_CHECKBOX, self.onEvent)
        self.Fit()
Example #2
0
    def __init__(self, parent, id=wx.ID_ANY, *args, **kargs):
        super(marginp_widget, self).__init__(parent, id, *args, **kargs)

#        self.use_def= wx.CheckBox(self, -1, 'Use Global Setting',
#                                  (10, 10))

        st1 = wx.StaticText(self, label="   X  ")
        self.h_slider = CustomDoubleSlider(self, wx.ID_ANY)
        st2 = wx.StaticText(self, label="   Y  ")
        self.v_slider = CustomDoubleSlider(self, wx.ID_ANY)

        big_sizer = wx.BoxSizer(wx.VERTICAL)
        big_sizer2 = wx.BoxSizer(wx.HORIZONTAL)

        from ifigure.utils.wx3to4 import FlexGridSizer
        sizer = FlexGridSizer(2, 2)
        sizer.AddGrowableCol(1)
        sizer.Add(st1, 0, wx.ALIGN_CENTER_VERTICAL, 3)
        sizer.Add(self.h_slider, 1, wx.EXPAND |
                  wx.ALIGN_CENTER_VERTICAL | wx.ALL, 3)
        sizer.Add(st2, 0, wx.ALIGN_CENTER_VERTICAL, 3)
        sizer.Add(self.v_slider, 1, wx.EXPAND |
                  wx.ALIGN_CENTER_VERTICAL | wx.ALL, 3)
        big_sizer.Add(sizer, 1, wx.EXPAND)
        big_sizer2.Add(big_sizer, 1, wx.EXPAND)
        self.SetSizer(big_sizer2, wx.EXPAND)

        self.Bind(EVT_CDS_CHANGED, self.onEvent)
Example #3
0
    def __init__(self, parent):
        super(primitive_widgets, self).__init__(parent)

        from ifigure.utils.wx3to4 import FlexGridSizer
        sizer = FlexGridSizer(1, 2)

        self.SetSizer(sizer)
        self.Controls = []
        self.events = None
### list events needs to be handled ###
        self.event_obj = None
Example #4
0
    def __init__(self, parent, id, title):
        wx.Dialog.__init__(self, parent, id, title)

        box = wx.BoxSizer(wx.VERTICAL)

        from ifigure.utils.wx3to4 import FlexGridSizer
        vbox = FlexGridSizer(2, 2)

        stline1 = wx.StaticText(self, 3, 'R')
        self.sc1 = wx.SpinCtrl(self, -1, '')
        self.sc1.SetRange(1, 8)
        stline2 = wx.StaticText(self, 3, 'C')
        self.sc2 = wx.SpinCtrl(self, -1, '')
        self.sc2.SetRange(1, 8)
        vbox.Add(stline1, 1, wx.ALIGN_CENTER | wx.TOP, 10)
        vbox.Add(self.sc1, 1, wx.ALIGN_CENTER | wx.TOP, 10)
        vbox.Add(stline2, 1, wx.ALIGN_CENTER | wx.TOP, 10)
        vbox.Add(self.sc2, 1, wx.ALIGN_CENTER | wx.TOP, 10)

        sizer = self.CreateButtonSizer(wx.OK | wx.CANCEL)
        box.Add(vbox, 0, wx.ALIGN_CENTER | wx.ALL, 10)
        box.Add(sizer, 0, wx.ALIGN_CENTER | wx.ALL, 10)
        self.SetSizer(box)
        self.Fit()
        #self.Bind(wx.EVT_BUTTON, self.OnOK, id=wx.ID_OK)
        #self.Bind(wx.EVT_BUTTON, self.OnCANCEL, id=wx.ID_CANCEL)
        self.Center()
Example #5
0
    def __init__(self,
                 parent,
                 id=-1,
                 title="Enter password",
                 label="Enter Password;"):
        wx.Dialog.__init__(self,
                           parent,
                           id,
                           title,
                           style=wx.DEFAULT_DIALOG_STYLE | wx.RESIZE_BORDER)
        self.mainSizer = wx.BoxSizer(wx.VERTICAL)
        self.buttonSizer = wx.BoxSizer(wx.HORIZONTAL)
        self.label = wx.StaticText(self, label=label)

        sizer = FlexGridSizer(2, 2)
        sizer.AddGrowableCol(1, 1)
        st1 = wx.StaticText(self, label="Name")
        self.field = wx.TextCtrl(self, value="", size=(-1, -1))
        st2 = wx.StaticText(self, label="Password")
        self.field2 = wx.TextCtrl(self,
                                  value="",
                                  size=(-1, -1),
                                  style=wx.TE_PASSWORD)
        sizer.Add(st1, 0, wx.ALL, 2)
        sizer.Add(self.field, 1, wx.ALL | wx.EXPAND, 2)
        sizer.Add(st2, 0, wx.ALL, 2)
        sizer.Add(self.field2, 1, wx.ALL | wx.EXPAND, 2)

        self.okbutton = wx.Button(self, label="OK", id=wx.ID_OK)
        self.cancelbutton = wx.Button(self, label="Cancel", id=wx.ID_CANCEL)
        self.mainSizer.Add(self.label, 0, wx.ALL, 8)
        self.mainSizer.Add(sizer, 1, wx.ALL | wx.EXPAND, 2)
        self.buttonSizer.Add(self.okbutton, 0, wx.ALL, 8)
        self.buttonSizer.Add(self.cancelbutton, 0, wx.ALL, 8)
        self.mainSizer.Add(self.buttonSizer, 0, wx.ALL, 0)
        self.Bind(wx.EVT_BUTTON, self.onOK, id=wx.ID_OK)
        self.Bind(wx.EVT_BUTTON, self.onCancel, id=wx.ID_CANCEL)
        #self.Bind(wx.EVT_TEXT_ENTER, self.onOK)
        self.SetSizer(self.mainSizer)
        self.Fit()
        self.Centre()
        self.result = None