Browse Source

Addee textpicker demo, improved doc

pull/199/head
Eugenio Parodi 2 years ago
parent
commit
4c686e329f
  1. 69
      demo/showcase/textpicker.py
  2. 113
      docs/source/info/features/widgets.rst
  3. 28
      docs/source/info/installing.rst

69
demo/showcase/textpicker.py

@ -0,0 +1,69 @@
#!/usr/bin/env python3
# MIT License
#
# Copyright (c) 2023 Eugenio Parodi <ceccopierangiolieugenio AT googlemail DOT com>
#
# 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.
import sys, os, argparse, math, random
sys.path.append(os.path.join(sys.path[0],'../..'))
import TermTk as ttk
def demoTextPicker(root=None):
frame = ttk.TTkFrame(parent=root, border=False)
ttk.TTkLabel(parent=frame, pos=(0,0),text="No Autosize")
ttk.TTkTextPicker(parent=frame, pos=( 0,1), size=(20, 1),autoSize=False, multiLine=False)
ttk.TTkLabel(parent=frame, pos=(0,2),text="Multiline")
ttk.TTkTextPicker(parent=frame, pos=( 0,3), size=(20, 1),autoSize=False, multiLine=True)
ttk.TTkLabel(parent=frame, pos=(0,4),text="Autosize")
ttk.TTkTextPicker(parent=frame, pos=( 0,5), size=(20, 1),autoSize=True, multiLine=True)
ttk.TTkTextPicker(parent=frame, pos=(25,0), size=(20, 5),autoSize=True, multiLine=True)
ttk.TTkTextPicker(parent=frame, pos=(50,0), size=(20,10),autoSize=True, multiLine=True)
return frame
def main():
parser = argparse.ArgumentParser()
parser.add_argument('-f', help='Full Screen', action='store_true')
args = parser.parse_args()
ttk.TTkTheme.loadTheme(ttk.TTkTheme.NERD)
root = ttk.TTk()
if args.f:
root.setLayout(ttk.TTkGridLayout())
winColor1 = root
else:
winColor1 = ttk.TTkWindow(parent=root,pos = (0,0), size=(58,20), title="Test Text Picker", border=True, layout=ttk.TTkGridLayout())
demoTextPicker(winColor1)
winKP = ttk.TTkWindow(parent=root,pos = (5,25), size=(85,7), title="Captured Input")
winKP.setLayout(ttk.TTkHBoxLayout())
ttk.TTkKeyPressView(parent=winKP)
root.mainloop()
if __name__ == "__main__":
main()

113
docs/source/info/features/widgets.rst

@ -10,111 +10,50 @@ Base Widgets
.. image:: https://github.com/ceccopierangiolieugenio/pyTermTk/assets/8876552/f930f010-79ce-4b9a-8b2b-796af6d1542c
* Label :class:`~TermTk.TTkWidgets.label.TTkLabel`
* Button :class:`~TermTk.TTkWidgets.button.TTkButton`
* ComboBox :class:`~TermTk.TTkWidgets.combobox.TTkCombobox`
* Line Edit :class:`~TermTk.TTkWidgets.lineedit.TTkLineedit`
* Spinbox :class:`~TermTk.TTkWidgets.spinbox.TTkSpinbox`
* Checkbox :class:`~TermTk.TTkWidgets.checkbox.TTkCheckbox`
* Radio Button :class:`~TermTk.TTkWidgets.radiobutton.TTkRadiobutton`
* Scrollbar :class:`~TermTk.TTkWidgets.scrollbar.TTkScrollBar`
Label
~~~~~
:class:`~TermTk.TTkWidgets.label.TTkLabel`
* List :class:`~TermTk.TTkWidgets.list_.TTkList`
* Menu :class:`~TermTk.TTkWidgets.menu.TTkMenu`
* Tab :class:`~TermTk.TTkWidgets.tabwidget.TTkTabWidget`
Button
~~~~~~
:class:`~TermTk.TTkWidgets.button.TTkButton`
ComboBox
~~~~~~~~
:class:`~TermTk.TTkWidgets.combobox.TTkCombobox`
Line Edit
~~~~~~~~
:class:`~TermTk.TTkWidgets.lineedit.TTkLineedit`
Spinbox
~~~~~~~
:class:`~TermTk.TTkWidgets.spinbox.TTkSpinbox`
Checkbox
~~~~~~~~
:class:`~TermTk.TTkWidgets.checkbox.TTkCheckbox`
Radio Button
~~~~~~~~~~~~
:class:`~TermTk.TTkWidgets.radiobutton.TTkRadiobutton`
List
~~~~
:class:`~TermTk.TTkWidgets.list_.TTkList`
Menu
~~~~
:class:`~TermTk.TTkWidgets.menu.TTkMenu`
Scrollbar
~~~~~~~~~
:class:`~TermTk.TTkWidgets.scrollbar.TTkScrollBar`
Tab
~~~
:class:`~TermTk.TTkWidgets.tabwidget.TTkTabWidget`
Window
~~~~~~
:class:`~TermTk.TTkWidgets.window.TTkWindow`
Specialised Widgets
-------------------
TextEdit
~~~~~~~~
:class:`~TermTk.TTkWidgets.texedit.TTkTextEdit`
KodeTab
~~~~~~~
.. image:: https://github.com/ceccopierangiolieugenio/pyTermTk/assets/8876552/ebc52793-484d-4fee-9ccd-8d8cc2e810fe
* TextEdit :class:`~TermTk.TTkWidgets.texedit.TTkTextEdit`
Terminal
~~~~~~~~
.. image:: https://github.com/ceccopierangiolieugenio/pyTermTk/assets/8876552/3f4f7306-fb6c-4892-8960-3d42780a34de
* KodeTab :class:`~TermTk.TTkWidgets.kodetb.TTkKodeTab`
* Terminal TBD
.. _widgets-pickers:
Pickers
-------
.. image:: https://github.com/ceccopierangiolieugenio/pyTermTk/assets/8876552/35de8317-1ee6-4dad-9c46-320d0692c393
* Text Picker
Text Picker
~~~~~~~~~~~
File Picker
~~~~~~~~~~~
Color Picker
~~~~~~~~~~~~
Specialised Widgets
-------------------
TextEdit
~~~~~~~~
KodeTab
~~~~~~~
Terminal
~~~~~~~~
.. image:: https://github.com/ceccopierangiolieugenio/pyTermTk/assets/8876552/0388f4a0-1a93-4d57-9a77-c7e43422fedb
* File Picker
.. image:: https://github.com/ceccopierangiolieugenio/pyTermTk/assets/8876552/9a61baf3-f151-49a6-bde0-ace02eb9008e
* Color Picker
.. _widgets-layout:
Layout
------
Frame
~~~~~
Resizable Frame
~~~~~~~~~~~~~~~
Splitter
~~~~~~~~
* Frame
* Resizable Frame
* Window :class:`~TermTk.TTkWidgets.window.TTkWindow`
* Splitter

28
docs/source/info/installing.rst

@ -88,9 +88,9 @@ Clone or `Download <https://github.com/ceccopierangiolieugenio/pyTermTk/releases
Demos
~~~~~
* Main demo `demo.py <https://github.com/ceccopierangiolieugenio/pyTermTk/blob/main/demo/demo.py>`_ (`tryItOnline <https://ceccopierangiolieugenio.github.io/pyTermTk/sandbox/sandbox.html?fileUri=https://raw.githubusercontent.com/ceccopierangiolieugenio/pyTermTk/main/demo/demo.py>`_)
* paint demo `paint.py <https://github.com/ceccopierangiolieugenio/pyTermTk/blob/main/demo/paint.py>`_ (`tryItOnline <https://ceccopierangiolieugenio.github.io/pyTermTk/sandbox/sandbox.html?fileUri=https://raw.githubusercontent.com/ceccopierangiolieugenio/pyTermTk/main/demo/paint.py>`_)
* ttkode prototype `ttkode.py <https://github.com/ceccopierangiolieugenio/pyTermTk/blob/main/demo/ttkode.py>`_ (`tryItOnline <https://ceccopierangiolieugenio.github.io/pyTermTk/sandbox/sandbox.html?fileUri=https://raw.githubusercontent.com/ceccopierangiolieugenio/pyTermTk/main/demo/ttkode.py>`_)
* Main demo `demo.py <https://github.com/ceccopierangiolieugenio/pyTermTk/blob/main/demo/demo.py>`_ (`tryItOnline <https://ceccopierangiolieugenio.github.io/pyTermTk/sandbox/sandbox.html?filePath=demo/demo.py>`_)
* paint demo `paint.py <https://github.com/ceccopierangiolieugenio/pyTermTk/blob/main/demo/paint.py>`_ (`tryItOnline <https://ceccopierangiolieugenio.github.io/pyTermTk/sandbox/sandbox.html?filePath=demo/paint.py>`_)
* ttkode prototype `ttkode.py <https://github.com/ceccopierangiolieugenio/pyTermTk/blob/main/demo/ttkode.py>`_ (`tryItOnline <https://ceccopierangiolieugenio.github.io/pyTermTk/sandbox/sandbox.html?filePath=demo/ttkode.py>`_)
.. code:: bash
@ -109,17 +109,17 @@ Showcase
**Highlight:**
* Text Editor `textedit.py <https://github.com/ceccopierangiolieugenio/pyTermTk/blob/main/demo/showcase/textedit.py>`_ (`tryItOnline <https://ceccopierangiolieugenio.github.io/pyTermTk/sandbox/sandbox.html?fileUri=https://raw.githubusercontent.com/ceccopierangiolieugenio/pyTermTk/main/demo/showcase/textedit.py>`_)
* Animation `animation.01.py <https://github.com/ceccopierangiolieugenio/pyTermTk/blob/main/demo/showcase/animation.01.py>`_ (`tryItOnline <https://ceccopierangiolieugenio.github.io/pyTermTk/sandbox/sandbox.html?fileUri=https://raw.githubusercontent.com/ceccopierangiolieugenio/pyTermTk/main/demo/showcase/animation.01.py>`_)
* color picker `colorpicker.py <https://github.com/ceccopierangiolieugenio/pyTermTk/blob/main/demo/showcase/colorpicker.py>`_ (`tryItOnline <https://ceccopierangiolieugenio.github.io/pyTermTk/sandbox/sandbox.html?fileUri=https://raw.githubusercontent.com/ceccopierangiolieugenio/pyTermTk/main/demo/showcase/colorpicker.py>`_)
* file picker `filepicker.py <https://github.com/ceccopierangiolieugenio/pyTermTk/blob/main/demo/showcase/filepicker.py>`_ (`tryItOnline <https://ceccopierangiolieugenio.github.io/pyTermTk/sandbox/sandbox.html?fileUri=https://raw.githubusercontent.com/ceccopierangiolieugenio/pyTermTk/main/demo/showcase/filepicker.py>`_)
* drag & drop `dragndrop.py <https://github.com/ceccopierangiolieugenio/pyTermTk/blob/main/demo/showcase/dragndrop.py>`_ (`tryItOnline <https://ceccopierangiolieugenio.github.io/pyTermTk/sandbox/sandbox.html?fileUri=https://raw.githubusercontent.com/ceccopierangiolieugenio/pyTermTk/main/demo/showcase/dragndrop.py>`_)
* d&d with tabs `dndtabs.py <https://github.com/ceccopierangiolieugenio/pyTermTk/blob/main/demo/showcase/dndtabs.py>`_ (`tryItOnline <https://ceccopierangiolieugenio.github.io/pyTermTk/sandbox/sandbox.html?fileUri=https://raw.githubusercontent.com/ceccopierangiolieugenio/pyTermTk/main/demo/showcase/dndtabs.py>`_)
* d&d with list `list.py <https://github.com/ceccopierangiolieugenio/pyTermTk/blob/main/demo/showcase/list.py>`_ (`tryItOnline <https://ceccopierangiolieugenio.github.io/pyTermTk/sandbox/sandbox.html?fileUri=https://raw.githubusercontent.com/ceccopierangiolieugenio/pyTermTk/main/demo/showcase/list.py>`_)
* base widgets `formwidgets02.py <https://github.com/ceccopierangiolieugenio/pyTermTk/blob/main/demo/showcase/formwidgets02.py>`_ (`tryItOnline <https://ceccopierangiolieugenio.github.io/pyTermTk/sandbox/sandbox.html?fileUri=https://raw.githubusercontent.com/ceccopierangiolieugenio/pyTermTk/main/demo/showcase/formwidgets02.py>`_)
* messagebox `messagebox.py <https://github.com/ceccopierangiolieugenio/pyTermTk/blob/main/demo/showcase/messagebox.py>`_ (`tryItOnline <https://ceccopierangiolieugenio.github.io/pyTermTk/sandbox/sandbox.html?fileUri=https://raw.githubusercontent.com/ceccopierangiolieugenio/pyTermTk/main/demo/showcase/messagebox.py>`_)
* splitter `splitter.py <https://github.com/ceccopierangiolieugenio/pyTermTk/blob/main/demo/showcase/splitter.py>`_ (`tryItOnline <https://ceccopierangiolieugenio.github.io/pyTermTk/sandbox/sandbox.html?fileUri=https://raw.githubusercontent.com/ceccopierangiolieugenio/pyTermTk/main/demo/showcase/splitter.py>`_)
* Windows `windowsflags.py <https://github.com/ceccopierangiolieugenio/pyTermTk/blob/main/demo/showcase/windowsflags.py>`_ (`tryItOnline <https://ceccopierangiolieugenio.github.io/pyTermTk/sandbox/sandbox.html?fileUri=https://raw.githubusercontent.com/ceccopierangiolieugenio/pyTermTk/main/demo/showcase/windowsflags.py>`_)
* Text Editor `textedit.py <https://github.com/ceccopierangiolieugenio/pyTermTk/blob/main/demo/showcase/textedit.py>`_ (`tryItOnline <https://ceccopierangiolieugenio.github.io/pyTermTk/sandbox/sandbox.html?filePath=demo/showcase/textedit.py>`_)
* Animation `animation.01.py <https://github.com/ceccopierangiolieugenio/pyTermTk/blob/main/demo/showcase/animation.01.py>`_ (`tryItOnline <https://ceccopierangiolieugenio.github.io/pyTermTk/sandbox/sandbox.html?filePath=demo/showcase/animation.01.py>`_)
* color picker `colorpicker.py <https://github.com/ceccopierangiolieugenio/pyTermTk/blob/main/demo/showcase/colorpicker.py>`_ (`tryItOnline <https://ceccopierangiolieugenio.github.io/pyTermTk/sandbox/sandbox.html?filePath=demo/showcase/colorpicker.py>`_)
* file picker `filepicker.py <https://github.com/ceccopierangiolieugenio/pyTermTk/blob/main/demo/showcase/filepicker.py>`_ (`tryItOnline <https://ceccopierangiolieugenio.github.io/pyTermTk/sandbox/sandbox.html?filePath=demo/showcase/filepicker.py>`_)
* drag & drop `dragndrop.py <https://github.com/ceccopierangiolieugenio/pyTermTk/blob/main/demo/showcase/dragndrop.py>`_ (`tryItOnline <https://ceccopierangiolieugenio.github.io/pyTermTk/sandbox/sandbox.html?filePath=demo/showcase/dragndrop.py>`_)
* d&d with tabs `dndtabs.py <https://github.com/ceccopierangiolieugenio/pyTermTk/blob/main/demo/showcase/dndtabs.py>`_ (`tryItOnline <https://ceccopierangiolieugenio.github.io/pyTermTk/sandbox/sandbox.html?filePath=demo/showcase/dndtabs.py>`_)
* d&d with list `list.py <https://github.com/ceccopierangiolieugenio/pyTermTk/blob/main/demo/showcase/list.py>`_ (`tryItOnline <https://ceccopierangiolieugenio.github.io/pyTermTk/sandbox/sandbox.html?filePath=demo/showcase/list.py>`_)
* base widgets `formwidgets02.py <https://github.com/ceccopierangiolieugenio/pyTermTk/blob/main/demo/showcase/formwidgets02.py>`_ (`tryItOnline <https://ceccopierangiolieugenio.github.io/pyTermTk/sandbox/sandbox.html?filePath=demo/showcase/formwidgets02.py>`_)
* messagebox `messagebox.py <https://github.com/ceccopierangiolieugenio/pyTermTk/blob/main/demo/showcase/messagebox.py>`_ (`tryItOnline <https://ceccopierangiolieugenio.github.io/pyTermTk/sandbox/sandbox.html?filePath=demo/showcase/messagebox.py>`_)
* splitter `splitter.py <https://github.com/ceccopierangiolieugenio/pyTermTk/blob/main/demo/showcase/splitter.py>`_ (`tryItOnline <https://ceccopierangiolieugenio.github.io/pyTermTk/sandbox/sandbox.html?filePath=demo/showcase/splitter.py>`_)
* Windows `windowsflags.py <https://github.com/ceccopierangiolieugenio/pyTermTk/blob/main/demo/showcase/windowsflags.py>`_ (`tryItOnline <https://ceccopierangiolieugenio.github.io/pyTermTk/sandbox/sandbox.html?filePath=demo/showcase/windowsflags.py>`_)
* Tooltip `test.ui.026.toolTip.py <https://github.com/ceccopierangiolieugenio/pyTermTk/blob/main/tests/test.ui.026.toolTip.py>`_ (`tryItOnline <https://ceccopierangiolieugenio.github.io/pyTermTk/sandbox/sandbox.html?fileUri=https://raw.githubusercontent.com/ceccopierangiolieugenio/pyTermTk/main/tests/test.ui.026.toolTip.py>`_)
.. code:: bash

Loading…
Cancel
Save