commit
be61d3e109
|
@ -1,6 +1,7 @@
|
||||||
#!/usr/bin/python3
|
#!/usr/bin/python3
|
||||||
|
|
||||||
version = __version__ = "4.7.1.6 Unreleased - included 4.7.1 patch, ability to update ttk buttons, images for ttk buttons, CURRENT_LOOK_AND_FEEL variable, Multiline colored text (FINALLY), experimental gray window warning/nag, Print/Easyprint multiple color output"
|
version = __version__ = "4.7.1.7 Unreleased - included 4.7.1 patch, ability to update ttk buttons, images for ttk buttons, CURRENT_LOOK_AND_FEEL variable, Multiline colored text (FINALLY), experimental gray window warning/nag, Print/Easyprint multiple color output, BrowseFiles delimeter variable"
|
||||||
|
|
||||||
port = 'PySimpleGUI'
|
port = 'PySimpleGUI'
|
||||||
|
|
||||||
# 888888ba .d88888b oo dP .88888. dP dP dP
|
# 888888ba .d88888b oo dP .88888. dP dP dP
|
||||||
|
@ -367,6 +368,8 @@ BUTTON_TYPE_CALENDAR_CHOOSER = 30
|
||||||
BUTTON_TYPE_COLOR_CHOOSER = 40
|
BUTTON_TYPE_COLOR_CHOOSER = 40
|
||||||
BUTTON_TYPE_SHOW_DEBUGGER = 50
|
BUTTON_TYPE_SHOW_DEBUGGER = 50
|
||||||
|
|
||||||
|
BROWSE_FILES_DELIMITER = ';' # the delimeter to be used between each file in the returned string
|
||||||
|
|
||||||
# ------------------------- Element types ------------------------- #
|
# ------------------------- Element types ------------------------- #
|
||||||
|
|
||||||
ELEM_TYPE_TEXT = 'text'
|
ELEM_TYPE_TEXT = 'text'
|
||||||
|
@ -2368,7 +2371,7 @@ class Button(Element):
|
||||||
else:
|
else:
|
||||||
file_name = tk.filedialog.askopenfilenames(filetypes=filetypes, initialdir=self.InitialFolder, parent=self.ParentForm.TKroot)
|
file_name = tk.filedialog.askopenfilenames(filetypes=filetypes, initialdir=self.InitialFolder, parent=self.ParentForm.TKroot)
|
||||||
if file_name != '':
|
if file_name != '':
|
||||||
file_name = ';'.join(file_name)
|
file_name = BROWSE_FILES_DELIMITER.join(file_name) # normally a ';'
|
||||||
strvar.set(file_name)
|
strvar.set(file_name)
|
||||||
self.TKStringVar.set(file_name)
|
self.TKStringVar.set(file_name)
|
||||||
elif self.BType == BUTTON_TYPE_SAVEAS_FILE:
|
elif self.BType == BUTTON_TYPE_SAVEAS_FILE:
|
||||||
|
@ -6576,6 +6579,8 @@ def FilesBrowse(button_text='Browse', target=(ThisRow, -1), file_types=(("ALL Fi
|
||||||
change_submits=False, enable_events=False,
|
change_submits=False, enable_events=False,
|
||||||
font=None, pad=None, key=None, metadata=None):
|
font=None, pad=None, key=None, metadata=None):
|
||||||
"""
|
"""
|
||||||
|
Allows browsing of multiple files. File list is returned as a single list with the delimeter defined using the variable
|
||||||
|
BROWSE_FILES_DELIMETER. This defaults to ';' but is changable by the user
|
||||||
|
|
||||||
:param button_text: text in the button (Default value = 'Browse')
|
:param button_text: text in the button (Default value = 'Browse')
|
||||||
:param target: key or (row,col) target for the button (Default value = (ThisRow, -1))
|
:param target: key or (row,col) target for the button (Default value = (ThisRow, -1))
|
||||||
|
|
|
@ -1,6 +1,8 @@
|
||||||
#usr/bin/python3
|
#usr/bin/python3
|
||||||
|
|
||||||
version = __version__ = "0.33.0 Released"
|
version = __version__ = "0.33.0.61 Unreleased - added port variable, browse file delimeter varaible (unused currently)"
|
||||||
|
|
||||||
|
port = 'PySimpleGUIWeb'
|
||||||
|
|
||||||
import sys
|
import sys
|
||||||
import datetime
|
import datetime
|
||||||
|
@ -141,7 +143,7 @@ DEFAULT_SCROLLBAR_COLOR = None
|
||||||
# DEFAULT_PROGRESS_BAR_COLOR = (PURPLES[1],PURPLES[0]) # a nice purple progress bar
|
# DEFAULT_PROGRESS_BAR_COLOR = (PURPLES[1],PURPLES[0]) # a nice purple progress bar
|
||||||
|
|
||||||
# A transparent button is simply one that matches the background
|
# A transparent button is simply one that matches the background
|
||||||
TRANSPARENT_BUTTON = ('#F0F0F0', '#F0F0F0')
|
TRANSPARENT_BUTTON = 'This constant has been depricated. You must set your button background = background it is on for it to be transparent appearing'
|
||||||
# --------------------------------------------------------------------------------
|
# --------------------------------------------------------------------------------
|
||||||
# Progress Bar Relief Choices
|
# Progress Bar Relief Choices
|
||||||
RELIEF_RAISED = 'raised'
|
RELIEF_RAISED = 'raised'
|
||||||
|
@ -261,6 +263,8 @@ BUTTON_TYPE_REALTIME = 9
|
||||||
BUTTON_TYPE_CALENDAR_CHOOSER = 30
|
BUTTON_TYPE_CALENDAR_CHOOSER = 30
|
||||||
BUTTON_TYPE_COLOR_CHOOSER = 40
|
BUTTON_TYPE_COLOR_CHOOSER = 40
|
||||||
|
|
||||||
|
BROWSE_FILES_DELIMITER = ';' # the delimeter to be used between each file in the returned string
|
||||||
|
|
||||||
# ------------------------- Element types ------------------------- #
|
# ------------------------- Element types ------------------------- #
|
||||||
# These used to be enums ElementType(Enum):
|
# These used to be enums ElementType(Enum):
|
||||||
ELEM_TYPE_TEXT = 'text'
|
ELEM_TYPE_TEXT = 'text'
|
||||||
|
@ -1239,7 +1243,7 @@ class Button(Element):
|
||||||
else:
|
else:
|
||||||
file_names = ''
|
file_names = ''
|
||||||
if file_names != '':
|
if file_names != '':
|
||||||
file_names = ';'.join(file_names)
|
file_names = BROWSE_FILES_DELIMITER.join(file_names)
|
||||||
if target_element.Type == ELEM_TYPE_BUTTON:
|
if target_element.Type == ELEM_TYPE_BUTTON:
|
||||||
target_element.FileOrFolderName = file_names
|
target_element.FileOrFolderName = file_names
|
||||||
else:
|
else:
|
||||||
|
|
|
@ -1,5 +1,7 @@
|
||||||
#!/usr/bin/python3
|
#!/usr/bin/python3
|
||||||
version = __version__ = "0.14.0 Released 17-Nov-2019"
|
version = __version__ = "0.14.0.51 Unreleased - added port variable, BrowseFiles delimeter variable"
|
||||||
|
|
||||||
|
port = 'PySimpleGUIWx'
|
||||||
|
|
||||||
import sys
|
import sys
|
||||||
import wx
|
import wx
|
||||||
|
@ -135,7 +137,7 @@ DEFAULT_SCROLLBAR_COLOR = None
|
||||||
# DEFAULT_PROGRESS_BAR_COLOR = (PURPLES[1],PURPLES[0]) # a nice purple progress bar
|
# DEFAULT_PROGRESS_BAR_COLOR = (PURPLES[1],PURPLES[0]) # a nice purple progress bar
|
||||||
|
|
||||||
# A transparent button is simply one that matches the background
|
# A transparent button is simply one that matches the background
|
||||||
TRANSPARENT_BUTTON = ('#F0F0F0', '#F0F0F0')
|
TRANSPARENT_BUTTON = 'This constant has been depricated. You must set your button background = background it is on for it to be transparent appearing'
|
||||||
# --------------------------------------------------------------------------------
|
# --------------------------------------------------------------------------------
|
||||||
# Progress Bar Relief Choices
|
# Progress Bar Relief Choices
|
||||||
RELIEF_RAISED = 'raised'
|
RELIEF_RAISED = 'raised'
|
||||||
|
@ -259,6 +261,8 @@ BUTTON_TYPE_REALTIME = 9
|
||||||
BUTTON_TYPE_CALENDAR_CHOOSER = 30
|
BUTTON_TYPE_CALENDAR_CHOOSER = 30
|
||||||
BUTTON_TYPE_COLOR_CHOOSER = 40
|
BUTTON_TYPE_COLOR_CHOOSER = 40
|
||||||
|
|
||||||
|
BROWSE_FILES_DELIMITER = ';' # the delimeter to be used between each file in the returned string
|
||||||
|
|
||||||
# ------------------------- Element types ------------------------- #
|
# ------------------------- Element types ------------------------- #
|
||||||
# class ElementType(Enum):
|
# class ElementType(Enum):
|
||||||
ELEM_TYPE_TEXT = 'text'
|
ELEM_TYPE_TEXT = 'text'
|
||||||
|
@ -1379,7 +1383,7 @@ class Button(Element):
|
||||||
else:
|
else:
|
||||||
file_names = ''
|
file_names = ''
|
||||||
if file_names != '':
|
if file_names != '':
|
||||||
file_names = ';'.join(file_names)
|
file_names = BROWSE_FILES_DELIMITER.join(file_names)
|
||||||
if target_element.Type == ELEM_TYPE_BUTTON:
|
if target_element.Type == ELEM_TYPE_BUTTON:
|
||||||
target_element.FileOrFolderName = file_names
|
target_element.FileOrFolderName = file_names
|
||||||
else:
|
else:
|
||||||
|
|
Loading…
Reference in New Issue