Home | All Classes | Grouped Classes | Index | Search

Class CL_InputBox

Inputbox component More...

Derived from: CL_Component
Derived by: none
Group: GUI (Controls)

#include <ClanLib/gui.h>

Construction:

CL_InputBox

InputBox Constructor

on_input_down

on_input_up

on_mouse_Ldown

on_mouse_Lup

on_mouse_move

on_lost_focus

Attributes:

get_text

Returns the inputfield text.

get_length

Returns the length of the inputfield text.

get_marked_text

Returns the marked text from the inputfield.

has_marked_text

Returns true if part of the text has been marked by the user.

get_selection_start

Returns the position where the selection starts.

get_selection_length

Returns the length of current selection.

get_max_length

Returns the maximum permitted length of the text.

in_password_mode

Returns true if password mode is enabled, false othewise.

is_read_only

Returns whether the inputfield is read-only.

get_cursor_position

Returns the current cursor position.

is_edited

Returns true if the contents has been edited.

Operations:

set_text

Sets the line edit text to text, clears the selection and moves the cursor to the end of the line.

set_max_length

Set the maximum length of the text in the editor.

set_password_mode

If enable is true, display asterisks instead of the characters actually entered.

set_read_only

Enables or disables read-only mode.

select_all

Selects all text, and moves the cursor to the end.

deselect

Deselects all text (i.e. removes marking) and leaves the cursor at the current position.

set_selection

Sets the marked area at start and be length characters long.

set_cursor_position

Sets the cursor position to pos.

clear

Syntactic sugar for set_text("").

backspace

Deletes the character to the left of the text cursor and moves the cursor one position to the left.

del

Deletes the character on the right side of the text cursor.

cut

Cut the selected text if any.

move_cursor

Moves the cursor position.

move_cursor_word

Moves the cursor by word.

home

Moves the text cursor to the left end of the line.

end

Moves the text cursor to the right end of the line.

set_edited

Sets the edited flag to on.

Signals:

sig_changed

This signal is emitted whenever text is changed in the inputfield.

sig_return_pressed

This signal is emitted when enter is pressed in the inputfield.

sig_activity

This signal is emitted whenever some character is changed/added/removed, cursor moved etc.

sig_validate_character

This signal is emitted after user enter some character, but before it added, to allow user to accept/decline it.

Detailed description:

!group=GUI/Controls! !header=gui.h!


Questions or comments, write to the
ClanLib mailing list.