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












SourceForge.net Logo
Home » Extra libraries, Code snippets, applications etc. » U++ users applications in progress and useful code snippets, including reference examples! » MsgBox is PromptOK in U++
MsgBox is PromptOK in U++ [message #300] Wed, 07 December 2005 15:26 Go to next message
fudadmin is currently offline  fudadmin
Messages: 1321
Registered: November 2005
Location: Kaunas, Lithuania
Ultimate Contributor
Administrator
MsgBox is PromptOK in U++:

from HelloWorld:
	PromptOK("{{1@5 [@9= This is the]::@2 [A5@0 Ultimate`+`+ Hello world sample}}");


or simply:
PromptOK("Prompt sample");
Re: MsgBox is PromptOK in U++ [message #367 is a reply to message #300] Thu, 08 December 2005 23:05 Go to previous messageGo to next message
fudadmin is currently offline  fudadmin
Messages: 1321
Registered: November 2005
Location: Kaunas, Lithuania
Ultimate Contributor
Administrator
also
PromptOKCancel("test");
Re: MsgBox is PromptOK in U++ [message #368 is a reply to message #367] Thu, 08 December 2005 23:22 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
Actually:

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)
Re: MsgBox is PromptOK in U++ [message #4170 is a reply to message #300] Wed, 26 July 2006 21:56 Go to previous messageGo to next message
accavalcanti is currently offline  accavalcanti
Messages: 1
Registered: July 2006
Junior Member
What about the formating characters used in PromptOK ("{{1@5 [@9=" etc.)? Where can I found info on how to use it?
Re: MsgBox is PromptOK in U++ [message #4171 is a reply to message #4170] Wed, 26 July 2006 23:10 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
http://upp.sourceforge.net/srcdoc$RichText$QTF$en-us.html

(the same info can be found in RichText topic++).

Mirek
Re: MsgBox is PromptOK in U++ [message #9909 is a reply to message #300] Fri, 08 June 2007 10:04 Go to previous messageGo to next message
jibe is currently offline  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...)
Re: MsgBox is PromptOK in U++ [message #9910 is a reply to message #300] Fri, 08 June 2007 10:31 Go to previous messageGo to next message
jibe is currently offline  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 Smile
Re: MsgBox is PromptOK in U++ [message #9911 is a reply to message #9909] Fri, 08 June 2007 11:22 Go to previous messageGo to next message
guido is currently offline  guido
Messages: 169
Registered: April 2006
Experienced Member
Quote:

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()

Guido
Re: MsgBox is PromptOK in U++ [message #9976 is a reply to message #300] Tue, 12 June 2007 08:50 Go to previous messageGo to next message
jibe is currently offline  jibe
Messages: 294
Registered: February 2007
Location: France
Experienced Member
Hi,

Sorry to be late... I was busy on another project...

Yes, DeQtfLf() is fine ! Don't like so much DeQtf(), but it's probably usefull in some cases...

Thanks Smile
Re: MsgBox is PromptOK in U++ [message #13440 is a reply to message #9976] Sun, 06 January 2008 21:18 Go to previous messageGo to next message
nixnixnix is currently offline  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()

Don't you think this is an inconsistency?

Nick
Re: MsgBox is PromptOK in U++ [message #13531 is a reply to message #13440] Sun, 13 January 2008 14:42 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
nixnixnix wrote on Sun, 06 January 2008 15:18

Hey Mirek,

Is it the same under windows and linux?



Yes.

Quote:


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.

Mirek
Re: MsgBox is PromptOK in U++ [message #17386 is a reply to message #300] Mon, 11 August 2008 20:33 Go to previous messageGo to next message
kodos is currently offline  kodos
Messages: 111
Registered: March 2008
Experienced Member
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 Smile
A simply enum would simplify this a lot.
Re: MsgBox is PromptOK in U++ [message #47205 is a reply to message #17386] Wed, 28 December 2016 23:15 Go to previous messageGo to next message
roger is currently offline  roger
Messages: 9
Registered: August 2016
Promising Member
My Exclamation() (Upp 5485) seems to be having a problem with some but not all '-' characters in its string argument. For example:

int I=-1;
String msg;
msg.Cat() << "I=" << I << " is negative (-)";
Exclamation(msg);

displays as: I=-1 is negative(-)

(as I would expect), but

int I=-1;
String msg;
msg.Cat() << "I-" << I << " is negative (-)";
Exclamation(msg);

displays as: I
ERROR: Not in table: 1 is negative(-)

and

Exclamation("i -- is a negative number.");

displays as: I
ERROR: Not in table: is a negative numbe

Any ideas as to how I could get Exclamation() to work more reliably would be appreciated.

Smile

Re: MsgBox is PromptOK in U++ [message #47209 is a reply to message #47205] Thu, 29 December 2016 08:53 Go to previous message
koldo is currently offline  koldo
Messages: 3354
Registered: August 2008
Senior Veteran
Hi Roger

Just use DeQtf() and your problem will be solved.

	int I=-1;
	String msg;
	msg.Cat() << "I-" << I << " is negative (-)";
	Exclamation(DeQtf(msg));

index.php?t=getfile&id=5117&private=0
  • Attachment: Captura.JPG
    (Size: 12.39KB, Downloaded 370 times)


Best regards
IƱaki
Previous Topic: simmxtools v0.1
Next Topic: STimer-appLauncher'nProcWndListTweak
Goto Forum:
  


Current Time: Thu Mar 28 10:43:33 CET 2024

Total time taken to generate the page: 0.01131 seconds