Merge pull request #1337 from PySimpleGUI/Dev-latest

Dev latest
This commit is contained in:
MikeTheWatchGuy 2019-04-23 19:31:32 -04:00 committed by GitHub
commit 09adafe935
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 39 additions and 10 deletions

View File

@ -1491,7 +1491,7 @@ class Button(Element):
self.AutoSizeButton = auto_size_button
self.BType = button_type
self.FileTypes = file_types
self.TKButton = None
self.TKButton = None # type: tk.Button
self.Target = target
self.ButtonText = str(button_text)
if sys.platform == 'darwin' and button_color is not None:
@ -2026,7 +2026,7 @@ class Graph(Element):
self.BottomLeft = graph_bottom_left
self.TopRight = graph_top_right
self._TKCanvas = None
self._TKCanvas2 = None
self._TKCanvas2 = None # Type: tk.Canvas
self.ChangeSubmits = change_submits or enable_events
self.DragSubmits = drag_submits
self.ClickPosition = (None, None)
@ -2243,6 +2243,19 @@ class Graph(Element):
return None
self._TKCanvas2.move(figure, shift_amount[0], shift_amount[1])
def RelocateFigure(self, figure, x, y):
zero_converted = self._convert_xy_to_canvas_xy(0, 0)
shift_converted = self._convert_xy_to_canvas_xy(x, y)
shift_amount = (shift_converted[0] - zero_converted[0], shift_converted[1] - zero_converted[1])
if figure is None:
print('*** WARNING - Your figure is None. It most likely means your did not Finalize your Window ***')
print('Call Window.Finalize() prior to all graph operations')
return None
xy = self._TKCanvas2.coords(figure)
self._TKCanvas2.move(figure, shift_converted[0]-xy[0], shift_converted[1]-xy[1])
@property
def TKCanvas(self):
if self._TKCanvas2 is None:
@ -5007,6 +5020,7 @@ def PackFormIntoFrame(form, containing_frame, toplevel_form):
tktext_label.bind('<Button-3>', element.RightClickMenuCallback)
# ------------------------- BUTTON element ------------------------- #
elif element_type == ELEM_TYPE_BUTTON:
element = element # type: Button
stringvar = tk.StringVar()
element.TKStringVar = stringvar
element.Location = (row_num, col_num)
@ -5477,6 +5491,7 @@ def PackFormIntoFrame(form, containing_frame, toplevel_form):
element._TKOut = TKOutput(tk_row_frame, width=width, height=height, bd=border_depth,
background_color=element.BackgroundColor, text_color=text_color, font=font,
pad=elementpad)
element._TKOut.output.configure(takefocus=0) # make it so that Output does not get focus
element._TKOut.pack(side=tk.LEFT, expand=True, fill='both')
if element.Visible is False:
element._TKOut.frame.pack_forget()

View File

@ -3448,7 +3448,7 @@ def base64_to_style_image(base64_image):
x ="url('data:image/png;base64,"
x += str(base64_image)
x += "')"
print(x)
# print(x)
return x
@ -6786,7 +6786,7 @@ def main():
[Combo(values=['Combo 1', 'Combo 2', 'Combo 3'], default_value='Combo 2', key='_COMBO_', enable_events=True,
readonly=False, tooltip='Combo box', disabled=False, size=(12, 1))],
[Listbox(values=('Listbox 1', 'Listbox 2', 'Listbox 3'), enable_events =True, size=(10, 3), key='_LIST_')],
[Image(filename=r'C:\Python\PycharmProjects\GooeyGUI\logo200.png', enable_events=True)],
# [Image(filename=r'C:\Python\PycharmProjects\GooeyGUI\logo200.png', enable_events=True)],
[Image(data=DEFAULT_BASE64_ICON)],
[Slider((1, 100), default_value=80, key='_SLIDER_', visible=True, enable_events=True, orientation='v')],
[Spin(values=(1, 2, 3), initial_value='2', size=(4, 1), key='_SPIN_', enable_events=True)],

View File

@ -8,7 +8,7 @@
![Python Version](https://img.shields.io/badge/Python-3.x-yellow.svg)
![Python Version](https://img.shields.io/badge/PySimpleGUIWeb_-0.23.0-orange.svg?longCache=true&style=for-the-badge)
![Python Version](https://img.shields.io/badge/PySimpleGUIWeb_-0.24.0-orange.svg?longCache=true&style=for-the-badge)
@ -315,6 +315,21 @@ New features
* Image element works better?
* Base64 not yet working
## 0.23.1 21-Apr-2019
One-time patch to remove a debug print
# 0.24.0 PySimpleGUIWeb 23-Apr-2019
* Enabled SuperImage class to accept base64 imagees
* Now use an SvgGroup to hold all of the drawing items
* Circle can now set outline color
* DrawImage still isn't working
* Move isn't working
* Added Relocate for group
* Lazy buttons - Up, Down, Left, Right(()
* Creates buttons with arrows on them as text
* Base64 support for Image Element
# Design
@ -327,7 +342,6 @@ New features
# Acknowledgments
<!--stackedit_data:
eyJoaXN0b3J5IjpbNDU1NTc2Mjg4LC0xMTY2NzE5OTE3LDQ3NT
g2NTY3NiwtMTA1NzEwMzY0MywxMjEzMzUyNjM2LC0xMTYwNjg0
MzM5XX0=
eyJoaXN0b3J5IjpbLTExNjY3MTk5MTcsNDc1ODY1Njc2LC0xMD
U3MTAzNjQzLDEyMTMzNTI2MzYsLTExNjA2ODQzMzldfQ==
-->