DragonFireSDK Forum

Programming Discussions => Tips and Tricks => Topic started by: tim on May 08, 2012, 01:11:26 pm

Title: DragonFireSDK Undocumented Function: AlertShow()
Post 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.

Code: [Select]
#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
Title: Re: DragonFireSDK Undocumented Function: AlertShow()
Post by: Tom on May 09, 2012, 05:25:55 am
Very interesting, I'm sure I'll use this for debugging!
Title: Re: DragonFireSDK Undocumented Function: AlertShow()
Post by: xabaras on May 09, 2012, 12:25:11 pm
yep! very useful... will there be also something like PromptShow() and ConfirmShow() in the future?
Title: Re: DragonFireSDK Undocumented Function: AlertShow()
Post by: tim on May 09, 2012, 01:31:56 pm
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?
Title: Re: DragonFireSDK Undocumented Function: AlertShow()
Post by: Tom on May 09, 2012, 01:52:38 pm
Also, maybe a call back for pressing "Ok" or "Cancel".
Title: Re: DragonFireSDK Undocumented Function: AlertShow()
Post by: xabaras on May 09, 2012, 03:45:13 pm
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...
Title: Re: DragonFireSDK Undocumented Function: AlertShow()
Post by: Scott on June 05, 2012, 11:27:04 am
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.
Title: Re: DragonFireSDK Undocumented Function: AlertShow()
Post by: xabaras on August 12, 2012, 02:56:02 pm
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
Title: Re: DragonFireSDK Undocumented Function: AlertShow()
Post by: tim on August 13, 2012, 09:12:24 am
Scott and xabaras,

E-mail me at tim@zimusoft.com and I will hook you up...

Cheers,
Title: Re: DragonFireSDK Undocumented Function: AlertShow()
Post by: Djjammin on September 01, 2012, 07:43:21 am
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....
Title: Re: DragonFireSDK Undocumented Function: AlertShow()
Post by: stuckerj on September 02, 2012, 09:07:22 pm
It works on both, that's what the conditional compile is for.
Title: Re: DragonFireSDK Undocumented Function: AlertShow()
Post by: Djjammin on September 13, 2012, 01:25:33 pm
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++
Title: Re: DragonFireSDK Undocumented Function: AlertShow()
Post by: stuckerj on September 13, 2012, 08:57:10 pm
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
Title: Re: DragonFireSDK Undocumented Function: AlertShow()
Post by: Djjammin on September 14, 2012, 12:09:19 pm
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.
Title: Re: DragonFireSDK Undocumented Function: AlertShow()
Post by: Nico91 on October 29, 2012, 04:46:34 am
this works also on the real device?
Title: Re: DragonFireSDK Undocumented Function: AlertShow()
Post by: pipizanzibar on January 16, 2013, 02:02:09 pm
has the alert show function with OK and CANCEL button been implemented???
Title: Re: DragonFireSDK Undocumented Function: AlertShow()
Post by: pipizanzibar on January 23, 2013, 12:35:41 pm
can anyone help me with the alertshow function with two custom buttons?
Title: Re: DragonFireSDK Undocumented Function: AlertShow()
Post by: Micboy on January 23, 2013, 02:54:47 pm
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?
Title: Re: DragonFireSDK Undocumented Function: AlertShow()
Post by: Nico91 on January 24, 2013, 05:12:08 am
this is image to do allert box on devide, using photoshop you can delete this text and write your.
Title: Re: DragonFireSDK Undocumented Function: AlertShow()
Post by: DeadSn0wMan on January 24, 2013, 12:10:21 pm
Why would you use that when you have the original Apple function to use insted????
Title: Re: DragonFireSDK Undocumented Function: AlertShow()
Post by: Nico91 on January 24, 2013, 04:05:34 pm
really? i dont know the apple funcion!
Title: Re: DragonFireSDK Undocumented Function: AlertShow()
Post by: DeadSn0wMan on January 24, 2013, 04:55:06 pm
Well the thread you posted in explians how to imploment it.....
Title: Re: DragonFireSDK Undocumented Function: AlertShow()
Post by: ciuffolo on January 29, 2013, 03:01:00 pm
But with the original image you can edit the message and add the ok and cancel buttons :)
Title: Re: DragonFireSDK Undocumented Function: AlertShow()
Post by: DeadSn0wMan on January 30, 2013, 08:58:49 am
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
Title: Re: DragonFireSDK Undocumented Function: AlertShow()
Post by: grantw1991 on February 11, 2013, 04:58:28 am
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