void PromptOK(const char *qtf);
int PromptOKCancel(const char *qtf);
int PromptYesNo(const char *qtf);
int PromptYesNoCancel(const char *qtf);
int PromptRetryCancel(const char *qtf);
int PromptAbortRetry(const char *qtf);
int PromptAbortRetryIgnore(const char *qtf);
void Exclamation(const char *qtf);
"Positive" answers are reflected as 1, "Negative" as 0, "Cancel" of 3 state prompt (PromptYesNoCancel) as -1 (Cancel for 2-state (PromptOKCancel) is considered "Negative" - 0)
jibe Messages: 294 Registered: February 2007 Location: France
Experienced Member
Hi,
This is very nice and usefull. But sometimes it's a problem !
I'm using an external library, and it has exception messages including "::". You can imagine what happens when I try to display these messages !
Is there an easy solution, or the best is to program a simple ordinary MessageBox ? I don't want to modify the messages in the library, as changes will be lost each time there is a new version...
(sorry for this question : I'm very new to Upp and didn't find anything about that...)
jibe Messages: 294 Registered: February 2007 Location: France
Experienced Member
Waiting to know if there is a better solution, I'll use PromptOk after inserting 0x01 at the begining of the message string. It's working fine and easy to do
I'm using an external library, and it has exception messages including "::". You can imagine what happens when I try to display these messages !
Is there an easy solution, or the best is to program a simple ordinary MessageBox ? I don't want to modify the messages in the library, as changes will be lost each time there is a new version...
Escape the library messages with DeQtf() or DeQtfLf()
nixnixnix Messages: 415 Registered: February 2007 Location: Kelowna, British Columbia
Senior Member
Hey Mirek,
Is it the same under windows and linux? I find it confusing that there are constants defined in TopWindow.h which one would think were the proper return values of functions such as PromptYesNoCancel() and PromptAbortRetryIgnore()
I find it confusing that there are constants defined in TopWindow.h which one would think were the proper return values of functions such as PromptYesNoCancel() and PromptAbortRetryIgnore()
Don't you think this is an inconsistency?
Well, I must say it never came to my mind since now. But yes, I guess you can consider it a little bit confusing.
I really must say that this is confusing. I thought I could use this ID* macros an every dialogs until now. (Hey it even worked most of the time)
And then I see here why I have spent the last hour searching for a bug: Cancel is not always the same number...
I think the dialog results would be a good point to refactor U++ a little
A simply enum would simplify this a lot.