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.

39 lines
1.1 KiB

  1. """
  2. Collection of Utility methods for styling the GUI
  3. """
  4. __author__ = 'Chris'
  5. import wx
  6. def MakeBold(statictext):
  7. pointsize = statictext.GetFont().GetPointSize()
  8. font = wx.Font(pointsize, wx.FONTFAMILY_DEFAULT,
  9. wx.FONTWEIGHT_NORMAL, wx.FONTWEIGHT_BOLD, False)
  10. statictext.SetFont(font)
  11. def _bold_static_text(parent, text_label):
  12. text = wx.StaticText(parent, label=text_label)
  13. font_size = text.GetFont().GetPointSize()
  14. bold = wx.Font(font_size, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_BOLD)
  15. text.SetFont(bold)
  16. return text
  17. def H1(parent, label):
  18. text = wx.StaticText(parent, label=label)
  19. font_size = text.GetFont().GetPointSize()
  20. font = wx.Font(font_size * 1.2, wx.FONTFAMILY_DEFAULT, wx.FONTWEIGHT_NORMAL, wx.FONTWEIGHT_BOLD, False)
  21. text.SetFont(font)
  22. return text
  23. def HorizontalRule(parent):
  24. line = wx.StaticLine(parent, -1, style=wx.LI_HORIZONTAL)
  25. line.SetSize((10, 10))
  26. return line
  27. def MakeDarkGrey(statictext):
  28. darkgray = (54, 54, 54)
  29. statictext.SetForegroundColour(darkgray)