- Drag 2 buttons_ inside the window_ aligning them in the preferred grid_ position
- Define the proper button Text ("**Undo**","**Redo**")
- Choose a proper unique name (This step is not mandatory but useful to identify this Widget_)
- Disable those buttons by default because at the beginning the Text Editor is not going to have any Undo/Redo Buffers (I forgot to add this step in the video)
- Define the **Cut**, **Copy**, **Paste** commands
- Well, try to guess...
..raw:: html
<video width="800"
@ -43,6 +78,17 @@ Add The first buttons (Undo,redo - Cut,Copy,Paste)
Add the TextEdit widget
=======================
- Drag the TextEdit_ aligning it in the grid_ below any of the buttons_ previously placed
- | Expand the TextEdit_ widget in order to fill the entire area below the buttons_
| Use the rainbow [🟥🟨🟩🩵🟦🦄] button to help identify the different widgets in the main window
- | Force the top grid to a fixed size (3 Chars)
| In order to achieve this it is enough to force the MaxSize of any of the buttons in the top row to 3 Chars
- Check the line number, this will show the line number in the TextEdit_ when used
- Choose a proper unique name (This step is not mandatory but useful to identify this Widget_)
..raw:: html
<video width="800"
@ -57,6 +103,13 @@ Add the TextEdit widget
Link the Events/Slots for the basic functionalities
- | Connect the TextEdit `undo <https://ceccopierangiolieugenio.github.io/pyTermTk/autogen.TermTk/TermTk.TTkWidgets.texedit.html#TermTk.TTkWidgets.texedit.TTkTextEdit.undoAvailable>`__ / `redo <https://ceccopierangiolieugenio.github.io/pyTermTk/autogen.TermTk/TermTk.TTkWidgets.texedit.html#TermTk.TTkWidgets.texedit.TTkTextEdit.redoAvailable>`__ availability signals with the `setEnable <https://ceccopierangiolieugenio.github.io/pyTermTk/autogen.TermTk/TermTk.TTkWidgets.widget.html#TermTk.TTkWidgets.widget.TTkWidget.setEnable>`__ slots of the undo/redo buttons
| This allow the TextEdit to control directly the availability status of the Buttons
- Connect the undo/redo buttons `clicked <https://ceccopierangiolieugenio.github.io/pyTermTk/autogen.TermTk/TermTk.TTkWidgets.button.html#TermTk.TTkWidgets.button.TTkButton.clicked>`__ event to the `undo <https://ceccopierangiolieugenio.github.io/pyTermTk/autogen.TermTk/TermTk.TTkWidgets.texedit.html#TermTk.TTkWidgets.texedit.TTkTextEdit.undo>`__ / `redo <https://ceccopierangiolieugenio.github.io/pyTermTk/autogen.TermTk/TermTk.TTkWidgets.texedit.html#TermTk.TTkWidgets.texedit.TTkTextEdit.redo>`__ slots of the TextEditor
- Same for the `Cut <https://ceccopierangiolieugenio.github.io/pyTermTk/autogen.TermTk/TermTk.TTkWidgets.texedit.html#TermTk.TTkWidgets.texedit.TTkTextEdit.cut>`__, `Copy <https://ceccopierangiolieugenio.github.io/pyTermTk/autogen.TermTk/TermTk.TTkWidgets.texedit.html#TermTk.TTkWidgets.texedit.TTkTextEdit.copy>`__, `Paste <https://ceccopierangiolieugenio.github.io/pyTermTk/autogen.TermTk/TermTk.TTkWidgets.texedit.html#TermTk.TTkWidgets.texedit.TTkTextEdit.paste>`__