Jump to content

Gui Values Loaded Via File


Recommended Posts

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
Link to comment
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

Edited by zellis
Link to comment
Share on other sites

  • Moderators

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.

Link to comment
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

Link to comment
Share on other sites

  • Moderators

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)
Link to comment
Share on other sites

  • Moderators

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.

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.

Link to comment
Share on other sites

  • Moderators

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. :)
Link to comment
Share on other sites

  • Moderators

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 :).

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.

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...