Exemplo n.º 1
0
    def __init__(self,
                 parent,
                 label='',
                 label_size=(200, -1),
                 label_style='normal',
                 ctrl_size=(100, -1),
                 direction='horizontal',
                 items={},
                 **kwargs):
        CtrlBase.__init__(self,
                          parent=parent,
                          label_style=label_style,
                          **kwargs)

        if direction == 'horizontal':
            radio_group = wx.FlexGridSizer(1, len(items) + 1, 0, 10)
        else:
            radio_group = wx.FlexGridSizer(len(items) + 1, 1, 0, 10)
        if label != '':
            self.txt = wx.StaticText(self, label=label, size=label_size)
            self.txt.SetFont(self.font)
            radio_group.Add(self.txt, flag=wx.ALIGN_CENTER_VERTICAL)

        for key, value in six.iteritems(items):
            button = wx.RadioButton(self, id=wx.ID_ANY, label=value)
            radio_group.Add(button)
            self.__setattr__(key, button)

        self.SetSizer(radio_group)
        setup_tooltip(self)
Exemplo n.º 2
0
  def __init__(self, parent, items,
               label='',
               label_size=(100, -1),
               label_style='normal',
               sub_labels=[],
               ctrl_size=(300, -1),
               **kwargs):

    CtrlBase.__init__(self, parent=parent, label_style=label_style, **kwargs)

    if label != '':
      opt_box = wx.FlexGridSizer(1, len(items) * 2 + 1, 0, 10)
      self.txt = wx.StaticText(self, label=label, size=label_size)
      self.txt.SetFont(self.font)
      opt_box.Add(self.txt, flag=wx.ALIGN_CENTER_VERTICAL)
    else:
      opt_box = wx.FlexGridSizer(1, len(items) * 2, 0, 10)

    for key, value in items:
      if sub_labels != []:
        sub_label = sub_labels[items.index((key, value))]
      else:
        sub_label = key

      opt_label = wx.StaticText(self, id=wx.ID_ANY, label=sub_label)
      opt_box.Add(opt_label, flag=wx.ALIGN_CENTER_VERTICAL)

      item = TextCtrl(self, name = self.Name+"_"+key, id=wx.ID_ANY, size=ctrl_size,
                      style=wx.TE_PROCESS_ENTER)
      item.SetValue(str(value))
      opt_box.Add(item, flag=wx.ALIGN_CENTER_VERTICAL)
      self.__setattr__(key, item)

    self.SetSizer(opt_box)
    setup_tooltip(self)
Exemplo n.º 3
0
 def __init__(self, *args, **kwargs):
     super(RichTextCtrl, self).__init__(*args, **kwargs)
     setup_tooltip(self)
Exemplo n.º 4
0
 def __init__(self, *args, **kwargs):
     super(Choice, self).__init__(*args, **kwargs)
     setup_tooltip(self)
Exemplo n.º 5
0
 def __init__(self, *args, **kwargs):
     super(BitmapButton, self).__init__(*args, **kwargs)
     setup_tooltip(self)
Exemplo n.º 6
0
 def __init__(self, *args, **kwargs):
     super(IntFloatSpin, self).__init__(*args, **kwargs)
     setup_tooltip(self)