Merge pull request #1326 from PySimpleGUI/Dev-latest

Horizontal Separater Element added!
This commit is contained in:
MikeTheWatchGuy 2019-04-19 17:52:32 -04:00 committed by GitHub
commit 7ede786584
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 32 additions and 2 deletions

View File

@ -2072,6 +2072,32 @@ VSeperator = VerticalSeparator
VSep = VerticalSeparator VSep = VerticalSeparator
# ---------------------------------------------------------------------- #
# Separator #
# ---------------------------------------------------------------------- #
class HorizontalSeparator(Element):
def __init__(self, pad=None, size=(None, None), size_px=(None,None)):
'''
VerticalSeperator - A separator that spans only 1 row in a vertical fashion
:param pad:
'''
self.Orientation = 'horizontal' # for now only vertical works
self.Disabled = None
self.WxStaticLine = None # type: wx.StaticLine
super().__init__(ELEM_TYPE_SEPARATOR, pad=pad, size=size, size_px=size_px)
def __del__(self):
super().__del__()
HSeperator = HorizontalSeparator
HSep = HorizontalSeparator
# ---------------------------------------------------------------------- # # ---------------------------------------------------------------------- #
# Tab # # Tab #
# ---------------------------------------------------------------------- # # ---------------------------------------------------------------------- #
@ -5312,8 +5338,12 @@ def PackFormIntoFrame(form, containing_frame, toplevel_form):
# timeout=DEFAULT_TOOLTIP_TIME) # timeout=DEFAULT_TOOLTIP_TIME)
# ------------------------- Separator element ------------------------- # # ------------------------- Separator element ------------------------- #
elif element_type == ELEM_TYPE_SEPARATOR: elif element_type == ELEM_TYPE_SEPARATOR:
element # type: VerticalSeparator element = element # type: VerticalSeparator
element.WxStaticLine = static_line = wx.StaticLine(toplevel_form.MasterPanel, style=wx.LI_VERTICAL) if element.Orientation.lower().startswith('v'):
element.WxStaticLine = static_line = wx.StaticLine(toplevel_form.MasterPanel, style=wx.LI_VERTICAL)
else:
print('*** HORIZONTAL LINE ****')
element.WxStaticLine = static_line = wx.StaticLine(toplevel_form.MasterPanel, style=wx.LI_HORIZONTAL)
do_font_and_color(element.WxStaticLine) do_font_and_color(element.WxStaticLine)