From ddf2e9b613fc384a35ed96298a3ba40975b56dc3 Mon Sep 17 00:00:00 2001 From: klugier Date: Sun, 1 Nov 2020 19:47:08 +0000 Subject: [PATCH] CtrlLib, Doc: GUI Turoail breaking the modal loop article improved. git-svn-id: svn://ultimatepp.org/upp/trunk@15348 f0d560ea-af0d-0410-9eb7-867de7ffcac7 --- uppsrc/CtrlLib/srcdoc.tpp/Tutorial_en-us.tpp | 26 ++++++++++++++++---- 1 file changed, 21 insertions(+), 5 deletions(-) diff --git a/uppsrc/CtrlLib/srcdoc.tpp/Tutorial_en-us.tpp b/uppsrc/CtrlLib/srcdoc.tpp/Tutorial_en-us.tpp index d9c3a0faf..e4e4cce59 100644 --- a/uppsrc/CtrlLib/srcdoc.tpp/Tutorial_en-us.tpp +++ b/uppsrc/CtrlLib/srcdoc.tpp/Tutorial_en-us.tpp @@ -1182,11 +1182,14 @@ that invoke [* Accept] and [* Reject] as needed before calling the [s5; &] [s5; Calls to [* Ok] and [* Cancel] methods of Button here make Button react to Enter and Esc keys.&] +[s5; To reduce tedious tasks even further, there are [* CtrlLayoutOK], +[* CtrlLayoutCancel], [* CtrlLayoutOKCancel ]etc. template functions +that both setup layout and assign Acceptors and Rejectors. For +more information about these functions please visit following +documentation [^topic`:`/`/CtrlCore`/src`/Layout`_en`-us^ site]. +Example below:&] [s5; &] -[s5; To reduce tedious tasks even further, there are CtrlLayoutOK, -CtrlLayoutCancel, CtrlLayoutOKCancel etc. template functions -that both setup layout and assign Acceptors and Rejectors.&] -[s5; &] +[s7; [@(28.127.0) // main.cpp]&] [s7; #include &] [s7; &] [s7; using namespace Upp;&] @@ -1206,8 +1209,21 @@ that both setup layout and assign Acceptors and Rejectors.&] [s7; -|-|Exclamation(`"Canceled`");&] [s7; -|`}&] [s7; `}&] +[s7; &] +[s7; [@(28.127.0) // myapp.lay]&] +[s0;l321; [C@5;1 LAYOUT(MyAppLayout, 148, 64)]&] +[s7; -|ITEM(EditDate, date, LeftPosZ(4, 88).TopPosZ(4, 19))&] +[s7; -|ITEM(Button, [* ok], SetLabel(t`_(`"OK`")).LeftPosZ(4, 64).TopPosZ(32, +24))&] +[s7; -|ITEM(Button, [* cancel], SetLabel(t`_(`"Cancel`")).LeftPosZ(76, +64).TopPosZ(32, 24))&] +[s7; END`_LAYOUT&] [s5; &] -[s5; [/ Note: IDOK, IDCANCEL are predefined constants.]&] +[s5; [/ Note: ][*/ IDOK][/ , ][*/ IDCANCEL][/ are predefined constants. Also +MyAppLayout contains variables ][*/ ok][/ and ][*/ cancel][/ of Button +type. The naming is not accidental and CtrLayout like functions +require names to be strict.For ][*/ CtrlLayoutExit][/ the button +variable should be named ][*/ exit][/ .]&] [s3;:21: 21. Creating and using custom widgets&] [s5; There is really nothing special about creating your own widgets. All that is to be done is to derive your own class from Ctrl