You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

52 lines
1.4 KiB

  1. '''
  2. Created on Dec 9, 2013
  3. @author: Chris
  4. '''
  5. import wx
  6. from gooey.gui.lang import i18n
  7. from gooey.gui.option_reader import OptionReader
  8. class BasicConfigPanel(wx.Panel, OptionReader):
  9. def __init__(self, parent, **kwargs):
  10. wx.Panel.__init__(self, parent, **kwargs)
  11. self.header_msg = None
  12. self.cmd_textbox = None
  13. self._init_properties()
  14. self._init_components()
  15. self._do_layout()
  16. def _init_components(self):
  17. self.header_msg = self._bold_static_text(i18n.translate('simple_config'))
  18. self.cmd_textbox = wx.TextCtrl(self, -1, "")
  19. def _init_properties(self):
  20. self.SetBackgroundColour('#F0F0F0')
  21. def _do_layout(self):
  22. sizer = wx.BoxSizer(wx.VERTICAL)
  23. sizer.AddSpacer(50)
  24. sizer.Add(self.header_msg, 0, wx.LEFT, 20)
  25. sizer.AddSpacer(10)
  26. h_sizer = wx.BoxSizer(wx.HORIZONTAL)
  27. h_sizer.Add(self.cmd_textbox, 1, wx.ALL | wx.EXPAND)
  28. sizer.Add(h_sizer, 0, wx.LEFT | wx.RIGHT | wx.BOTTOM | wx.EXPAND, 20)
  29. self.SetSizer(sizer)
  30. def _bold_static_text(self, text_label):
  31. text = wx.StaticText(self, label=text_label)
  32. font_size = text.GetFont().GetPointSize()
  33. bold = wx.Font(font_size, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_BOLD)
  34. text.SetFont(bold)
  35. return text
  36. def GetOptions(self):
  37. return self.cmd_textbox.GetValue()
  38. def RegisterController(self, controller):
  39. pass