From 4ca6771ab0cd8ea1ac610da267fb30ca787b2581 Mon Sep 17 00:00:00 2001 From: MikeTheWatchGuy <13696193+MikeTheWatchGuy@users.noreply.github.com> Date: Wed, 20 Feb 2019 08:38:16 -0500 Subject: [PATCH 1/3] readme.md updated from https://stackedit.io/ --- readme.md | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/readme.md b/readme.md index 0811e678..f4d01ce8 100644 --- a/readme.md +++ b/readme.md @@ -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 \ No newline at end of file From 7ac58296a38f03de73be6d800fa9f4e8d217486e Mon Sep 17 00:00:00 2001 From: MikeTheWatchGuy <13696193+MikeTheWatchGuy@users.noreply.github.com> Date: Wed, 20 Feb 2019 08:50:21 -0500 Subject: [PATCH 2/3] PySimpleGUIWx/readme.md updated from https://stackedit.io/ --- PySimpleGUIWx/readme.md | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/PySimpleGUIWx/readme.md b/PySimpleGUIWx/readme.md index ca20782e..03ceed96 100644 --- a/PySimpleGUIWx/readme.md +++ b/PySimpleGUIWx/readme.md @@ -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 \ No newline at end of file From 231b18127d1a8f1b765f607b6928b43e2557e31f Mon Sep 17 00:00:00 2001 From: MikeTheWatchGuy Date: Wed, 20 Feb 2019 08:52:31 -0500 Subject: [PATCH 3/3] Release 0.8.0 --- PySimpleGUIWx/PySimpleGUIWx.py | 99 +++++++++++++++++++--------------- 1 file changed, 55 insertions(+), 44 deletions(-) diff --git a/PySimpleGUIWx/PySimpleGUIWx.py b/PySimpleGUIWx/PySimpleGUIWx.py index e7912339..bcf09323 100644 --- a/PySimpleGUIWx/PySimpleGUIWx.py +++ b/PySimpleGUIWx/PySimpleGUIWx.py @@ -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 ================================================ #