cwidget 0.5.16
Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | Protected Member Functions
cwidget::widgets::editline Class Reference
Inheritance diagram for cwidget::widgets::editline:
cwidget::widgets::widget trackable

List of all members.

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< editlinecreate (const std::wstring &prompt, const std::wstring &text=L"", history_list *history=NULL)
static util::ref_ptr< editlinecreate (const std::string &prompt, const std::string &text="", history_list *history=NULL)
static util::ref_ptr< editlinecreate (int maxlength, const std::wstring &prompt, const std::wstring &text=L"", history_list *history=NULL)
static util::ref_ptr< editlinecreate (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::keybindingsbindings = 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.

Constructor & Destructor Documentation

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.


Member Function Documentation

bool cwidget::widgets::editline::get_clear_on_first_edit ( ) const [inline]
Returns:
true if the contents of this edit-line will be erased if the first character pressed is an edit (i.e., not an arrow key).
bool cwidget::widgets::editline::handle_key ( const config::key k) [protected, virtual]

Handles a keypress in this widget.

Parameters:
kthe key that was pressed (see keybindings.h).
Returns:
true if the key was consumed; if false is returned, further processing of the key will be performed.

Reimplemented from cwidget::widgets::widget.

References cwidget::config::key::ch, cwidget::config::key::function_key, cwidget::config::keybindings::key_matches(), cwidget::toplevel::queuelayout(), and cwidget::toplevel::update().

int cwidget::widgets::editline::height_request ( int  width) [virtual]

Calculate the desired height of the widget, given its width.

Parameters:
widththe width of this widget
Returns:
the desired height

Implements cwidget::widgets::widget.

void cwidget::widgets::editline::paint ( const style st) [virtual]

Display this widget.

Parameters:
stthe style environment in which the widget is to be displayed.

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]
Returns:
the desired width of the widget.

Implements cwidget::widgets::widget.


The documentation for this class was generated from the following files: