Sign in to follow this  
Followers 0
kttenneb

Help with question/answer GUI

6 posts in this topic

I am trying to write an application that will ask several combo box questions and then give a recommendation and summary based on the answers to the questions.

I have the recommendations figured out so that it updates the edit box with the answers given.

I would like to setup the summary button to open a new window and display more information after comparing the answers given.

For example: If question #1 is 1, #2 is no, #3 is no, #4 is no, #5 is no, then display something like "use basic configuration"

eventually I would setup a similar message depending on the different combinations of answers given.

I just need one or two examples of how to do this and I can take it from there.

I have been searching the Forums and Help files and cannot find the answer.

I am relatively new to this so I am sorry if I am asking too much. I just need a nudge in the right direction.

Config_Helper2.au3

Share this post


Link to post
Share on other sites



I am trying to write an application that will ask several combo box questions and then give a recommendation and summary based on the answers to the questions.

I have the recommendations figured out so that it updates the edit box with the answers given.

I would like to setup the summary button to open a new window and display more information after comparing the answers given.

For example: If question #1 is 1, #2 is no, #3 is no, #4 is no, #5 is no, then display something like "use basic configuration"

eventually I would setup a similar message depending on the different combinations of answers given.

I just need one or two examples of how to do this and I can take it from there.

I have been searching the Forums and Help files and cannot find the answer.

I am relatively new to this so I am sorry if I am asking too much. I just need a nudge in the right direction.

Welcome to the AUtoIt forums kttenneb :)

All you need to do, if I understand your question, is have a function which is called by the summary button. Add a case for that button and call the function. In the function you simply create the new gui, add any components just as you did for the first gui you made, and have a message loop again. When the option to quit is chosen delete the gui and return from the function.

If you want to stop people returning focus to your first gui before the summary window is closed then use WInSetState(@SW_DISABLE) before the function and use @SW_ENABLE after. Have a look at WinFlash as well.

To know which window is producing messages you might need to use the advanced parameter in GuiGetMsg, for example the Close window system button neeeds to be identified if both guis are active or you will exit your script rather than close the new gui.


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

Thanks for the reply.

I am not as concerned with creating a new form as with the mechanics of looking at multiple answers and displaying conditional text based on those answers.

To simplify I would like if Combo1 = 1 and Combo2 = No then display Basic Configuration

I tried this:

Switch GuiCtrlRead($Combo1, $Combo2)

Case $Combo1, $Combo2

;MsgBox(0,"Selection","You chose " & GuiCtrlRead($Combo1) & " for Combo1")

$output = $output & @CRLF & "" & GuiCtrlRead($Combo1) & ""

Switch GuiCtrlRead($Combo1)

Case $Combo1 = "1" and $Combo2 = "No"

$output = $output & @CRLF & "Basic Config."

GuiCtrlSetData($Edit1,$output)

EndSwitch

EndSwitch

in my wait loop and it did not work.

Share this post


Link to post
Share on other sites

Hey Kttenneb,

Welcome to the forums.

In response to your code, check out the help file - it really is your best friend.

GUICtrlRead normally takes one argument - the control id to be read. You have two arguments - the second is an advanced option for GUICtrlRead.

If you want to read them both you must call them separately:

GUICtrlRead($Combo1)

GuiCtrlRead($Combo2)

I also don't believe Switch statements can be expressions. For that you want to use select

Select

Case GUICtrlRead($Combo1)=1 and GUICtrlRead($Combo2)="No"

EndSelect

Good Luck!

Bob


You can't see a rainbow without first experiencing the rain.

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

Thanks I will try it

Edited by kttenneb

Share this post


Link to post
Share on other sites

Hey thanks alot that worked great, now I can stop pulling my hair out!

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