This is a single line textbox or input box allowing you to enter and edit
text. Based on the Lobject class. Here are the
attributes that are created specifically for the textbox object:
This class supports highlighting text using the keyboard or mouse and
copying text to and from the clipboard.
auto_select,
auto_select=,
cursor_blinking,
cursor_position,
cursor_position=,
default_bg,
default_border,
default_mouse_cursor,
display_char,
display_char=,
highlighted?,
hscroll_position,
hscroll_position=,
include_objects,
inherit_color_from_parent?,
inherits_attribute?,
insert_mode,
insert_mode=,
ipadx,
ipady,
max_size,
max_size=,
nearest,
on_backspace_key,
on_change,
on_copy,
on_cut,
on_delete_key,
on_end_key,
on_enter_key,
on_exit,
on_home_key,
on_insert_key,
on_key_press,
on_left_key,
on_mouse_ldn,
on_mouse_lup,
on_mouse_move,
on_next_word,
on_paste,
on_prev_word,
on_right_key,
only_digits,
only_digits=,
paint_focus,
paint_focus_remove,
paint_normal,
pixel_height,
pixel_width,
select_text,
skip_object_theme,
valid_attribute?,
value,
value=,
Textbox and editbox objects don’t inherit the background color from
the parent object.
Returns False because the textbox does not inherit color from it’s
parent.
Returns true because the textbox does not pull attributes from the :object
attribute of any style.
Set up several instance variables and create a timer for blinking the
cursor.
Clears the selection or highlight and resets the cursor position. Raises LocanaDigitRequired when :allow_digits
is true and new_text is not a Fixnum.
Retruns the text from the textbox. If :display_char is set, the :display_char is returned in place of the
true value. When :display_char is set
use self[:value] instead of self.value To get the real value.
Return the current state of insert_mode. The default is true.
Sets the insert mode on or off.
- new_value - true to turn insert mode on or false/nil to turn it off.
Returns the character to display in place of the actual characters. Lpassword uses this to mask the actual
characters. The default is nil.
This sets the character used to display in place of the actual characters.
Lpassword automatically set this to
’*’ to mask the actual characters.
Sets the only_digits attribute. When
new_value = true, only digits can be entered into the textbox.
Returns the :max_size attribute. The
default is nil which means there is no max size.
Sets the :max_size attribute.
- new_value - an integer specifying the maximum number of characters the
textbox will accept,
Selects or highlights the text between start_index and end_index. Use (0,
-1) to select all text. Use (0, 0) to clear the selection.
- start_index - the index or position to start highlighting.
- end_index - the index or position to end highlighting, use -1 to highlight
to the end.
Returns the index of the character closest to lx.
- lx - the screen relative mouse position from levent[:x].
Returns the index of the character in :value where the cursor is positioned
at.
Relocates the cursor and makes sure it is always visible.
- new_value - the index of the new cursor position.
Returns the index of the first visible character. The textbox will scroll
horizontally when you type in more characters that you can see. Returns 0
if all characters are visible.
Sets the index of the first visible character. The textbox will scroll
horizontally when you type in more characters than you can see.
- new_value - the index of the first visible character.
Sets the new cursor_position, sets
self.value = levent[:value], and clears any highlighted text. The Lcombobox object relies on all of this the being
set up properly.
Un-select or de-highlights any text.
Inserts the content of the clipboard into the textbox at the current cursor_position.
- levent[:value] contains the text that will be pasted into the textbox.
Cuts the highlighted text from the textbox and places it in the clipboard.
- levent[:value] contains the highlighted portion of the text to be cut out
of the textbox.
Copies the highlighted text from the textbox to the clipboard.
- levent[:value] contains the highlighted portion of the text.
Eliminates any highlighted text and the character before the cursor.
If there is any highlighted or selected text, it is removed from the
textbox. Otherwise the character after the cursor is deleted.
Toggles insert mode on/off.
Inserts the pressed character into the textbox and triggers the on_change event. Raises LocanaDigitRequired when :allow_digits
is true and you attempt to type a non digit character in the text box.
Moves the cursor to the first character in the textbox.
Moves the cursor to the last character in the textbox.
Called whenever the user presses a ctrl-right_key to move to the next word.
Holding the shift key will highlight the next word.
Called whenever the user does a ctrl-left_key to move to the previous word.
Holding the shift key will highlight the previous word.
Moves the cursor one character to the left. Holding the ctrl key will
forward this to on_prev_word. Holding
the shift key will highlight the previous character.
Moves the cursor one character to the right. Holding the ctrl key will
forward this to on_next_word. Holding
the shift key will highlight the next character.
Repositions the cursor and clears any highlight. This also prepares for
dragging the highlight as the mouse is moved.
Clears any preparations for dragging the highlight as the mouse is moved.
Drags or expands the highlight when left mouse button is pressed.
Paints the text in the textbox and takes into consideration any highlighted
or selected text.
Returns true if the character at idx is highlighted. Otherwise returns
false.
This draws the cursor (focus indicator), removes the cursor, and causes the
cursor to blink. Ltextbox::CURSOR_BLINK_TIME determines the rate of
blinking.
This adds anything needed to the object to show that it has the focus. This
calls cursor_blinking() to draw the
cursor, remove the cursor, and blink the cursor.
This should undo or remove the focus painted by paint_focus. This calls cursor_blinking() to draw the cursor,
remove the cursor, and blink the cursor.
Returns the pixel width of the text in the object. This should take into
consideration the font, size, and style of the object and it’s
parents. This is used to calculate width of the object when needed.
Returns the pixel height of the text in the object. This should take into
consideration the font, size, and style of the object and it’s
parents. This is used to calculate height of the object when needed.
The default is 3 so the text does not hug the left and right border.
The default is 1 so the text does not hug the top and bottom border.
Thank you for taking the time to visit this web page. I trust you found the information contained in this page useful.
Please email any questions, concerns, or issues with this web site to webmaster@sevasoftware.com.
Please remember Seva Software when your company would benefit from an experienced database architect and software engineer.