topic "Informative Dialogs";
[2 $$0,0#00000000000000000000000000000000:Default]
[i448;a25;kKO9;2 $$1,0#37138531426314131252341829483380:class]
[l288;2 $$2,2#27521748481378242620020725143825:desc]
[0 $$3,0#96390100711032703541132217272105:end]
[H6;0 $$4,0#05600065144404261032431302351956:begin]
[i448;a25;kKO9;2 $$5,0#37138531426314131252341829483370:item]
[l288;a4;*@5;1 $$6,6#70004532496200323422659154056402:requirement]
[l288;i1121;b17;O9;~~~.1408;2 $$7,0#10431211400427159095818037425705:param]
[i448;b42;O9;2 $$8,8#61672508125594000341940100500538:tparam]
[b42;ph2 $$9,9#13035079074754324216151401829390:normal]
[b42;a42;ph2 $$10,10#E71D914572A169C91BE52E3FB27F810F:text]
[{_}%EN-US 
[ {{10000@(113.42.0) [s0; [*@7;4 Informative Dialogs]]}}&]
[s10; Sometimes programmer needs to display simply informative dialog 
with certain options like: OK, Cancel, Yes, No, Retry etc.. In 
U`+`+ the common way to do that is to use special functions provided 
by CtrlLib.&]
[s10; We distinguish three main families of informative functions:&]
[s10;l160;i150;O0; [* Prompt ]`- should be used to display common informations.&]
[s10;l160;i150;O0; [* Exclamation ](Warning) `- should be used to report 
not critical issue, but not everything is all right.&]
[s10;l160;i150;O0; [* Error] `- should be used to notify about critical 
error in the application.&]
[s10;l160;i150;O0; [* Custom] `- if everything above is not appropriate 
for your needs, you can compose your own dialog using build in 
functions. This functions is used to create all dialogs mentions 
in this reference.&]
[s10; The message to informative dialog is passed by QTF format. It 
means that you can for example embed hyper`-link. But, on the 
other hand it can leads to troubles in displaying text. For example 
we have symbols that are special for QTF `- this situation can 
happened while displaying directory path. In this case we need 
to deqtf our text.using [*^topic`:`/`/RichText`/src`/Utilities`$en`-us`#Upp`:`:DeQtf`(const char`*`)^ D
eQtf][*  ]function from RichText package. Below is the code that 
presenting how to solve such issue:&]
[s10;l160; [/@(28.42.150) PromptOK(DeQtf(`"C:`\Program Files`\Upp`\theide`"));]&]
[s10;%- &]
[ {{10000F(128)G(128)@1 [s0; [* Prompt family]]}}&]
[s10;%- Displays informative dialogs.&]
[s10;%- &]
[s0;=%- 
@@rawimage:1435&735
([encoded data, 11216 characters])
&]
[s10;%- &]
[s10;%- Code used to generate above dialog (Please notice that we 
used DeQtf functino to display U`+`+ appropriate):&]
[s10;l160;%- [/@(28.42.150) PromptOK(DeQtf(`"U`+`+ is a powerfull framework.`"));]&]
[s10;%- &]
[s4;%- &]
[s5;:Upp`:`:PromptOK`(const char`*`):%- [@(0.0.255) void]_[* PromptOK]([@(0.0.255) const]_[@(0.0.255) c
har]_`*[*@3 qtf])&]
[s2;%- The simplest variant with OK button.&]
[s7; [%-*@3 qtf]-|Message to display in QTF format.&]
[s3; &]
[s4; &]
[s5;:Upp`:`:PromptOKCancel`(const char`*`):%- [@(0.0.255) int]_[* PromptOKCancel]([@(0.0.255) c
onst]_[@(0.0.255) char]_`*[*@3 qtf])&]
[s2;%- Variant with OK and Cancel buttons.&]
[s7; [%-*@3 qtf]-|Message to display in QTF format.&]
[s7; [*/ Return value]-|1 for OK; 0 when Cancel button was clicked;&]
[s3; &]
[s4; &]
[s5;:Upp`:`:PromptYesNo`(const char`*`):%- [@(0.0.255) int]_[* PromptYesNo]([@(0.0.255) con
st]_[@(0.0.255) char]_`*[*@3 qtf])&]
[s2;%- Variant with Yes and No buttons.&]
[s7; [%-*@3 qtf]-|Message to display in QTF format.&]
[s7; [*/ Return value]-|1 for Yes; 0 when No button was clicked;&]
[s3; &]
[s4; &]
[s5;:Upp`:`:PromptYesNoCancel`(const char`*`):%- [@(0.0.255) int]_[* PromptYesNoCancel]([@(0.0.255) c
onst]_[@(0.0.255) char]_`*[*@3 qtf])&]
[s2;%- Variant with Yes, No and Cancel buttons.&]
[s7; [%-*@3 qtf]-|Message to display in QTF format.&]
[s7; [*/ Return value]-|1 for Yes; 0 when No button was clicked; 1 for 
Yes; `-1 for Cancel;&]
[s3; &]
[s4; &]
[s5;:Upp`:`:PromptRetryCancel`(const char`*`):%- [@(0.0.255) int]_[* PromptRetryCancel]([@(0.0.255) c
onst]_[@(0.0.255) char]_`*[*@3 qtf])&]
[s2;%- Variant with Retry and Cancel buttons.&]
[s7; [%-*@3 qtf]-|Message to display in QTF format.&]
[s7; [*/ Return value]-|1 for Retry; 0 when Cancel button was clicked;&]
[s3; &]
[s4; &]
[s5;:Upp`:`:PromptAbortRetry`(const char`*`):%- [@(0.0.255) int]_[* PromptAbortRetry]([@(0.0.255) c
onst]_[@(0.0.255) char]_`*[*@3 qtf])&]
[s2;%- Variant with Abort and Retry buttons.&]
[s7; [%-*@3 qtf]-|Message to display in QTF format.&]
[s7; [*/ Return value]-|1 for Abort; 0 when Retry button was clicked;&]
[s3; &]
[s4; &]
[s5;:Upp`:`:PromptAbortRetryIgnore`(const char`*`):%- [@(0.0.255) int]_[* PromptAbortRetr
yIgnore]([@(0.0.255) const]_[@(0.0.255) char]_`*[*@3 qtf])&]
[s2;%- Variant with Abort, Retry and Ignore buttons.&]
[s7; [%-*@3 qtf]-|Message to display in QTF format.&]
[s7; [*/ Return value]-|1 for Abort; 0 when Retry button was clicked; 
`-1 for Ignore;&]
[s3; &]
[s4; &]
[s5;:Upp`:`:PromptSaveDontSaveCancel`(const char`*`):%- [@(0.0.255) int]_[* PromptSaveDon
tSaveCancel]([@(0.0.255) const]_[@(0.0.255) char]_`*[*@3 qtf])&]
[s2;%- Variant with Save, Don`'t Save and Cancel buttons.&]
[s7; [%-*@3 qtf]-|Message to display in QTF format.&]
[s7; [*/ Return value]-|1 for Save; 0 when Don`'t Save button was clicked; 
`-1 for Cancel;&]
[s3;%- &]
[ {{10000F(128)G(128)@1 [s0; [* Exclamation family]]}}&]
[s10;%- Displays dialogs with warning.&]
[s10;%- &]
[s0;=%- 
@@rawimage:1638&630
([encoded data, 12036 characters])
&]
[s10;%- &]
[s10;%- Code used to generate above dialog:&]
[s10;l160;%- [/@(28.42.150) Exclamation(`"We found that you are not 
on our donators list.`");]&]
[s10;%- &]
[s4;%- &]
[s5;:Upp`:`:Exclamation`(const char`*`):%- [@(0.0.255) void]_[* Exclamation]([@(0.0.255) co
nst]_[@(0.0.255) char]_`*[*@3 qtf])&]
[s2;%- Simply variant with OK button.&]
[s7; [%-*@3 qtf]-|Message to display in QTF format.&]
[s3; &]
[ {{10000F(128)G(128)@1 [s0; [* Error family]]}}&]
[s10;%- Displays dialogs with error.&]
[s10;%- &]
[s0;=%- 
@@rawimage:1395&735
([encoded data, 11432 characters])
&]
[s10;%- &]
[s10;%- Code used to generate above dialog:&]
[s10;l160;%- [/@(28.42.150) ErrorOK(`"Connectino to host was lost.`");]&]
[s10;%- &]
[s4;%- &]
[s5;:Upp`:`:ErrorOK`(const char`*`):%- [@(0.0.255) void]_[* ErrorOK]([@(0.0.255) const]_[@(0.0.255) c
har]_`*[*@3 qtf])&]
[s2;%- The simpliest variant with OK button. Should be used to notify 
about errors that cannot be avoided at certain point of program 
execution.&]
[s7; [%-*@3 qtf]-|Message to display in QTF format.&]
[s3; &]
[s4; &]
[s5;:Upp`:`:ErrorOKCancel`(const char`*`):%- [@(0.0.255) int]_[* ErrorOKCancel]([@(0.0.255) c
onst]_[@(0.0.255) char]_`*[*@3 qtf])&]
[s2;%- Variant with OK and Cancel buttons.&]
[s7; [%-*@3 qtf]-|Message to display in QTF format.&]
[s7; [*/ Return value]-|1 for OK; 0 when Cancel button was clicked;&]
[s3; &]
[s4; &]
[s5;:Upp`:`:ErrorYesNo`(const char`*`):%- [@(0.0.255) int]_[* ErrorYesNo]([@(0.0.255) const
]_[@(0.0.255) char]_`*[*@3 qtf])&]
[s2;%- Variant with Yes and No buttons.&]
[s7; [%-*@3 qtf]-|Message to display in QTF format.&]
[s7; [*/ Return value]-|1 for Yes; 0 when No button was clicked;&]
[s3; &]
[s4; &]
[s5;:Upp`:`:ErrorYesNoCancel`(const char`*`):%- [@(0.0.255) int]_[* ErrorYesNoCancel]([@(0.0.255) c
onst]_[@(0.0.255) char]_`*[*@3 qtf])&]
[s2;%- Variant with Yes, No and Cancel buttons.&]
[s7; [%-*@3 qtf]-|Message to display in QTF format.&]
[s7; [*/ Return value]-|1 for Yes; 0 when No button was clicked; 1 for 
Yes; `-1 for Cancel;&]
[s0; &]
[s4; &]
[s5;:Upp`:`:ErrorRetryCancel`(const char`*`):%- [@(0.0.255) int]_[* ErrorRetryCancel]([@(0.0.255) c
onst]_[@(0.0.255) char]_`*[*@3 qtf])&]
[s2;%- Variant with Retry and Cancel buttons.&]
[s7; [%-*@3 qtf]-|Message to display in QTF format.&]
[s7; [*/ Return value]-|1 for Retry; 0 when Cancel button was clicked;&]
[s3; &]
[s4; &]
[s5;:Upp`:`:ErrorAbortRetry`(const char`*`):%- [@(0.0.255) int]_[* ErrorAbortRetry]([@(0.0.255) c
onst]_[@(0.0.255) char]_`*[*@3 qtf])&]
[s2;%- Variant with Abort and Retry buttons.&]
[s7; [%-*@3 qtf]-|Message to display in QTF format.&]
[s7; [*/ Return value]-|1 for Abort; 0 when Retry button was clicked;&]
[s3; &]
[s4; &]
[s5;:Upp`:`:ErrorAbortRetryIgnore`(const char`*`):%- [@(0.0.255) int]_[* ErrorAbortRetryI
gnore]([@(0.0.255) const]_[@(0.0.255) char]_`*[*@3 qtf])&]
[s2;%- Variant with Abort, Retry and Ignore buttons.&]
[s7; [%-*@3 qtf]-|Message to display in QTF format.&]
[s7; [*/ Return value]-|1 for Abort; 0 when Retry button was clicked; 
`-1 for Ignore;&]
[s3;%- ]]