Public Types | |
typedef std::vector< std::wstring > | history_list |
Public Member Functions | |
bool | get_clear_on_first_edit () const |
void | set_clear_on_first_edit (bool value) |
Change whether the contents of this edit-line widget will be erased if the first character pressed is an edit. | |
void | set_allow_wrap (bool allow) |
bool | get_allow_wrap () const |
bool | focus_me () |
void | paint (const style &st) |
Display this widget. | |
void | dispatch_mouse (short id, int x, int y, int z, mmask_t bstate) |
std::wstring | get_text () |
void | set_text (std::wstring _text) |
void | set_text (std::string _text) |
Decodes the given multibyte string, and sets the current text of this edit-line to it. | |
bool | get_cursorvisible () |
point | get_cursorloc () |
int | width_request () |
int | height_request (int height) |
Calculate the desired height of the widget, given its width. | |
void | add_to_history (std::wstring s) |
void | reset_history () |
Static Public Member Functions | |
static util::ref_ptr< editline > | create (const std::wstring &prompt, const std::wstring &text=L"", history_list *history=NULL) |
static util::ref_ptr< editline > | create (const std::string &prompt, const std::string &text="", history_list *history=NULL) |
static util::ref_ptr< editline > | create (int maxlength, const std::wstring &prompt, const std::wstring &text=L"", history_list *history=NULL) |
static util::ref_ptr< editline > | create (int maxlength, const std::string &prompt, const std::string &text="", history_list *history=NULL) |
static void | add_to_history (std::wstring s, history_list *history) |
static void | init_bindings () |
Public Attributes | |
sigc::signal1< void, std::wstring > | entered |
sigc::signal1< void, std::wstring > | text_changed |
Static Public Attributes | |
static config::keybindings * | bindings = NULL |
Protected Member Functions | |
bool | handle_key (const config::key &k) |
Handles a keypress in this widget. | |
editline (const std::wstring &_prompt, const std::wstring &_text=L"", history_list *history=NULL) | |
editline (const std::string &_prompt, const std::string &_text="", history_list *history=NULL) | |
Transcodes its input strings from the system charset. | |
editline (int maxlength, const std::wstring &_prompt, const std::wstring &_text, history_list *history) | |
editline (int maxlength, const std::string &_prompt, const std::string &_text, history_list *history) | |
Transcodes its input strings from the system charset. |
cwidget::widgets::editline::editline | ( | const std::string & | _prompt, | |
const std::string & | _text = "" , |
|||
history_list * | history = NULL | |||
) | [protected] |
Transcodes its input strings from the system charset.
cwidget::widgets::editline::editline | ( | int | maxlength, | |
const std::string & | _prompt, | |||
const std::string & | _text, | |||
history_list * | history | |||
) | [protected] |
Transcodes its input strings from the system charset.
bool cwidget::widgets::editline::get_clear_on_first_edit | ( | ) | const [inline] |
bool cwidget::widgets::editline::handle_key | ( | const config::key & | k | ) | [protected, virtual] |
Handles a keypress in this widget.
k | the key that was pressed (see keybindings.h). |
Reimplemented from cwidget::widgets::widget.
References cwidget::config::key::ch, and cwidget::config::key::function_key.
int cwidget::widgets::editline::height_request | ( | int | width | ) | [virtual] |
Calculate the desired height of the widget, given its width.
width | the width of this widget |
Implements cwidget::widgets::widget.
void cwidget::widgets::editline::paint | ( | const style & | st | ) | [virtual] |
Display this widget.
Implements cwidget::widgets::widget.
void cwidget::widgets::editline::set_clear_on_first_edit | ( | bool | value | ) | [inline] |
Change whether the contents of this edit-line widget will be erased if the first character pressed is an edit.
This is initially false.
int cwidget::widgets::editline::width_request | ( | ) | [virtual] |
Implements cwidget::widgets::widget.