Jump to content
Sign in to follow this  
furrycow

msgbox type gui

Recommended Posts

furrycow

is there anyway on creating a msgbox type gui, to expand; when a msgbox appears, the script essentially stops until the user clicks one of the options. is there anyway in which a custom gui could be created midscript and "stop" the next line from being executed until an option is chosen on the custom gui?

;create gui

;script waits for user input of that gui

;likely to have an if statement to determine what button was pressed on custom gui

i am using guioneventmode, and have tried using

;create gui

$var=0

while $var=0

Sleep(1000)

if $var=1 then exitloop

wend

to give the chance to call functions with guictrlsetonevent, but that doesnt work, and within those funcs it would change the $var to "1". But it doesnt even get to call the func, it just continues to loop in the while loop and won't call any function using guictrlsetonevent.

guictrlsetonevent works at different points throughout the script, so i havent missed out any of the general settings that need to stated at the beginning.

Im sorry if this is a little confusing - ive spent ages stuck on this bit!! its killing me!

TIA


Instant Lockerz Invite - www.instantlockerzinvite.co.uk

Share this post


Link to post
Share on other sites
martin

is there anyway on creating a msgbox type gui, to expand; when a msgbox appears, the script essentially stops until the user clicks one of the options. is there anyway in which a custom gui could be created midscript and "stop" the next line from being executed until an option is chosen on the custom gui?

;create gui

;script waits for user input of that gui

;likely to have an if statement to determine what button was pressed on custom gui

i am using guioneventmode, and have tried using

;create gui

$var=0

while $var=0

Sleep(1000)

if $var=1 then exitloop

wend

to give the chance to call functions with guictrlsetonevent, but that doesnt work, and within those funcs it would change the $var to "1". But it doesnt even get to call the func, it just continues to loop in the while loop and won't call any function using guictrlsetonevent.

guictrlsetonevent works at different points throughout the script, so i havent missed out any of the general settings that need to stated at the beginning.

Im sorry if this is a little confusing - ive spent ages stuck on this bit!! its killing me!

TIA

What you've said does not make a lot of sense to me so this answer is based on guessing what you mean and could be off the mark.

I assume you are using GuiOnEventMode.

You get to a certain point and you want a dialogue to pop up and while that is showing, waiting for the user to select an option, you don't want any other control to be selected which would run the event handler for that control.

If that is what you mean then I think that all you need to do is

disable the main gui -->GuiSetState(@SW_DISABLE$Gui)

show the dialog, which could be a custom window or just a MsgBox

then after that enable the gui again -->GuiSetState(@SW_ENABLE,$gui)

Or did I get it wrong?


Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.

Share this post


Link to post
Share on other sites
GEOSoft

I think what he's trying to do is replicate the behaviour of a standard Message box which pauses execution of the script until such time as a button is clicked on the MsgBox.

@furrycow

How customized is your "Custom" message box? Can it be done using the standard MsgBox() flags?


George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

Share this post


Link to post
Share on other sites
martin

I think what he's trying to do is replicate the behaviour of a standard Message box which pauses execution of the script until such time as a button is clicked on the MsgBox.

@furrycow

How customized is your "Custom" message box? Can it be done using the standard MsgBox() flags?

If you use OnEventMode then a MsgBox doesn't stop events queuing up if the user clicks on a control for example while the MsgBox is showing. But using@SW_DISABLE before the dialog shows would stop that.

Edited by martin

Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.

Share this post


Link to post
Share on other sites
GEOSoft

If you use OnEventMode then a MsgBox doesn't stop events queuing up if the user clicks on a control for example while the MsgBox is showing. But using@SW_DISABLE before the dialog shows would stop that.

Very true. one more reason for using a message loop.

George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

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  

×