Jump to content

Au3gui Objects And Controls


alawoona
 Share

Recommended Posts

I have almost completed writing a script that uses an AU3GUI gui to build other gui's and then writes the AU3GUI code to a script file. I am trying to incorporate some of Larry's cool guiasst code to help move controls around and resize them. My script will create a bunch of AU3GUI objects 1, 2, 3, 4, etc. These generally corrspond to the order in which WinGetClassList will return controls - Static1, Edit1, Edit2 etc. But not always. For example, I have a picture as OBJ15 but it shows up as Static1 from WinGetClassList, even when there are other Label objects as OBJ1, OBJ2 etc. Is there a relationship between the OBJ numbers and the information returned by WinGetClassList. Also noted that a combobox object results in two controls - and Edit and a Combo when returned by WinGetClassList.

Hopefully my question is understandable - too many glasses of red wine here makes it tough to write.

Link to comment
Share on other sites

Yeah - figured that would be the answer for the combobox observation.

Let me ask my question another way. I know the AU3GUI OBJ number and object type for each of the objects in my gui. How can I determine what the classnameNN will be for a particular OBJ number & type so I can address that control directly with the control functions in AutoIT3? If there is no relationship then I think I am screwed.

Link to comment
Share on other sites

The best solution I can think of is set the text parameter for each control to something your script will be able to internally recognize. Then you can search for a specific control by reading the text of all the controls until you find the one you want. For a combo or listbox, just set some data that you can read. I don't know what to do in the case of a picture or icon control, however.

Edit: The same holds true for anything about the control, including the size and position.

Edited by Valik
Link to comment
Share on other sites

Ironically, I just ran into a problem where I had to programmatically get the class instance of a control at run time. Here's something that might help you:

ControlFocus("Test GUI", "", "Input 3")
$res = ControlGetFocus("Test GUI")

What that does is uses the new text maching logic instead of a class name. By setting focus to the control, then using ControlGetFocus, I get the class instance. This seems to be an acceptable solution for now (Untested on disabled/hidden controls...).

Idea: In the future, we need a function to return the class instance of a control using text match to find it.

Edit: ControlFocus fails on a disabled control (as I expected it might). It works on hidden controls.

Edited by Valik
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...