mirror of https://github.com/chriskiehl/Gooey.git
8 changed files with 31 additions and 41 deletions
Split View
Diff Options
-
46gooey/gui/util/wx_util.py
-
2gooey/gui/widgets/calender_dialog.py
-
4gooey/gui/widgets/choosers.py
-
4gooey/gui/widgets/components.py
-
8gooey/gui/windows/advanced_config.py
-
4gooey/gui/windows/base_window.py
-
2gooey/gui/windows/header.py
-
2gooey/gui/windows/sidebar.py
@ -1,52 +1,42 @@ |
|||
""" |
|||
Collection of Utility methods for creating pre-styled wxWidgets items |
|||
Collection of Utility methods for creating often used, pre-styled wx Widgets |
|||
""" |
|||
|
|||
__author__ = 'Chris' |
|||
|
|||
|
|||
import wx |
|||
|
|||
|
|||
def MakeBold(statictext): |
|||
def make_bold(statictext): |
|||
pointsize = statictext.GetFont().GetPointSize() |
|||
font = wx.Font(pointsize, wx.FONTFAMILY_DEFAULT, |
|||
wx.FONTWEIGHT_NORMAL, wx.FONTWEIGHT_BOLD, False) |
|||
statictext.SetFont(font) |
|||
|
|||
def dark_grey(statictext): |
|||
darkgray = (54, 54, 54) |
|||
statictext.SetForegroundColour(darkgray) |
|||
|
|||
def _bold_static_text(parent, text_label): |
|||
text = wx.StaticText(parent, label=text_label) |
|||
font_size = text.GetFont().GetPointSize() |
|||
bold = wx.Font(font_size, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_BOLD) |
|||
text.SetFont(bold) |
|||
return text |
|||
def h1(parent, label): |
|||
return _header(parent, label, (wx.FONTFAMILY_DEFAULT, wx.FONTWEIGHT_NORMAL, wx.FONTWEIGHT_BOLD, False)) |
|||
|
|||
def h2(parent, label): |
|||
return _header(parent, label, (wx.FONTFAMILY_DEFAULT, wx.FONTWEIGHT_NORMAL, wx.FONTWEIGHT_NORMAL, False)) |
|||
|
|||
def H1(parent, label): |
|||
def _header(parent, label, styles): |
|||
text = wx.StaticText(parent, label=label) |
|||
font_size = text.GetFont().GetPointSize() |
|||
font = wx.Font(font_size * 1.2, wx.FONTFAMILY_DEFAULT, wx.FONTWEIGHT_NORMAL, wx.FONTWEIGHT_BOLD, False) |
|||
font = wx.Font(font_size * 1.2, *styles) |
|||
text.SetFont(font) |
|||
return text |
|||
|
|||
def H2(parent, label): |
|||
text = wx.StaticText(parent, label=label) |
|||
font_size = text.GetFont().GetPointSize() |
|||
font = wx.Font(font_size * 1.2, wx.FONTFAMILY_DEFAULT, wx.FONTWEIGHT_NORMAL, wx.FONTWEIGHT_NORMAL, False) |
|||
text.SetFont(font) |
|||
return text |
|||
|
|||
def HorizontalRule(parent): |
|||
line = wx.StaticLine(parent, -1, style=wx.LI_HORIZONTAL) |
|||
line.SetSize((10, 10)) |
|||
return line |
|||
def horizontal_rule(parent): |
|||
return _rule(parent, wx.LI_HORIZONTAL) |
|||
|
|||
def vertical_rule(parent): |
|||
line = wx.StaticLine(parent, -1, style=wx.LI_VERTICAL) |
|||
return _rule(parent, wx.LI_VERTICAL) |
|||
|
|||
def _rule(parent, direction): |
|||
line = wx.StaticLine(parent, -1, style=direction) |
|||
line.SetSize((10, 10)) |
|||
return line |
|||
|
|||
def MakeDarkGrey(statictext): |
|||
darkgray = (54, 54, 54) |
|||
statictext.SetForegroundColour(darkgray) |
|||
|
Write
Preview
Loading…
Cancel
Save