Sign in to follow this  
Followers 0
iras77

Confirmation popup

7 posts in this topic

Hi.

I was trying to find it on forum - whitout success :D

My script is almost completed but i need one thing more. On mine window there is lot of buttons (each has own function after clicked) and I need popup window to confirm selection. The best would be if the question on popup has some text from cliced button - to ensure what has been clicced. Actions: continue script if YES is clicked, return to main window if NO.

Can anyone help? Or post link to solution.

Thanks.

Sorry for bad english :/

Share this post


Link to post
Share on other sites



Goto the help file and lookup: MsgBox.

Then read the text in there, especially the Remarks.

unfortunately it is not easy to get all answers from help file. Thats why the forum still exist.

So if anyone has something more creative to say please to that.

Thanks again.

Share this post


Link to post
Share on other sites

Not easy?

Just look to the help file. The MsgBox article to be exact. How simple can it be?!

3 thing needed: flag, "title", "text".

If you look a little more down to the Remark section (I mentioned in a earlier post) you see the following: "The flag parameter can be a combination of the following values:"

Yes, the first value inputted in the MsgBox command is the flag value out of the Remarks section.

So one of the 3 things is done here. The yes/no button flag is "4" if you want everything to be chewed for you instead of looking at it for less then 5 seconds.

I hope you can think of the title and text yourself, yes?

Then:

If you look at the Return Value: "Success: Returns the ID of the button pressed."

So, I would guess the MsgBox would return one on the values shown BELOW THE RETURN SECTION.

Then you would know which button is pressed.

But I guess you want someone to produce the code for you as well?

You have to PM Valik for that. He loves your kind.


My active project(s): A-maze-ing generator (generates a maze)

My archived project(s): Pong3 (Multi-pinger)

Share this post


Link to post
Share on other sites

Tanks for interesting my problem but You get me wrong.

I know how to cerate msgBox. Everything is in help file as you said.

My problem is using it :D

If $Button1 is clicked msgBox should appear. After YES clicked $msg = $Button1, if NO .... (I don't know what...)

Where and how to put msgBox to appear if anything is clicked? That help file dosen't say

it look like that :

....................

GUI Section

..........................

GUISetState()

Do

$msg = GUIGetMsg()

If $msg = $Button1 Than

WinActive............

.......................

EndIf

If $msg = $Button2 Than

WinActive............

.......................

EndIf

Until $msg = $GUI_EVENT_CLOSE

Share this post


Link to post
Share on other sites

You should thoroughly familiarize yourself with MsgBox function, very very basic stuff here :D If you've got a whole script going this should be easy...

A basic MsgBox i.e.:

MsgBox(0, "Title", "Message")       ; The 0 flag means the box should just have an "OK" buttonoÝ÷ Ù­º¹ì×^⢱ÉbrGJÊ²È Ø^2È£hÓ~«zÊhÇ­éò¢èZ½æ®¶­sbb33c·&W7öç6RÒ×6t&÷ÂgV÷CµFFÆRgV÷C²ÂgV÷C´ÖW76vRgV÷C²·&W7öç6RÒgFW"W6W"&W76W2FRgV÷C´ô²gV÷C²'WGFöà

Start there and use the help file to help figure out how the above can be modified to work for you.

Share this post


Link to post
Share on other sites

THANKS!

$response was the key!

It works great!

For other who needs that and dont know how to make confirmation popup.

Do

$msg = GUIGetMsg()

If $msg = $Button1 Than

$response = MsgBox(0, "Title", "Message") ;response = 1 after user presses the "OK" button

If $response = 1 Than

WinActive............

.......................

EndIf

EndIf

If $msg = $Button2 Than

$response = MsgBox(0, "Title", "Message") ;response = 1 after user presses the "OK" button

If $response = 1 Than

WinActive............

.......................

EndIf

EndIf

Until $msg = $GUI_EVENT_CLOSE

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0