Sign in to follow this  
Followers 0
zellis

Gui Values Loaded Via File

11 posts in this topic

#1 ·  Posted (edited)

i have a gui that contains 4 sets of raido buttons and 2 drop down boxes. the program works fine but the user must re-enter the data into the GUI every time the program complets. so i made a "load from file" feature that reads a pre-set configuration that the user can load to configur the GUI. now i can get the GUI to automaticly load all the raido buttons from file, but i cant seem to load values into the drop down boxes. so basicly what im trying to do is automaticly configure a GUI from file. here is some of my code

here is part of my GUI where i create the drop down box

removed

here is the case where i load from file. see my notes in the code where i can not make it work

i removed the code that was here

any help would be great!!! thankyou.

shawn :)

Edited by zellis

Share this post


Link to post
Share on other sites



The first thing I see is that you are reassigning the variables you are using for your combo boxes with the inireads. If you could post your whole code it would be easier to help you.

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

 

Edited by zellis

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

the code is too large to post all of it, here is the .au3 file,

RENAME the "IPU_CONFIGURATION_TOOL2.JPG.au3 to IPU_CONFIGURATION_TOOL2.JPG"

to make it work right, create this path and copy the jpg file into it. then run the .au3

"c:\program files\IPU Configurator\IPU_CONFIGURATION_TOOL2.JPG",10,0, 470, 130);creating GUI artwork

thanks

Edited by zellis

Share this post


Link to post
Share on other sites

the code is too large to post all of it, here is the .au3 file,

RENAME the "IPU_CONFIGURATION_TOOL2.JPG.au3 to IPU_CONFIGURATION_TOOL2.JPG"

to make it work right, create this path and copy the jpg file into it. then run the .au3

"c:\program files\IPU Configurator\IPU_CONFIGURATION_TOOL2.JPG",10,0, 470, 130);creating GUI artwork

thanks

I don't have a config ini file to test it with, but see it this works.

Share this post


Link to post
Share on other sites

thankyou! it works, well at least one of the combo boxes does, but ill fix the other one later. i an mot farmilular with the "switch" function you used in replace of "select" for select case. i cannot find any usage for it online, and my editor does not either... i get a explorer error , page not found using the function popup help on sciTC editor. i even updated to the latest revs too, can you tell me the usage on the switch function? thanks

Share this post


Link to post
Share on other sites

thankyou! it works, well at least one of the combo boxes does, but ill fix the other one later. i an mot farmilular with the "switch" function you used in replace of "select" for select case. i cannot find any usage for it online, and my editor does not either... i get a explorer error , page not found using the function popup help on sciTC editor. i even updated to the latest revs too, can you tell me the usage on the switch function? thanks

Switch requires the beta version.

I can't explain Switch very well, but you can save a lot of code by using it.

For example using Select:

Select
    Case @HOUR = 6 Or 7 Or 8 Or 9 Or 10 Or 11
        $msg = "Good Morning"
    Case @HOUR = 12 Or 13 Or 14 Or 15 Or 16 Or 17
        $msg = "Good Afternoon"
    Case @HOUR = 18 Or 19 Or 20 Or 21
        $msg = "Good Evening"
    Case Else
        $msg = "What are you still doing up?"
EndSelect

MsgBox(0, Default, $msg)

The same outcome using Switch

Switch @HOUR
    Case 6 To 11
        $msg = "Good Morning"
    Case 12 To 17
        $msg = "Good Afternoon"
    Case 18 To 21
        $msg = "Good Evening"
    Case Else
        $msg = "What are you still doing up?"
EndSwitch

MsgBox(0, Default, $msg)

Share this post


Link to post
Share on other sites

Switch requires the beta version.

I can't explain Switch very well, but you can save a lot of code by using it.

For example using Select:

Select
    Case @HOUR = 6 Or 7 Or 8 Or 9 Or 10 Or 11
        $msg = "Good Morning"
    Case @HOUR = 12 Or 13 Or 14 Or 15 Or 16 Or 17
        $msg = "Good Afternoon"
    Case @HOUR = 18 Or 19 Or 20 Or 21
        $msg = "Good Evening"
    Case Else
        $msg = "What are you still doing up?"
EndSelect

MsgBox(0, Default, $msg)

The same outcome using Switch

Switch @HOUR
    Case 6 To 11
        $msg = "Good Morning"
    Case 12 To 17
        $msg = "Good Afternoon"
    Case 18 To 21
        $msg = "Good Evening"
    Case Else
        $msg = "What are you still doing up?"
EndSwitch

MsgBox(0, Default, $msg)
Actually if you use the right syntax, it explains it even better on why switch is sometimes favored in certain situations:
Select
    Case @HOUR = 6 Or @HOUR = 7 Or @HOUR = 8 Or @HOUR = 9 Or @HOUR = 10 Or @HOUR = 11
        $msg = "Good Morning"
    Case @HOUR = 12 Or @HOUR = 13 Or @HOUR = 14 Or @HOUR = 15 Or @HOUR = 16 Or @HOUR = 17
        $msg = "Good Afternoon"
    Case @HOUR = 18 Or @HOUR = 19 Or @HOUR = 20 Or @HOUR = 21
        $msg = "Good Evening"
    Case Else
        $msg = "What are you still doing up?"
EndSelect

MsgBox(0, Default, $msg)
Can get cumbersome to say the least.

[center]Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.[/center]

Share this post


Link to post
Share on other sites

Actually if you use the right syntax, it explains it even better on why switch is sometimes favored in certain situations:

Select
    Case @HOUR = 6 Or @HOUR = 7 Or @HOUR = 8 Or @HOUR = 9 Or @HOUR = 10 Or @HOUR = 11
        $msg = "Good Morning"
    Case @HOUR = 12 Or @HOUR = 13 Or @HOUR = 14 Or @HOUR = 15 Or @HOUR = 16 Or @HOUR = 17
        $msg = "Good Afternoon"
    Case @HOUR = 18 Or @HOUR = 19 Or @HOUR = 20 Or @HOUR = 21
        $msg = "Good Evening"
    Case Else
        $msg = "What are you still doing up?"
EndSelect

MsgBox(0, Default, $msg)
Can get cumbersome to say the least.
Thanks for catching that SmOke_N. :)

Share this post


Link to post
Share on other sites

Thanks for catching that SmOke_N. :(

No worries, I know you were concentrating on explaining the difference with an example, not providing a syntax explination :).

[center]Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.[/center]

Share this post


Link to post
Share on other sites

i have the latest beta version, but ...oh i found it, its not located under the regular help screen, but under the beta help screen!... thanks again

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