diff --git a/TermTk/TTkUiTools/properties/__init__.py b/TermTk/TTkUiTools/properties/__init__.py index afe9d1b9..1fd2c90c 100644 --- a/TermTk/TTkUiTools/properties/__init__.py +++ b/TermTk/TTkUiTools/properties/__init__.py @@ -1,6 +1,7 @@ # from .about import from .button import TTkButtonProperties from .checkbox import TTkCheckboxProperties +from .colorpicker import TTkColorButtonPickerProperties from .combobox import TTkComboBoxProperties from .frame import TTkFrameProperties # from .graph import diff --git a/TermTk/TTkUiTools/properties/colorpicker.py b/TermTk/TTkUiTools/properties/colorpicker.py new file mode 100644 index 00000000..3916c0e9 --- /dev/null +++ b/TermTk/TTkUiTools/properties/colorpicker.py @@ -0,0 +1,38 @@ +# MIT License +# +# Copyright (c) 2023 Eugenio Parodi +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. + +from TermTk.TTkCore.color import TTkColor +from TermTk.TTkWidgets.TTkPickers.colorpicker import TTkColorButtonPicker + +TTkColorButtonPickerProperties = { + 'properties' : { + 'Color' : { + 'init': {'name':'color', 'type':TTkColor }, + 'get': {'cb':TTkColorButtonPicker.color, 'type':TTkColor } , + 'set': {'cb':TTkColorButtonPicker.setColor, 'type':TTkColor } }, }, + 'signals' : { + 'colorSelected(TTkColor)' : {'name': 'colorSelected', 'type' : TTkColor}, + }, + 'slots' : { + 'setColor(TTkColor)' : {'name': 'setColor', 'type' : TTkColor}, + } +} diff --git a/TermTk/TTkUiTools/uiproperties.py b/TermTk/TTkUiTools/uiproperties.py index 74406453..ce673f17 100644 --- a/TermTk/TTkUiTools/uiproperties.py +++ b/TermTk/TTkUiTools/uiproperties.py @@ -28,6 +28,7 @@ TTkUiProperties = { # Widgets TTkButton.__name__: TTkButtonProperties, TTkCheckbox.__name__: TTkCheckboxProperties, + TTkColorButtonPicker.__name__ : TTkColorButtonPickerProperties, TTkComboBox.__name__: TTkComboBoxProperties, TTkFrame.__name__: TTkFrameProperties, TTkLabel.__name__: TTkLabelProperties, diff --git a/TermTk/TTkWidgets/texedit.py b/TermTk/TTkWidgets/texedit.py index d39fd622..0e248526 100644 --- a/TermTk/TTkWidgets/texedit.py +++ b/TermTk/TTkWidgets/texedit.py @@ -580,6 +580,7 @@ class TTkTextEdit(TTkAbstractScrollArea): 'lineWrapMode', 'setLineWrapMode', 'wordWrapMode', 'setWordWrapMode', 'textCursor', 'setFocus', + 'copy', 'paste', 'undo', 'redo', 'isUndoAvailable', 'isRedoAvailable', # Export Methods, 'toAnsi', 'toRawText', 'toPlainText', # 'toHtml', 'toMarkdown', @@ -612,6 +613,8 @@ class TTkTextEdit(TTkAbstractScrollArea): self.textCursor = self._textEditView.textCursor self.setFocus = self._textEditView.setFocus self.multiLine = self._textEditView.multiLine + self.copy = self._textEditView.copy + self.paste = self._textEditView.paste self.undo = self._textEditView.undo self.redo = self._textEditView.redo self.isUndoAvailable = self._textEditView.isUndoAvailable diff --git a/ttkDesigner/app/widgetbox.py b/ttkDesigner/app/widgetbox.py index 02a88abc..14721621 100644 --- a/ttkDesigner/app/widgetbox.py +++ b/ttkDesigner/app/widgetbox.py @@ -59,6 +59,12 @@ dWidgets = { "Frame" : { "class":ttk.TTkFrame, "params":{'size':(20,5), 'border':True}}, "Resizable Frame" : { "class":ttk.TTkResizableFrame, "params":{'size':(20,5)}}, }, + 'Pickers':{ + "Color Picker" : { "class":ttk.TTkColorButtonPicker, "params":{'size':(6,3), 'border':True}}, + "File Picker" : { "class":ttk.TTkButton, "params":{'size':(20,3)}, "disabled": True}, + "Date Picker" : { "class":ttk.TTkButton, "params":{'size':(20,3)}, "disabled": True}, + "TtkString Picker" : { "class":ttk.TTkButton, "params":{'size':(20,3)}, "disabled": True}, + }, 'Debug':{ "Log Viewer" : { "class":ttk.TTkLogViewer, "params":{'size':(60,10)}}, "Input View" : { "class":ttk.TTkKeyPressView, "params":{'size':(60,3)}},