Sign in to follow this  
Followers 0

V3.0.103 Unstable

114 posts in this topic

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

Share this post


Link to post
Share on other sites



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

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

Posted

Ahhh! Now it is all clear. Thanks Valik.

Share this post


Link to post
Share on other sites

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.

<{POST_SNAPBACK}>

Also if you've ResHacked a program for some reason....

Share this post


Link to post
Share on other sites

Posted

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

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

Posted

Aha! I also posted a message about the debugger. Could you look at it?

Share this post


Link to post
Share on other sites

Posted

:ph34r:

I dunno if was maded with any intention... :lol:

But, I found a little thing about 'GUI docs' in the helpfile v3.0.103... :(

In "Appendix" section ---> "GUI Control Styles"

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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)

Share this post


Link to post
Share on other sites

Posted

I've changed it now. If the controlID/Class parameter is a number (not just a string that looks like a number) then the control ID is used, otherwise the classnameNN/text method is used.

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

Posted

Do you intend to upload the current source? :ph34r:

Share this post


Link to post
Share on other sites

Posted

Do you intend to upload the current source? :ph34r:

Sorry, I was on dialup at the time. Done now.

Share this post


Link to post
Share on other sites

Posted

Sorry, I was on dialup at the time.  Done now.

<{POST_SNAPBACK}>

no problem

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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:

Share this post


Link to post
Share on other sites

Posted

Good! (ID support) :lol:

BTW: What about Chr() fixes?  :(

Secret. :ph34r:

Chr("65") didn't work as expected,

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