PDA

View Full Version : Need Confirmation Message


Mathew202
11-22-2006, 06:19 AM
i need to be able to set a confirmation message asking if the user is sure thwey wish to exit my application, cant this be done?

bule
11-22-2006, 06:42 AM
Yes, explanation is available in manual for that.
It's one of the built-in functions and you define it in the global functions.

(I'm not at home so I can't give you detailed info...)

TristanD
11-22-2006, 07:26 AM
do a search.. i know its already been done with an example posted

Mathew202
11-22-2006, 12:55 PM
i did do a search but i didnt find anything???

Worm
11-22-2006, 01:01 PM
hmmm.... I did a search with these words: confirm exit

here is the second hit:
http://www.indigorose.com/forums/showthread.php?t=13408&highlight=confirm+exit

bule
11-22-2006, 04:35 PM
Maybe should Tigg do a little Flash tutorial about search functionality... :D

Intrigued
11-22-2006, 05:38 PM
Maybe should Tigg do a little Flash tutorial about search functionality... :D

lmao......

holtgrewe
11-22-2006, 05:51 PM
if e_ID == 300 then
Pexit = Dialog.Message("Exit ?", "Do you wish to Exit ?", MB_YESNO, MB_ICONQUESTION);
if Pexit == IDYES then
Application.Exit(); end
end

I normally use the above code from a menu option.
I hope this helps.

Mathew202
11-23-2006, 06:17 AM
will these work when you press a button ? as i cant get it working .

Dermot
11-23-2006, 10:22 AM
If you put this code (from Worms' link) in the Global Functions, it will ask to confirm exit no matter how you exit, from a button, a menu, by clicking the X etc.

function QueryAllowProjectClose()
result = Dialog.Message("Exit Application?", "Would you like to exit the application?", MB_YESNO, MB_ICONEXCLAMATION, MB_DEFBUTTON1);

--the no button was pressed
if result == 7 then
--cancel exit
return false;
else
--allow exit
return true;
end
end

The neat thing about this is you can have an exit button on every poage for example but you need this one pioece of code.

Mathew202
11-23-2006, 05:01 PM
ok i will try again,

Mathew202
11-24-2006, 12:35 PM
nope still not working for me :(

i have tried using it on a button ( this button exits the program ) but nothing happens, i have tried for hours and hours, please help :)

holtgrewe
11-24-2006, 01:02 PM
Try this scripting in the On Click option on the button:

Pexit = Dialog.Message("Exit ?", "Do you wish to Exit ?", MB_YESNO, MB_ICONQUESTION);
if Pexit == IDYES then
Application.Exit();
end

Dermot's example should work globally for you, whenever you call his function.

My attached example will not work globally for you as is, and would need to be coded for each button or image in your project for 'exiting'.

I hope this works for you.

Mathew202
11-24-2006, 02:37 PM
thank you this worked really well.