Class: AutoItX3::Button
Overview
A button is a control on which you can click and than something happens. Even if that’s quite correct, that isn’t all: check and radio boxes are handled by Windows as buttons as well, so they fall into the scope of this class.
Instance Method Summary collapse
-
#check ⇒ Object
Checks
self
if it’s a radio or check button. -
#checked? ⇒ Boolean
Returns wheather
self
is checked or not. -
#uncheck ⇒ Object
Unchecks
self
if it’s a radio or check button.
Methods inherited from Control
#click, #disable, #enable, #enabled?, #focus, from_control, functions, functions=, #handle, #hide, #initialize, #move, #rect, #send_command_to_control, #send_keys, #show, #text, #text=, #visible?
Constructor Details
This class inherits a constructor from AutoItX3::Control
Instance Method Details
#check ⇒ Object
Checks self
if it’s a radio or check button.
Return value
Unknown.
Raises
- Au3Error
-
Control or window not found.
Example
ctrl.check
Rmarks
Only useful for radio and check buttons. If you try to do this on a regular button, it’s like you clicked it.
505 506 507 |
# File 'lib/AutoItX3/control.rb', line 505 def check send_command_to_control("Check") end |
#checked? ⇒ Boolean
Returns wheather self
is checked or not.
Return value
true or false.
Raises
- Au3Error
-
Control or window not found.
Example
p ctrl.checked? #=> false
ctrl.check
p ctrl.checked? #=> true
Remarks
This method is only useful for radio and check buttons.
491 492 493 |
# File 'lib/AutoItX3/control.rb', line 491 def checked? send_command_to_control("IsChecked") == "1" end |
#uncheck ⇒ Object
Unchecks self
if it’s a radio or check button.
Return value
Unknown.
Raises
- Au3Error
-
Control or window not found.
Example
ctrl.uncheck
516 517 518 |
# File 'lib/AutoItX3/control.rb', line 516 def uncheck send_command_to_control("UnCheck") end |