Jump to content
  • Advertisement
Sign in to follow this  
XDaWNeDX

custom messagebox like messagebox()

This topic is 2595 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi, i need to create a custom messagebox function like messagebox()

So i can choose what buttons are displayed, what the text in the box is, the title of the box, etc.

I was thinking i would create a dialog and a function. When the function is called, it would change some values, hide some buttons, show other buttons, then call the doModal function of the dialog.

Only problem, the syntax would be something like this..

MyMessageBox(variable 1, variable 2, etc);

How could i make the syntax

MyMessageBox("text","text", etc);?

Or is there a more optimized way to create a messagebox function?

Oh. And this is in c++, if there was any confusion..

Share this post


Link to post
Share on other sites
Advertisement

Only problem, the syntax would be something like this..

MyMessageBox(variable 1, variable 2, etc);

How could i make the syntax

MyMessageBox("text","text", etc);?


Also, could you clarify what you mean by this? Je ne comprends pas.

Share this post


Link to post
Share on other sites

Hi, i need to create a custom messagebox function like messagebox()

So i can choose what buttons are displayed, what the text in the box is, the title of the box, etc.



The existing messagebox already allows you to select which buttons, icons, title and text you want.
If you wish to include variables in the text, format it to a string using stringstream or sprintf

Share this post


Link to post
Share on other sites
No, it lets you choose between a set of buttons. I can not use "this is a button" in the existing messagebox.

The way my function works now is as follows...
firstcaption = "hello world";
Firsttext = "hello world";
MyMessageBox(firstcaption,firsttext,buttons124);

I want to be able to use actual text, instead of a variable in my messagebox function... so its something like this...

MyMessageBox("hello world","hello world",buttons125);

Share this post


Link to post
Share on other sites
Huh?

What is the function prototype of MyMessageBox()? What are the types of firstcaption and Firsttext?

Share this post


Link to post
Share on other sites

No, it lets you choose between a set of buttons. I can not use "this is a button" in the existing messagebox.


Perhaps you should look into formulating your questions better in the future, "what buttons" seems to indicate an existing set of buttons.
This is not meant as criticism, rather a strong suggestion to look into "how to ask questions", there is undoubtedly a post about it on the forums.
It will save you a lot of time.



How could i make the syntax

MyMessageBox("text","text", etc);?



Since the existing messagebox macro/command will not suffice, you're left with making your own implementation via createwindow etc.

That leaves the question of syntax, refer to variable arguments

Share this post


Link to post
Share on other sites

[quote name='XDaWNeDX' timestamp='1304874296' post='4808148']
No, it lets you choose between a set of buttons. I can not use "this is a button" in the existing messagebox.


Perhaps you should look into formulating your questions better in the future, "what buttons" seems to indicate an existing set of buttons.
This is not meant as criticism, rather a strong suggestion to look into "how to ask questions", there is undoubtedly a post about it on the forums.
It will save you a lot of time.



How could i make the syntax

MyMessageBox("text","text", etc);?



Since the existing messagebox macro/command will not suffice, you're left with making your own implementation via createwindow etc.

That leaves the question of syntax, refer to variable arguments
[/quote]


I apologize, I have no internet access aside from my phone. So I tend to have a lot of mistakes. Thank you though, ill try that link

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!