Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site













SourceForge.net Logo

Informative Dialogs

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.

We distinguish three main families of informative functions:

Prompt - should be used to display common informations.

Exclamation (Warning) - should be used to report not critical issue, but not everything is all right.

Error - should be used to notify about critical error in the application.

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.

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 DeQtf function from RichText package. Below is the code that presenting how to solve such issue:

PromptOK(DeQtf("C:\Program Files\Upp\theide"));

 

Prompt family

Displays informative dialogs.

 

 

Code used to generate above dialog (Please notice that we used DeQtf functino to display U++ appropriate):

PromptOK(DeQtf("U++ is a powerfull framework."));

 


 

void PromptOK(const char *qtf)

The simplest variant with OK button.

qtf

Message to display in QTF format.

 


 

int PromptOKCancel(const char *qtf)

Variant with OK and Cancel buttons.

qtf

Message to display in QTF format.

Return value

1 for OK; 0 when Cancel button was clicked;

 


 

int PromptYesNo(const char *qtf)

Variant with Yes and No buttons.

qtf

Message to display in QTF format.

Return value

1 for Yes; 0 when No button was clicked;

 


 

int PromptYesNoCancel(const char *qtf)

Variant with Yes, No and Cancel buttons.

qtf

Message to display in QTF format.

Return value

1 for Yes; 0 when No button was clicked; 1 for Yes; -1 for Cancel;

 


 

int PromptRetryCancel(const char *qtf)

Variant with Retry and Cancel buttons.

qtf

Message to display in QTF format.

Return value

1 for Retry; 0 when Cancel button was clicked;

 


 

int PromptAbortRetry(const char *qtf)

Variant with Abort and Retry buttons.

qtf

Message to display in QTF format.

Return value

1 for Abort; 0 when Retry button was clicked;

 


 

int PromptAbortRetryIgnore(const char *qtf)

Variant with Abort, Retry and Ignore buttons.

qtf

Message to display in QTF format.

Return value

1 for Abort; 0 when Retry button was clicked; -1 for Ignore;

 


 

int PromptSaveDontSaveCancel(const char *qtf)

Variant with Save, Don't Save and Cancel buttons.

qtf

Message to display in QTF format.

Return value

1 for Save; 0 when Don't Save button was clicked; -1 for Cancel;

 

Exclamation family

Displays dialogs with warning.

 

 

Code used to generate above dialog:

Exclamation("We found that you are not on our donators list.");

 


 

void Exclamation(const char *qtf)

Simply variant with OK button.

qtf

Message to display in QTF format.

 

Error family

Displays dialogs with error.

 

 

Code used to generate above dialog:

ErrorOK("Connectino to host was lost.");

 


 

void ErrorOK(const char *qtf)

The simpliest variant with OK button. Should be used to notify about errors that cannot be avoided at certain point of program execution.

qtf

Message to display in QTF format.

 


 

int ErrorOKCancel(const char *qtf)

Variant with OK and Cancel buttons.

qtf

Message to display in QTF format.

Return value

1 for OK; 0 when Cancel button was clicked;

 


 

int ErrorYesNo(const char *qtf)

Variant with Yes and No buttons.

qtf

Message to display in QTF format.

Return value

1 for Yes; 0 when No button was clicked;

 


 

int ErrorYesNoCancel(const char *qtf)

Variant with Yes, No and Cancel buttons.

qtf

Message to display in QTF format.

Return value

1 for Yes; 0 when No button was clicked; 1 for Yes; -1 for Cancel;

 


 

int ErrorRetryCancel(const char *qtf)

Variant with Retry and Cancel buttons.

qtf

Message to display in QTF format.

Return value

1 for Retry; 0 when Cancel button was clicked;

 


 

int ErrorAbortRetry(const char *qtf)

Variant with Abort and Retry buttons.

qtf

Message to display in QTF format.

Return value

1 for Abort; 0 when Retry button was clicked;

 


 

int ErrorAbortRetryIgnore(const char *qtf)

Variant with Abort, Retry and Ignore buttons.

qtf

Message to display in QTF format.

Return value

1 for Abort; 0 when Retry button was clicked; -1 for Ignore;

 

Last edit by klugier on 10/13/2016. Do you want to contribute?. T++