cwidget  0.5.17
Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | Protected Member Functions | List of all members
cwidget::widgets::editline Class Reference
Inheritance diagram for cwidget::widgets::editline:
cwidget::widgets::widget

Public Types

typedef std::vector< std::wstring > history_list
 
- Public Types inherited from cwidget::widgets::widget
typedef std::list< binding_connection >::iterator key_connection
 

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. More...
 
void set_allow_wrap (bool allow)
 
bool get_allow_wrap () const
 
bool focus_me ()
 
void paint (const style &st)
 Display this widget. More...
 
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. More...
 
void add_to_history (std::wstring s)
 
void reset_history ()
 
- Public Member Functions inherited from cwidget::widgets::widget
void incref ()
 
void decref ()
 
void show ()
 
virtual void show_all ()
 
void hide ()
 
void toggle_visible ()
 
void set_visible (bool _visible)
 
bool dispatch_key (const config::key &k)
 
void alloc_size (int x, int y, int w, int h)
 Set the size and location in the parent of this widget. More...
 
bool get_isfocussed ()
 
void set_owner (container *w)
 
void display (const style &st)
 Display this widget in the given style environment. More...
 
int timeout (int msecs)
 
virtual void destroy ()
 Destroys the visible representation of this widget and disconnects it from any children that it may have.
 
util::ref_ptr< containerget_owner ()
 
int get_startx ()
 
int get_starty ()
 
int get_width ()
 
int get_height ()
 
bool get_visible ()
 
void sync ()
 
int scroll (int n=1)
 
int addch (chtype ch)
 
int mvaddch (int y, int x, chtype ch)
 
int add_wch (wchar_t wch)
 
int add_wch (const cchar_t *cch)
 
int mvadd_wch (int y, int x, wchar_t wch)
 
int mvadd_wch (int y, int x, const cchar_t *cch)
 
int addstr (const char *str)
 
int addnstr (const char *str, int n)
 
int mvaddstr (int y, int x, const char *str)
 
int mvaddnstr (int y, int x, const char *str, int n)
 
int addstr (const wchar_t *str)
 
int addnstr (const wchar_t *str, int n)
 
int mvaddstr (int y, int x, const wchar_t *str)
 
int mvaddnstr (int y, int x, const wchar_t *str, int n)
 
int addstr (const std::wstring &str)
 
int addnstr (const std::wstring &str, int n)
 
int mvaddstr (int y, int x, const std::wstring &str)
 
int mvaddnstr (int y, int x, const std::wstring &str, int n)
 
int addstr (const wchstring &str)
 
int addnstr (const wchstring &str, int n)
 
int mvaddstr (int y, int x, const wchstring &str)
 
int mvaddnstr (int y, int x, const wchstring &str, int n)
 
int addstr (const chstring &str)
 
int addnstr (const chstring &str, int n)
 
int mvaddstr (int y, int x, const chstring &str)
 
int mvaddnstr (int y, int x, const chstring &str, int n)
 
int attroff (int attrs)
 
int attron (int attrs)
 
int attrset (int attrs)
 
void bkgdset (const chtype ch)
 
int bkgd (const chtype ch)
 
chtype getbkgd ()
 
int border (chtype ls, chtype rs, chtype ts, chtype bs, chtype tl, chtype tr, chtype bl, chtype br)
 
int box (chtype verch, chtype horch)
 
int hline (chtype ch, int n)
 
int vline (chtype ch, int n)
 
int mvhline (int y, int x, chtype ch, int n)
 
int mvvline (int y, int x, chtype ch, int n)
 
int delch ()
 
int mvdelch (int y, int x)
 
int deleteln ()
 
int insdelln (int n)
 
int insertln ()
 
int echochar (chtype ch)
 
int move (int y, int x)
 
void getyx (int &y, int &x)
 
void getbegyx (int &y, int &x)
 
void getmaxyx (int &y, int &x)
 
int getmaxy ()
 
int getmaxx ()
 
void show_string_as_progbar (int x, int y, const std::wstring &s, const style &st1, const style &st2, int size1, int totalsize)
 
void display_header (std::wstring s, const style &st)
 
void display_status (std::wstring s, const style &st)
 
int erase ()
 
int clear ()
 
int clrtobot ()
 
int clrtoeol ()
 
int keypad (bool bf)
 
int meta (bool bf)
 
bool enclose (int y, int x)
 
void set_opaque (bool opaque)
 Enable or disable clearing the background before displaying the widget. More...
 
void set_bg_style (const style &new_style)
 Update this widget's basic style to the given value. More...
 
void apply_style (const style &st)
 Set the display attributes of our associated window directly from the given style. More...
 
key_connection connect_key (const std::string &key, config::keybindings *bindings, const sigc::slot0< void > &slot)
 
key_connection connect_key_post (const std::string &key, config::keybindings *bindings, const sigc::slot0< void > &slot)
 
void disconnect_key (key_connection c)
 
void disconnect_key_post (key_connection c)
 

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 ()
 
- Static Public Member Functions inherited from cwidget::widgets::widget
static void handle_pending_deletes ()
 

Public Attributes

sigc::signal1< void, std::wstring > entered
 
sigc::signal1< void, std::wstring > text_changed
 
- Public Attributes inherited from cwidget::widgets::widget
sigc::signal0< void > shown_sig
 
sigc::signal0< void > hidden_sig
 
sigc::signal0< void > destroyed
 
sigc::signal0< void > do_layout
 
sigc::signal0< void > focussed
 
sigc::signal0< void > unfocussed
 

Static Public Attributes

static config::keybindingsbindings = NULL
 

Protected Member Functions

bool handle_key (const config::key &k)
 Handles a keypress in this widget. More...
 
 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. More...
 
 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. More...
 
- Protected Member Functions inherited from cwidget::widgets::widget
cwindow get_win ()
 
void cleanup ()
 Handle cleanup when the reference count goes to 0. More...
 

Constructor & Destructor Documentation

◆ editline() [1/2]

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.

◆ editline() [2/2]

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

◆ get_clear_on_first_edit()

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).

◆ handle_key()

bool cwidget::widgets::editline::handle_key ( const config::key k)
protectedvirtual

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::widgets::widget::handle_key(), cwidget::toplevel::queuelayout(), and cwidget::toplevel::update().

◆ height_request()

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.

◆ paint()

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.

References cwidget::config::global_bindings, and cwidget::toplevel::update().

◆ set_clear_on_first_edit()

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.

◆ width_request()

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: