Merge pull request #2489 from PySimpleGUI/Dev-latest

Release 4.15.0
This commit is contained in:
PySimpleGUI 2020-01-08 23:01:34 -05:00 committed by GitHub
commit f1713e53f8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 167 additions and 19 deletions

View File

@ -1,6 +1,6 @@
#!/usr/bin/python3 #!/usr/bin/python3
version = __version__ = "4.14.1.11 Unreleased - added events for Calendar button but may remove, changed how bring_to_front works on Windows, SetIcon bug fix, Fix for closing window with X on Linux - requires update, allow progress bar values > max, checkbox & radio color computation, changed all 'white' and 'black' in themes to hex, extend_layout, added delete method for Output element, fix for closing debug window with an X in some circumstances, theme text elem background color" version = __version__ = "4.15.0 Released 08-Jan-2020"
port = 'PySimpleGUI' port = 'PySimpleGUI'
@ -1924,8 +1924,6 @@ class Text(Element):
self.RightClickMenu = right_click_menu self.RightClickMenu = right_click_menu
self.TKRightClickMenu = None self.TKRightClickMenu = None
self.BorderWidth = border_width self.BorderWidth = border_width
# if text == '' and size == (None, None):
# size = DEFAULT_ELEMENT_SIZE
super().__init__(ELEM_TYPE_TEXT, size, auto_size_text, background_color=bg, font=font if font else DEFAULT_FONT, super().__init__(ELEM_TYPE_TEXT, size, auto_size_text, background_color=bg, font=font if font else DEFAULT_FONT,
text_color=self.TextColor, pad=pad, key=key, tooltip=tooltip, visible=visible, metadata=metadata) text_color=self.TextColor, pad=pad, key=key, tooltip=tooltip, visible=visible, metadata=metadata)
@ -7325,7 +7323,7 @@ def DummyButton(button_text, image_filename=None, image_data=None, image_size=(N
# ------------------------- Calendar Chooser Button lazy function ------------------------- # # ------------------------- Calendar Chooser Button lazy function ------------------------- #
def CalendarButton(button_text, target=(None, None), close_when_date_chosen=True, default_date_m_d_y=(None, None, None), def CalendarButton(button_text, target=(None, None), close_when_date_chosen=True, default_date_m_d_y=(None, None, None),
image_filename=None, image_data=None, image_size=(None, None), image_filename=None, image_data=None, image_size=(None, None),
image_subsample=None, tooltip=None, border_width=None, size=(None, None), auto_size_button=None, enable_events=None, image_subsample=None, tooltip=None, border_width=None, size=(None, None), auto_size_button=None,
button_color=None, disabled=False, font=None, bind_return_key=False, focus=False, pad=None, button_color=None, disabled=False, font=None, bind_return_key=False, focus=False, pad=None,
key=None, locale=None, format=None, metadata=None): key=None, locale=None, format=None, metadata=None):
""" """
@ -7356,7 +7354,7 @@ def CalendarButton(button_text, target=(None, None), close_when_date_chosen=True
""" """
button = Button(button_text=button_text, button_type=BUTTON_TYPE_CALENDAR_CHOOSER, target=target, button = Button(button_text=button_text, button_type=BUTTON_TYPE_CALENDAR_CHOOSER, target=target,
image_filename=image_filename, image_data=image_data, image_size=image_size, image_filename=image_filename, image_data=image_data, image_size=image_size,
image_subsample=image_subsample, border_width=border_width, tooltip=tooltip, size=size, enable_events=enable_events, image_subsample=image_subsample, border_width=border_width, tooltip=tooltip, size=size,
auto_size_button=auto_size_button, button_color=button_color, font=font, disabled=disabled, auto_size_button=auto_size_button, button_color=button_color, font=font, disabled=disabled,
bind_return_key=bind_return_key, focus=focus, pad=pad, key=key, metadata=metadata) bind_return_key=bind_return_key, focus=focus, pad=pad, key=key, metadata=metadata)
button.CalendarCloseWhenChosen = close_when_date_chosen button.CalendarCloseWhenChosen = close_when_date_chosen

View File

@ -2,7 +2,7 @@
[![Downloads](http://pepy.tech/badge/pysimplegui)](http://pepy.tech/project/pysimplegui) tkinter [![Downloads](http://pepy.tech/badge/pysimplegui)](http://pepy.tech/project/pysimplegui) tkinter
[![Downloads ](https://pepy.tech/badge/pysimplegui27)](https://pepy.tech/project/pysimplegui27) tkinter 2.7 (WARNING - DISAPPEARING Entirely on 12/31/2019!!!) [![Downloads ](https://pepy.tech/badge/pysimplegui27)](https://pepy.tech/project/pysimplegui27) tkinter 2.7
[![Downloads](https://pepy.tech/badge/pysimpleguiqt)](https://pepy.tech/project/pysimpleguiqt) Qt [![Downloads](https://pepy.tech/badge/pysimpleguiqt)](https://pepy.tech/project/pysimpleguiqt) Qt
@ -14,8 +14,7 @@
![Awesome Meter](https://img.shields.io/badge/Awesome_meter-100-yellow.svg) ![Awesome Meter](https://img.shields.io/badge/Awesome_meter-100-yellow.svg)
![Python Version](https://img.shields.io/badge/Python-2.7_3.x-yellow.svg) ![Python Version](https://img.shields.io/badge/Python-2.7_3.x-yellow.svg)
![Python Version](https://img.shields.io/badge/PySimpleGUI_For_Python_3.x_Version-4.14.0-red.svg?longCache=true&style=for-the-badge) ![Python Version](https://img.shields.io/badge/PySimpleGUI_For_Python_3.x_Version-4.15.0-red.svg?longCache=true&style=for-the-badge)
![Python Version](https://img.shields.io/badge/PySimpleGUI_For_Python_2.7_Version-2.4.1-blue.svg?longCache=true&style=for-the-badge)
![Python Version](https://img.shields.io/badge/PySimpleGUIQt_Version-0.30.0-orange.svg?longCache=true&style=for-the-badge) ![Python Version](https://img.shields.io/badge/PySimpleGUIQt_Version-0.30.0-orange.svg?longCache=true&style=for-the-badge)
![Python Version](https://img.shields.io/badge/PySimpleGUIWx_version-0.14.0-orange.svg?longCache=true&style=for-the-badge) ![Python Version](https://img.shields.io/badge/PySimpleGUIWx_version-0.14.0-orange.svg?longCache=true&style=for-the-badge)
@ -7391,7 +7390,8 @@ DrawArc(top_left,
extent, extent,
start_angle, start_angle,
style=None, style=None,
arc_color="black") arc_color="black",
line_width=1)
``` ```
Parameter Descriptions: Parameter Descriptions:
@ -7784,6 +7784,22 @@ Parameter Descriptions:
|---|---| |---|---|
|event|(unknown) Not used in this function.| |event|(unknown) Not used in this function.|
### change_coordinates
Changes the corrdinate system to a new one. The same 2 points in space are used to define the coorinate
system - the bottom left and the top right values of your graph.
```
change_coordinates(graph_bottom_left, graph_top_right)
```
Parameter Descriptions:
|Name|Meaning|
|---|---|
|graph_bottom_left|Tuple[int, int] (x,y) The bottoms left corner of your coordinate system|
|graph_top_right|Tuple[int, int] (x,y) The top right corner of your coordinate system|
### delete_figure ### delete_figure
Remove from the Graph the figure represented by id. The id is given to you anytime you call a drawing primitive Remove from the Graph the figure represented by id. The id is given to you anytime you call a drawing primitive
@ -7808,7 +7824,8 @@ draw_arc(top_left,
extent, extent,
start_angle, start_angle,
style=None, style=None,
arc_color="black") arc_color="black",
line_width=1)
``` ```
Parameter Descriptions: Parameter Descriptions:
@ -14177,6 +14194,23 @@ Enables the internal debugger. By default, the debugger IS enabled
enable_debugger() enable_debugger()
``` ```
### extend_layout
Adds new rows to an existing container element inside of this window
```
extend_layout(container, rows)
```
Parameter Descriptions:
|Name|Meaning|
|---|---|
|container|(Union[Frame, Column, Tab]) - The container Element the layout will be placed inside of|
|rows|(List[List[Element]]) - The layout to be added|
|||
| **return** | (Window) self so could be chained |
### fill ### fill
Fill in elements that are input fields with data based on a 'values dictionary' Fill in elements that are input fields with data based on a 'values dictionary'
@ -15846,6 +15880,10 @@ Parameter Descriptions:
|size|Tuple[int, int] (w,h) w=characters-wide, h=rows-high (Default value = DEFAULT_PROGRESS_BAR_SIZE)| |size|Tuple[int, int] (w,h) w=characters-wide, h=rows-high (Default value = DEFAULT_PROGRESS_BAR_SIZE)|
|border_width|width of border around element| |border_width|width of border around element|
|grab_anywhere|If True can grab anywhere to move the window (Default = False)| |grab_anywhere|If True can grab anywhere to move the window (Default = False)|
|||
| **return** | (bool) True if updated successfully. False if user closed the meter with the X or Cancel button |
Cancels and closes a previously created One Line Progress Meter window
``` ```
OneLineProgressMeterCancel(key) OneLineProgressMeterCancel(key)
@ -15855,7 +15893,7 @@ Parameter Descriptions:
|Name|Meaning| |Name|Meaning|
|---|---| |---|---|
|key|Used with window.FindElement and with return values to uniquely identify this element| |key|Key used when meter was created|
``` ```
one_line_progress_meter(title, one_line_progress_meter(title,
@ -15886,6 +15924,10 @@ Parameter Descriptions:
|size|Tuple[int, int] (w,h) w=characters-wide, h=rows-high (Default value = DEFAULT_PROGRESS_BAR_SIZE)| |size|Tuple[int, int] (w,h) w=characters-wide, h=rows-high (Default value = DEFAULT_PROGRESS_BAR_SIZE)|
|border_width|width of border around element| |border_width|width of border around element|
|grab_anywhere|If True can grab anywhere to move the window (Default = False)| |grab_anywhere|If True can grab anywhere to move the window (Default = False)|
|||
| **return** | (bool) True if updated successfully. False if user closed the meter with the X or Cancel button |
Cancels and closes a previously created One Line Progress Meter window
``` ```
one_line_progress_meter_cancel(key) one_line_progress_meter_cancel(key)
@ -15895,7 +15937,7 @@ Parameter Descriptions:
|Name|Meaning| |Name|Meaning|
|---|---| |---|---|
|key|Used with window.FindElement and with return values to uniquely identify this element| |key|Key used when meter was created|
## Popup Functions ## Popup Functions
@ -18001,6 +18043,12 @@ Sets/Returns the text color currently in use
theme_text_color(color=None) -> (str) - color string of the text color currently in use theme_text_color(color=None) -> (str) - color string of the text color currently in use
``` ```
Sets/Returns the background color for text elements
```
theme_text_element_background_color(color=None) -> (str) - color string of the text background color currently in use
```
## Old Themes (Look and Feel) - Replaced by theme() ## Old Themes (Look and Feel) - Replaced by theme()
Change the "color scheme" of all future PySimpleGUI Windows. Change the "color scheme" of all future PySimpleGUI Windows.
@ -19378,6 +19426,33 @@ THEMES!
* Tree heading font now defaults correctly * Tree heading font now defaults correctly
* Renamed DebugWin to _DebugWin to discourage use * Renamed DebugWin to _DebugWin to discourage use
## 4.15.0 PySimpleGUI 08-Jan-2020
Dynamic Window Layouts! Extend your layouts with `Window.extend_layout`
Lots of fixes
* Window.extend_layout
* Graph.change_coordinates - realtime change of coordinate systems for the Graph element
* theme_text_element_background_color - new function to expose this setting
* Radio & Checkbox colors changed to be ligher/darker than background
* Progress bar - allow updates of value > max value
* Output element does deletes now so that cleanup works. Can use in multiple windows as a result
* DrawArc (draw_arc) - New width / line width parameter
* RGB does more error checking, converts types
* More descriptive errors for find element
* popup_error used interally now sets keep on top
* Element Re-use wording changed so that it's clear the element is the problem not the layout when re-use detected
* Window.Close (Window.close) - fix for not immediately seeing the window disappear on Linux when clicking "X"
* Window.BringToFront (bring_to_front) - on Windows needed to use topmost to bring window to front insteade of lift
* Multiline Scrollbar - removed the scrollbar color. It doesn't work on Windows so keeping consistent
* Changed how Debug Windows are created. Uses finalize now instead of the read non-blocking
* Fix for Debug Window being closed by X causing main window to also close
* Changed all "black" and "white" in the Look and Feel table to #000000 and #FFFFFF
* Added new color processing functions for internal use (hsl and hsv related)
* popup - extended the automatic wrapping capabilities to messages containing \n
* Test harness uses a nicer colors for event, value print outs.
* _timeit decorator for timing functions
### Upcoming ### Upcoming
There will always be overlapping work as the ports will never actually be "complete" as there's always something new that can be built. However there's a definition for the base functionality for PySimpleGUI. This is what is being strived for with the currnt ports that are underway. There will always be overlapping work as the ports will never actually be "complete" as there's always something new that can be built. However there's a definition for the base functionality for PySimpleGUI. This is what is being strived for with the currnt ports that are underway.

View File

@ -2,7 +2,7 @@
[![Downloads](http://pepy.tech/badge/pysimplegui)](http://pepy.tech/project/pysimplegui) tkinter [![Downloads](http://pepy.tech/badge/pysimplegui)](http://pepy.tech/project/pysimplegui) tkinter
[![Downloads ](https://pepy.tech/badge/pysimplegui27)](https://pepy.tech/project/pysimplegui27) tkinter 2.7 (WARNING - DISAPPEARING Entirely on 12/31/2019!!!) [![Downloads ](https://pepy.tech/badge/pysimplegui27)](https://pepy.tech/project/pysimplegui27) tkinter 2.7
[![Downloads](https://pepy.tech/badge/pysimpleguiqt)](https://pepy.tech/project/pysimpleguiqt) Qt [![Downloads](https://pepy.tech/badge/pysimpleguiqt)](https://pepy.tech/project/pysimpleguiqt) Qt
@ -14,8 +14,7 @@
![Awesome Meter](https://img.shields.io/badge/Awesome_meter-100-yellow.svg) ![Awesome Meter](https://img.shields.io/badge/Awesome_meter-100-yellow.svg)
![Python Version](https://img.shields.io/badge/Python-2.7_3.x-yellow.svg) ![Python Version](https://img.shields.io/badge/Python-2.7_3.x-yellow.svg)
![Python Version](https://img.shields.io/badge/PySimpleGUI_For_Python_3.x_Version-4.14.0-red.svg?longCache=true&style=for-the-badge) ![Python Version](https://img.shields.io/badge/PySimpleGUI_For_Python_3.x_Version-4.15.0-red.svg?longCache=true&style=for-the-badge)
![Python Version](https://img.shields.io/badge/PySimpleGUI_For_Python_2.7_Version-2.4.1-blue.svg?longCache=true&style=for-the-badge)
![Python Version](https://img.shields.io/badge/PySimpleGUIQt_Version-0.30.0-orange.svg?longCache=true&style=for-the-badge) ![Python Version](https://img.shields.io/badge/PySimpleGUIQt_Version-0.30.0-orange.svg?longCache=true&style=for-the-badge)
![Python Version](https://img.shields.io/badge/PySimpleGUIWx_version-0.14.0-orange.svg?longCache=true&style=for-the-badge) ![Python Version](https://img.shields.io/badge/PySimpleGUIWx_version-0.14.0-orange.svg?longCache=true&style=for-the-badge)
@ -7391,7 +7390,8 @@ DrawArc(top_left,
extent, extent,
start_angle, start_angle,
style=None, style=None,
arc_color="black") arc_color="black",
line_width=1)
``` ```
Parameter Descriptions: Parameter Descriptions:
@ -7784,6 +7784,22 @@ Parameter Descriptions:
|---|---| |---|---|
|event|(unknown) Not used in this function.| |event|(unknown) Not used in this function.|
### change_coordinates
Changes the corrdinate system to a new one. The same 2 points in space are used to define the coorinate
system - the bottom left and the top right values of your graph.
```
change_coordinates(graph_bottom_left, graph_top_right)
```
Parameter Descriptions:
|Name|Meaning|
|---|---|
|graph_bottom_left|Tuple[int, int] (x,y) The bottoms left corner of your coordinate system|
|graph_top_right|Tuple[int, int] (x,y) The top right corner of your coordinate system|
### delete_figure ### delete_figure
Remove from the Graph the figure represented by id. The id is given to you anytime you call a drawing primitive Remove from the Graph the figure represented by id. The id is given to you anytime you call a drawing primitive
@ -7808,7 +7824,8 @@ draw_arc(top_left,
extent, extent,
start_angle, start_angle,
style=None, style=None,
arc_color="black") arc_color="black",
line_width=1)
``` ```
Parameter Descriptions: Parameter Descriptions:
@ -14177,6 +14194,23 @@ Enables the internal debugger. By default, the debugger IS enabled
enable_debugger() enable_debugger()
``` ```
### extend_layout
Adds new rows to an existing container element inside of this window
```
extend_layout(container, rows)
```
Parameter Descriptions:
|Name|Meaning|
|---|---|
|container|(Union[Frame, Column, Tab]) - The container Element the layout will be placed inside of|
|rows|(List[List[Element]]) - The layout to be added|
|||
| **return** | (Window) self so could be chained |
### fill ### fill
Fill in elements that are input fields with data based on a 'values dictionary' Fill in elements that are input fields with data based on a 'values dictionary'
@ -15846,6 +15880,10 @@ Parameter Descriptions:
|size|Tuple[int, int] (w,h) w=characters-wide, h=rows-high (Default value = DEFAULT_PROGRESS_BAR_SIZE)| |size|Tuple[int, int] (w,h) w=characters-wide, h=rows-high (Default value = DEFAULT_PROGRESS_BAR_SIZE)|
|border_width|width of border around element| |border_width|width of border around element|
|grab_anywhere|If True can grab anywhere to move the window (Default = False)| |grab_anywhere|If True can grab anywhere to move the window (Default = False)|
|||
| **return** | (bool) True if updated successfully. False if user closed the meter with the X or Cancel button |
Cancels and closes a previously created One Line Progress Meter window
``` ```
OneLineProgressMeterCancel(key) OneLineProgressMeterCancel(key)
@ -15855,7 +15893,7 @@ Parameter Descriptions:
|Name|Meaning| |Name|Meaning|
|---|---| |---|---|
|key|Used with window.FindElement and with return values to uniquely identify this element| |key|Key used when meter was created|
``` ```
one_line_progress_meter(title, one_line_progress_meter(title,
@ -15886,6 +15924,10 @@ Parameter Descriptions:
|size|Tuple[int, int] (w,h) w=characters-wide, h=rows-high (Default value = DEFAULT_PROGRESS_BAR_SIZE)| |size|Tuple[int, int] (w,h) w=characters-wide, h=rows-high (Default value = DEFAULT_PROGRESS_BAR_SIZE)|
|border_width|width of border around element| |border_width|width of border around element|
|grab_anywhere|If True can grab anywhere to move the window (Default = False)| |grab_anywhere|If True can grab anywhere to move the window (Default = False)|
|||
| **return** | (bool) True if updated successfully. False if user closed the meter with the X or Cancel button |
Cancels and closes a previously created One Line Progress Meter window
``` ```
one_line_progress_meter_cancel(key) one_line_progress_meter_cancel(key)
@ -15895,7 +15937,7 @@ Parameter Descriptions:
|Name|Meaning| |Name|Meaning|
|---|---| |---|---|
|key|Used with window.FindElement and with return values to uniquely identify this element| |key|Key used when meter was created|
## Popup Functions ## Popup Functions
@ -18001,6 +18043,12 @@ Sets/Returns the text color currently in use
theme_text_color(color=None) -> (str) - color string of the text color currently in use theme_text_color(color=None) -> (str) - color string of the text color currently in use
``` ```
Sets/Returns the background color for text elements
```
theme_text_element_background_color(color=None) -> (str) - color string of the text background color currently in use
```
## Old Themes (Look and Feel) - Replaced by theme() ## Old Themes (Look and Feel) - Replaced by theme()
Change the "color scheme" of all future PySimpleGUI Windows. Change the "color scheme" of all future PySimpleGUI Windows.
@ -19378,6 +19426,33 @@ THEMES!
* Tree heading font now defaults correctly * Tree heading font now defaults correctly
* Renamed DebugWin to _DebugWin to discourage use * Renamed DebugWin to _DebugWin to discourage use
## 4.15.0 PySimpleGUI 08-Jan-2020
Dynamic Window Layouts! Extend your layouts with `Window.extend_layout`
Lots of fixes
* Window.extend_layout
* Graph.change_coordinates - realtime change of coordinate systems for the Graph element
* theme_text_element_background_color - new function to expose this setting
* Radio & Checkbox colors changed to be ligher/darker than background
* Progress bar - allow updates of value > max value
* Output element does deletes now so that cleanup works. Can use in multiple windows as a result
* DrawArc (draw_arc) - New width / line width parameter
* RGB does more error checking, converts types
* More descriptive errors for find element
* popup_error used interally now sets keep on top
* Element Re-use wording changed so that it's clear the element is the problem not the layout when re-use detected
* Window.Close (Window.close) - fix for not immediately seeing the window disappear on Linux when clicking "X"
* Window.BringToFront (bring_to_front) - on Windows needed to use topmost to bring window to front insteade of lift
* Multiline Scrollbar - removed the scrollbar color. It doesn't work on Windows so keeping consistent
* Changed how Debug Windows are created. Uses finalize now instead of the read non-blocking
* Fix for Debug Window being closed by X causing main window to also close
* Changed all "black" and "white" in the Look and Feel table to #000000 and #FFFFFF
* Added new color processing functions for internal use (hsl and hsv related)
* popup - extended the automatic wrapping capabilities to messages containing \n
* Test harness uses a nicer colors for event, value print outs.
* _timeit decorator for timing functions
### Upcoming ### Upcoming
There will always be overlapping work as the ports will never actually be "complete" as there's always something new that can be built. However there's a definition for the base functionality for PySimpleGUI. This is what is being strived for with the currnt ports that are underway. There will always be overlapping work as the ports will never actually be "complete" as there's always something new that can be built. However there's a definition for the base functionality for PySimpleGUI. This is what is being strived for with the currnt ports that are underway.