Merge pull request #1173 from PySimpleGUI/Dev-latest

Dev latest
This commit is contained in:
MikeTheWatchGuy 2019-02-20 08:59:10 -05:00 committed by GitHub
commit 008b3c81e5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 82 additions and 53 deletions

View File

@ -25,15 +25,16 @@ import time
21-Dec-2018
Welcome to the "core" PySimpleGUIWx port!
'##:::::'##:'##::::'##:'########::'##:::'##:'########:'##::::'##::'#######::'##::: ##:
##:'##: ##:. ##::'##:: ##.... ##:. ##:'##::... ##..:: ##:::: ##:'##.... ##: ###:: ##:
##: ##: ##::. ##'##::: ##:::: ##::. ####:::::: ##:::: ##:::: ##: ##:::: ##: ####: ##:
##: ##: ##:::. ###:::: ########::::. ##::::::: ##:::: #########: ##:::: ##: ## ## ##:
##: ##: ##::: ## ##::: ##.....:::::: ##::::::: ##:::: ##.... ##: ##:::: ##: ##. ####:
##: ##: ##:: ##:. ##:: ##::::::::::: ##::::::: ##:::: ##:::: ##: ##:::: ##: ##:. ###:
. ###. ###:: ##:::. ##: ##::::::::::: ##::::::: ##:::: ##:::: ##:. #######:: ##::. ##:
:...::...:::..:::::..::..::::::::::::..::::::::..:::::..:::::..:::.......:::..::::..::
::: ::: ::: ::: ::::::::: ::: ::: ::::::::::: ::: ::: :::::::: :::: :::
:+: :+: :+: :+: :+: :+: :+: :+: :+: :+: :+: :+: :+: :+:+: :+:
+:+ +:+ +:+ +:+ +:+ +:+ +:+ +:+ +:+ +:+ +:+ +:+ +:+ :+:+:+ +:+
+#+ +:+ +#+ +#++:+ +#++:++#+ +#++: +#+ +#++:++#++ +#+ +:+ +#+ +:+ +#+
+#+ +#+#+ +#+ +#+ +#+ +#+ +#+ +#+ +#+ +#+ +#+ +#+ +#+ +#+#+#
#+#+# #+#+# #+# #+# #+# #+# #+# #+# #+# #+# #+# #+# #+#+#
### ### ### ### ### ### ### ### ### ######## ### ####
This marks the 3rd port of the PySimpleGUI GUI SDK. Each port gets a little better than
the previous, in theory.
@ -1042,20 +1043,24 @@ class Multiline(Element):
def Update(self, value=None, disabled=None, append=False, background_color=None, text_color=None, font=None, visible=None):
if value is not None and not append:
self.WxTextCtrl.SetLabel(value)
elif value is not None and append:
self.WxTextCtrl.AppendText(value)
if background_color is not None:
self.WxTextCtrl.SetBackgroundColour(background_color)
if text_color is not None:
self.WxTextCtrl.SetForegroundColour(text_color)
if font is not None:
self.WxTextCtrl.SetFont(font)
if disabled:
self.WxTextCtrl.Enable(True)
elif disabled is False:
self.WxTextCtrl.Enable(False)
try: # added in case the widget has already been deleted for some readon.
if value is not None and not append:
self.WxTextCtrl.SetLabel(value)
elif value is not None and append:
self.WxTextCtrl.AppendText(value)
if background_color is not None:
self.WxTextCtrl.SetBackgroundColour(background_color)
if text_color is not None:
self.WxTextCtrl.SetForegroundColour(text_color)
if font is not None:
self.WxTextCtrl.SetFont(font)
if disabled:
self.WxTextCtrl.Enable(True)
elif disabled is False:
self.WxTextCtrl.Enable(False)
except:
pass
super().Update(self.WxTextCtrl, background_color=background_color, text_color=text_color, font=font, visible=visible)
#
@ -1177,7 +1182,7 @@ class Text(Element):
:param visible:
:param size_px:
"""
self.DisplayText = text
self.DisplayText = str(text)
self.TextColor = text_color if text_color else DEFAULT_TEXT_COLOR
self.Justification = justification
self.Relief = relief
@ -1411,6 +1416,7 @@ class Button(Element):
self.QT_QPushButton = None
self.ColorChosen = None
self.Relief = None
self.WxButton = None # type: wx.Button
# self.temp_size = size if size != (NONE, NONE) else
super().__init__(ELEM_TYPE_BUTTON, size=size, font=font, pad=pad, key=key, tooltip=tooltip, text_color=self.TextColor, background_color=self.BackgroundColor, visible=visible, size_px=size_px)
@ -1585,30 +1591,13 @@ class Button(Element):
def Update(self, text=None, button_color=(None, None), disabled=None, image_data=None, image_filename=None, font=None, visible=None):
if text is not None:
self.QT_QPushButton.setText(str(text))
self.WxButton.SetLabelText(text)
self.ButtonText = text
if self.ParentForm.Font and (self.Font == DEFAULT_FONT or not self.Font):
font = self.ParentForm.Font
elif self.Font is not None:
font = self.Font
else:
font = DEFAULT_FONT
fg = bg = None
if button_color != (None, None):
self.ButtonColor = button_color
fg, bg = button_color
if self.Disabled != disabled and disabled is not None:
if not disabled: # if enabling buttons, set the color
fg, bg = self.ButtonColor
self.Disabled = disabled
if disabled:
self.QT_QPushButton.setDisabled(True)
else:
self.QT_QPushButton.setDisabled(False)
# fg, bg = self.ButtonColor
# print(f'Button update fg, bg {fg}, {bg}')
super().Update(self.WxButton, background_color=bg, text_color=fg, font=font, visible=visible)
super().Update(self.WxButton, background_color=bg, text_color=fg, font=font, visible=visible, disabled=disabled)
def GetText(self):
@ -3992,7 +3981,11 @@ def BuildResultsForSubform(form, initialize_only, top_level_form):
except:
value = 0
elif element.Type == ELEM_TYPE_INPUT_MULTILINE:
value = element.WxTextCtrl.GetValue()
try:
value = element.WxTextCtrl.GetValue()
except:
pass
if not top_level_form.NonBlocking and not element.do_not_clear and not top_level_form.ReturnKeyboardEvents:
element.WxTextCtrl.SetValue('')
elif element.Type == ELEM_TYPE_TAB_GROUP:
@ -4279,6 +4272,24 @@ else:
# # # # # # # # # # # # # ##
## ## # # # # # # # #### # #
# My crappy WxPython code
# ░░░░░░░░░░░█▀▀░░█░░░░░░
# ░░░░░░▄▀▀▀▀░░░░░█▄▄░░░░
# ░░░░░░█░█░░░░░░░░░░▐░░░
# ░░░░░░▐▐░░░░░░░░░▄░▐░░░
# ░░░░░░█░░░░░░░░▄▀▀░▐░░░
# ░░░░▄▀░░░░░░░░▐░▄▄▀░░░░
# ░░▄▀░░░▐░░░░░█▄▀░▐░░░░░
# ░░█░░░▐░░░░░░░░▄░█░░░░░
# ░░░█▄░░▀▄░░░░▄▀▐░█░░░░░
# ░░░█▐▀▀▀░▀▀▀▀░░▐░█░░░░░
# ░░▐█▐▄░░▀░░░░░░▐░█▄▄░░░
# ░░░▀▀▄░░░░░░░░▄▐▄▄▄▀░░░
# ░░░░░░░░░░░░░░░░░░░░░░░
# ------------------------------------------------------------------------------------------------------------------ #
# ------------------------------------------------------------------------------------------------------------------ #
# ===================================== WxPython CODE STARTS HERE ================================================ #

View File

@ -1,14 +1,13 @@
![pysimplegui_logo](https://user-images.githubusercontent.com/13696193/43165867-fe02e3b2-8f62-11e8-9fd0-cc7c86b11772.png)
![Downloads](http://pepy.tech/badge/pysimpleguiwx)](http://pepy.tech/project/pysimplegui)
![Downloads](http://pepy.tech/badge/pysimpleguiwx)
![Awesome Meter](https://img.shields.io/badge/Awesome_meter-1000-yellow.svg)
![Python Version](https://img.shields.io/badge/Python-3.x-yellow.svg)
![Python Version](https://img.shields.io/badge/PySimpleGUIWx_For_Python_3.x_Version-0.7.0-orange.svg?longCache=true&style=for-the-badge)
![Python Version](https://img.shields.io/badge/PySimpleGUIWx_For_Python_3.x_Version-0.8.0-orange.svg?longCache=true&style=for-the-badge)
@ -337,6 +336,16 @@ Starting with release 0.4.0, most of the Popup functions work. This means you c
* Popup non_blocking - returns window and button not just button
* More comprehensive test harness when running PySimpleGUIWx.py
### 0.8.0 20-Feb-2019 PySimpleGUIWx
* Big Try/Except block around Update method for multiline in case window closed
* Text - convert incoming text to string right away
* Text.Update - convert incoming value to string
* Completed Button.Update method. Can now change text, color, etc.
* Added Try around reading multiline input value - not sure why needed
* OneLineProgressMeter - can update text on every call now
# Design
# Author
@ -348,5 +357,5 @@ Starting with release 0.4.0, most of the Popup functions work. This means you c
# Acknowledgments
<!--stackedit_data:
eyJoaXN0b3J5IjpbODg2MzA1Mjk2XX0=
eyJoaXN0b3J5IjpbLTIxNDIwNTI0ODQsODg2MzA1Mjk2XX0=
-->

View File

@ -4893,6 +4893,15 @@ Emergency patch release... going out same day as previous release
* PopupAnimated - A popup call for showing "loading" type of windows
# 3.25 & 1.25 20-Feb-2019
* Comments :-)
* Convert Text to string right away
* Caught exceptions when main program shut down with X
* Caught exceptions in all of the graphics primitives
* Added parameter exportselection=False to Listbox so can use multiple listboxes
* OneLineProgressMeter - Can now change the text on every call if desired
### Upcoming
Make suggestions people! Future release features
@ -4957,9 +4966,9 @@ GNU Lesser General Public License (LGPL 3) +
#### SORRY!! Will add these back. Lost due to file length limitation
<!--stackedit_data:
eyJoaXN0b3J5IjpbLTEzOTYyOTUyMjMsMjA1MzEyNTE0OSwtMT
U3ODc0NjU4OCwyNjA1ODQ4MTQsMTEwMjA4ODMzMywxNjc5ODUw
OTkyLC0xNDYxNDI4MSwtNjA2MzcxMTgsLTUwOTM1OTEyMywtMj
Q4OTc2MjksMTMwNzY5MjU5LC0yOTY3ODM1NSwtNzc0MDc0MjMw
LDI2NjM2NDQxNyw0NDk0MzMyNDMsLTExNDg0OTA2MjNdfQ==
eyJoaXN0b3J5IjpbNTE5MDU1OTQsMjA1MzEyNTE0OSwtMTU3OD
c0NjU4OCwyNjA1ODQ4MTQsMTEwMjA4ODMzMywxNjc5ODUwOTky
LC0xNDYxNDI4MSwtNjA2MzcxMTgsLTUwOTM1OTEyMywtMjQ4OT
c2MjksMTMwNzY5MjU5LC0yOTY3ODM1NSwtNzc0MDc0MjMwLDI2
NjM2NDQxNyw0NDk0MzMyNDMsLTExNDg0OTA2MjNdfQ==
-->