Jump to content

Recommended Posts

  • Administrators
Posted (edited)

http://www.autoitscript.com/autoit3/files/unstable/autoit/

I got a really rude email from some blind guy who ranted at me for the ClassNN parameter in the Control...() functions. Saying that it was badly thought out, programmer's don't give a shit about blind people and whenever he makes a suggestion they ignore him, etc.

I replied that maybe he should look at the way makes suggestions and to not be so rude...that really set him off :ph34r:

After the ranting there was a valid suggestion in there that his screenreader software can speak the Control ID number of a control (actually the same ID that is used in the GUI) so I modified AutoIt spy and AutoIt to work with these numbers. The Control ID is probably the best method to use anyway except when working with static text controls (which often have the same ID).

The supported methods for working with controls are now:

- Control ID

- ClassnameNN

- Text on the control

The control functions choose the method based on the parameter you pass. For example if you pass them a number (or a string that is a number) then the control ID method is used, otherwise the parameter is assumed to be a classname/text.

Please have a play with the spy and autoit to make sure controls still work...I've renabled the GUI code too.

Edited by Jon
  • Replies 113
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Posted (edited)

Even if he was was so rude you acted very nicely. You are the best Jon. :ph34r:

But maybe we already have an other email for the clueless Hate mail section...

Edited by ezzetabi
Posted

I tried this new funcion of Autoitspy, but I can't understand what advantages it have over the old ControlNN... the control id is unique at the same way...

Posted

If the controls are ever re-ordered for some reason by the application developer (I have experienced this), the ID of the control is very unlikely to change, but the classNN very likely will.

Posted (edited)

Call me blind, but I don't seem to see any difference in the au3spy or helpfile...

<{POST_SNAPBACK}>

http://www.autoitscript.com/fileman/users/public/_pekster_resource/au3_spy-classes.gif

Note the addition of the ControlID and name.

It appears in the 3.0.103 beta as of Aug 5th.

Typo in the date

Edited by pekster

[font="Optima"]"Standing in the rain, twisted and insane, we are holding onto nothing.Feeling every breath, holding no regrets, we're still looking out for something."[/font]Note: my projects are off-line until I can spend more time to make them compatable with syntax changes.

Posted (edited)

The control functions choose the method based on the parameter you pass.  For example if you pass them a number (or a string that is a number) then the control ID method is used, otherwise the parameter is assumed to be a classname/text.

<{POST_SNAPBACK}>

The "string that is a number" is not strictly true if a button's text is a number.....

What are you supposed to do if you have a button with no text? An empy string is treated like a zero control ID :(:ph34r: I guess the answer is "don't do that" :lol: ... but it should probably be documented

Opt("GUINotifyMode", 1)
GuiCreate("MyGUI")

$BUTTON_TEXT = ""
;;;$BUTTON_TEXT = "fooText"
;;;$BUTTON_TEXT = "42"

$button_1 = GUISetControl("button", $BUTTON_TEXT, 50, 20, 100, 40)

GuiShow()
While 1
    sleep(100)
    $msg = GuiMsg(0)
    Select
    Case $msg = -3
        Exit
    Case $msg = $button_1
        $x = ControlGetPos("MyGUI","",$BUTTON_TEXT)
        MsgBox(4096,"Coords", "x=" & $x[0] & " y=" & $x[1])
    EndSelect
WEnd
Exit

P.S. Forum upgrade note: Smilies are now inserted at the cursor position instead of at the very end :lol:

Edited by CyberSlug
Use Mozilla | Take a look at My Disorganized AutoIt stuff | Very very old: AutoBuilder 11 Jan 2005 prototype I need to update my sig!
  • Administrators
Posted

I've got changed documentation at this end, just not uploaded yet as the helpfile is more difficult to convert from GUI mode to non-GUI mode. :ph34r:

In Opera smilies are still inserted right at the end, grr. Maybe I'll bug report it.

Control ID 0 is classed as invalid and never checked as the code converts the string to a number and checks if it is 0, if >0 it checks for the control ID. If that fails it moves onto the classname and if that fails it moves onto the text. I may change it today to check the variant type is a number to decide what to do (although the string only approach may have to be used in AutoItX because of lack of variants)

  • Administrators
Posted

P.S.  Forum upgrade note:  Smilies are now inserted at the cursor position instead of at the very end :ph34r:

Bah, this doesn't work in Opera (what I'm using). I reported it as a bug and apparrently it's a bug in Opera's javascript parsing that Opera won't fix due to it not being W3C (or something) compliant. :(
  • Administrators
Posted

Updated:

The variant rewrite seems to be OK, but keep an eye on any "odd" math results.

http://www.autoitscript.com/autoit3/files/unstable/autoit/

- Added: Control ID is now shown in the AutoIt Window Spy

- Changed: (Internal) Variant rewrite

- Changed: Control...() functions now accept the Control ID as an extra way to identify a control

- Fixed: Chr()

- Fixed: StatusBarGetText() failed when used with no "Text" parameter

- Fixed: InputBox() returns focus to the previously active window

Posted

Updated:

The variant rewrite seems to be OK, but keep an eye on any "odd" math results.

http://www.autoitscript.com/autoit3/files/unstable/autoit/

- Added: Control ID is now shown in the AutoIt Window Spy

- Changed: (Internal) Variant rewrite

- Changed: Control...() functions now accept the Control ID as an extra way to identify a control

- Fixed: Chr()

- Fixed: StatusBarGetText() failed when used with no "Text" parameter

- Fixed: InputBox() returns focus to the previously active window

<{POST_SNAPBACK}>

Good! (ID support) :(

BTW: What about Chr() fixes? :ph34r:

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
  • Recently Browsing   0 members

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