Class: AutoItX3::Edit
Overview
An edit control is a single- or multiline input control in which you can type text. For example, notepad consists mainly of a big edit control.
Instance Method Summary collapse
-
#caret_pos ⇒ Object
Returns the current caret position in a 2-element array of form
[line, column]
. -
#lines ⇒ Object
Returns the number of lines in
self
. -
#paste(str) ⇒ Object
“Pastes”
str
atself
‘s current caret position. -
#selected_text ⇒ Object
Returns the currently selected text.
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
#caret_pos ⇒ Object
Returns the current caret position in a 2-element array of form [line, column]
.
307 308 309 310 311 |
# File 'lib/AutoItX3/control.rb', line 307 def caret_pos x = send_command_to_control("GetCurrentLine").to_i y = send_command_to_control("GetCurrentCol").to_i [x, y] end |
#lines ⇒ Object
Returns the number of lines in self
.
314 315 316 |
# File 'lib/AutoItX3/control.rb', line 314 def lines send_command_to_control("GetLineCount").to_i end |
#paste(str) ⇒ Object
“Pastes” str
at self
‘s current caret position.
324 325 326 |
# File 'lib/AutoItX3/control.rb', line 324 def paste(str) send_command_to_control("EditPaste", str) end |
#selected_text ⇒ Object
Returns the currently selected text.
319 320 321 |
# File 'lib/AutoItX3/control.rb', line 319 def selected_text send_command_to_control("GetSelected") end |