DragonFireSDK Forum
Programming Discussions => Tips and Tricks => Topic started by: tim on May 08, 2012, 01:11:26 pm
-
If you ever need to show an alert message to your user (the translucent dialog box that has a message and an OK button) you can add the following code to your App.cpp file and add this functionality yourself.
#ifdef __APPLE__
int AlertShow(char *title, char *message);
#else
#include "Windows.h"
int AlertShow(char *title, char *message)
{
MessageBox(NULL,message,title,MB_OK);
return(1);
}
#endif
-
Very interesting, I'm sure I'll use this for debugging!
-
yep! very useful... will there be also something like PromptShow() and ConfirmShow() in the future?
-
yep! very useful... will there be also something like PromptShow() and ConfirmShow() in the future?
It's possible. What are you thinking that those functions would do?
-
Also, maybe a call back for pressing "Ok" or "Cancel".
-
yep! very useful... will there be also something like PromptShow() and ConfirmShow() in the future?
It's possible. What are you thinking that those functions would do?
As Tom said, a "ConfirmShow" could show some text and some buttons below (eg. Ok/Cancel, or Yes/No...) with their callbacks... and a PromptShow could create a dynamic input field to write something "on the fly" and handle it in some way...
-
This would be very helpful for debugging on a device and could also be used within a game. A callback with which button the user pressed would also be handy.
-
Uhm, i'm working on a new app... i have 3 pages, and a tabbar with a button linked to each page... in the first page should happen something that shows a popup with two buttons(e.g. Page2, Page3), so that the user can choose to go to the second or third page... is there some other native function to achieve this? or is there any chance to have it on a next version of DFSDK?
thanks
-
Scott and xabaras,
E-mail me at tim@zimusoft.com and I will hook you up...
Cheers,
-
I take it this won't compile on IOS due to windows.h? is there anyway to actually make this work on an app release....
-
It works on both, that's what the conditional compile is for.
-
It works on both, that's what the conditional compile is for.
conditional compile, what does this mean? i'm a n00b when it comes to C++
-
It works on both, that's what the conditional compile is for.
conditional compile, what does this mean? i'm a n00b when it comes to C++
See http://www.bing.com/search?q=conditional+compile+ifdef
-
It works on both, that's what the conditional compile is for.
conditional compile, what does this mean? i'm a n00b when it comes to C++
See http://www.bing.com/search?q=conditional+compile+ifdef
I get it now... I re-read the original post and its now clear... Also Bing is gay. Changed my iPhone default search.
-
this works also on the real device?
-
has the alert show function with OK and CANCEL button been implemented???
-
can anyone help me with the alertshow function with two custom buttons?
-
Sorry, im a bit new to this!
Should I add the code as shown by Tim into a header file?
Also, will I get an email for the 2.2 update?
-
this is image to do allert box on devide, using photoshop you can delete this text and write your.
-
Why would you use that when you have the original Apple function to use insted????
-
really? i dont know the apple funcion!
-
Well the thread you posted in explians how to imploment it.....
-
But with the original image you can edit the message and add the ok and cancel buttons :)
-
Well if you read the thread it says that you can add custom messages but if you want a cancel button you have to add it your self like Nico91
-
You dont need any images or anything its all done for you use the code that tim has provided on the first page as a header file and include it in your app.cpp then call the function with the title and message you want
grant