Merge pull request #1129 from PySimpleGUI/Dev-latest

Dev latest
This commit is contained in:
MikeTheWatchGuy 2019-02-01 17:48:59 -05:00 committed by GitHub
commit f25bb9d348
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 23 additions and 12 deletions

View File

@ -103,7 +103,7 @@ DEFAULT_BUTTON_ELEMENT_SIZE = (80, 25 ) # In PIXELS
DEFAULT_MARGINS = (10, 5) # Margins for each LEFT/RIGHT margin is first term DEFAULT_MARGINS = (10, 5) # Margins for each LEFT/RIGHT margin is first term
DEFAULT_ELEMENT_PADDING = (4, 2) # Padding between elements (row, col) in pixels DEFAULT_ELEMENT_PADDING = (4, 2) # Padding between elements (row, col) in pixels
# DEFAULT_ELEMENT_PADDING = (0, 0) # Padding between elements (row, col) in pixels # DEFAULT_ELEMENT_PADDING = (0, 0) # Padding between elements (row, col) in pixels
DEFAULT_PIXELS_TO_CHARS_SCALING = (10,25) # 1 character represents x by y pixels DEFAULT_PIXELS_TO_CHARS_SCALING = (10,35) # 1 character represents x by y pixels
DEFAULT_PIXEL_TO_CHARS_CUTOFF = 12 # number of chars that triggers using pixels instead of chars DEFAULT_PIXEL_TO_CHARS_CUTOFF = 12 # number of chars that triggers using pixels instead of chars
DEFAULT_AUTOSIZE_TEXT = True DEFAULT_AUTOSIZE_TEXT = True
DEFAULT_AUTOSIZE_BUTTONS = True DEFAULT_AUTOSIZE_BUTTONS = True
@ -638,8 +638,6 @@ class Combo(Element):
self.QT_ComboBox.addItems(self.Values) self.QT_ComboBox.addItems(self.Values)
def Update(self, value=None, values=None, set_to_index=None, disabled=None, readonly=None, background_color=None, text_color=None, font=None, visible=None): def Update(self, value=None, values=None, set_to_index=None, disabled=None, readonly=None, background_color=None, text_color=None, font=None, visible=None):
if values is not None: if values is not None:
self.Values = values self.Values = values
@ -830,8 +828,8 @@ class Radio(Element):
def __init__(self, text, group_id, default=False, disabled=False, size=(None, None), auto_size_text=None, def __init__(self, text, group_id, default=False, disabled=False, size=(None, None), auto_size_text=None,
background_color=None, text_color=None, font=None, key=None, pad=None, tooltip=None, background_color=None, text_color=None, font=None, key=None, pad=None, tooltip=None,
change_submits=False, enable_events=False, visible=True, size_px=(None,None)): change_submits=False, enable_events=False, visible=True, size_px=(None,None)):
''' """
Radio Button Element
:param text: :param text:
:param group_id: :param group_id:
:param default: :param default:
@ -845,10 +843,12 @@ class Radio(Element):
:param pad: :param pad:
:param tooltip: :param tooltip:
:param change_submits: :param change_submits:
''' :param enable_events:
:param visible:
:param size_px:
"""
self.InitialState = default self.InitialState = default
self.Text = text self.Text = text
self.TKRadio = None
self.GroupID = group_id self.GroupID = group_id
self.Value = None self.Value = None
self.Disabled = disabled self.Disabled = disabled
@ -3726,7 +3726,7 @@ def create_style_from_font(font):
style = '' style = ''
style += 'font-family: %s;\n' % _font[0] style += 'font-family: %s;\n' % _font[0]
style += 'font-size: %spt;' % _font[1] style += 'font-size: %spt;\n' % _font[1]
font_items = '' font_items = ''
for item in _font[2:]: for item in _font[2:]:
if item == 'underline': if item == 'underline':
@ -3734,7 +3734,7 @@ def create_style_from_font(font):
else: else:
font_items += item + ' ' font_items += item + ' '
if font_items != '': if font_items != '':
style += 'font: %s' % font_items style += 'font: %s;\n' % (font_items)
return style return style
def set_widget_visiblity(widget, visible): def set_widget_visiblity(widget, visible):
@ -4633,7 +4633,7 @@ def PackFormIntoFrame(window, containing_frame, toplevel_win):
element.QT_QPushButton.setVisible(False) element.QT_QPushButton.setVisible(False)
qt_row_layout.addWidget(element.QT_QPushButton) qt_row_layout.addWidget(element.QT_QPushButton)
# ------------------------- INPUT (Single Line) element ------------------------- # # ------------------------- INPUT element ------------------------- #
elif element_type == ELEM_TYPE_INPUT_TEXT: elif element_type == ELEM_TYPE_INPUT_TEXT:
default_text = element.DefaultText default_text = element.DefaultText
element.QT_QLineEdit = qlineedit = QLineEdit() element.QT_QLineEdit = qlineedit = QLineEdit()
@ -7152,7 +7152,7 @@ def main():
layout = [ layout = [
[Menu(menu_def, key='_REALMENU_')], [Menu(menu_def, key='_REALMENU_')],
[Text('You are running the PySimpleGUI.py file itself', font='ANY 15')], [Text('You are running the PySimpleGUI.py file itself', font=('ANY', 15, 'Bold'), text_color='red')],
[Text('You should be importing it rather than running it', font='ANY 15')], [Text('You should be importing it rather than running it', font='ANY 15')],
# [Image(data_base64=logo, tooltip='Image', click_submits=True, key='_IMAGE_'), # [Image(data_base64=logo, tooltip='Image', click_submits=True, key='_IMAGE_'),
[Frame('Input Text Group', frame1, title_color='red', tooltip='Text Group'), Stretch()], [Frame('Input Text Group', frame1, title_color='red', tooltip='Text Group'), Stretch()],

View File

@ -91,6 +91,17 @@ PySimpleGUIWeb runs only on Python 3. Legacy Python (2.7) is not supported.
* Read with timeout = 0 * Read with timeout = 0
# Running online using repl.it
<figure class="video_container">
<iframe src="https://repl.it/@PySimpleGUI/PySimpleGUIWeb-Demos?lite=true" frameborder="0" allowfullscreen="true"> </iframe>
</figure>
<iframe height="400px" width="100%" src="https://repl.it/@PySimpleGUI/PySimpleGUIWeb-Demos?lite=true" scrolling="no" frameborder="no" allowtransparency="true" allowfullscreen="true" sandbox="allow-forms allow-pointer-lock allow-popups allow-same-origin allow-scripts allow-modals"></iframe>
# Release Notes: # Release Notes:
## 0.1.0 PySimpleGUIWeb 22-Jan-2019 ## 0.1.0 PySimpleGUIWeb 22-Jan-2019