Main Page | Modules | Alphabetical List | Data Structures | File List | Data Fields | Related Pages

Entry: A Single Line Text Entry Widget

Defines the Ewl_Entry class to allow for single line editable text. More...

Data Structures

struct  Ewl_Entry
 Inherits from the Ewl_Container and extends it to provide text and a cursor for editing the contents of the text. More...

struct  Ewl_Entry
 Inherits from the Ewl_Container and extends it to provide text and a cursor for editing the contents of the text. More...


Defines

#define EWL_ENTRY(entry)   ((Ewl_Entry *) entry)
 Typecasts a pointer to an Ewl_Entry pointer.


Typedefs

typedef Ewl_Entry Ewl_Entry
 Inherits from the Ewl_Widget and provides single line editable text.


Enumerations

enum  Ewl_Entry_Op_Type
 Provides a series of operations that can be performed on the entry.


Functions

Ewl_Widgetewl_entry_new (char *text)
 Allocate and initialize a new entry widget.

Ewl_Widgetewl_entry_multiline_new (char *text)
 Allocate and initialize a new multiline input entry widget.

int ewl_entry_init (Ewl_Entry *e, char *text)
 Initialize an entry widget to default values.

void ewl_entry_text_set (Ewl_Entry *e, char *t)
 Set the text for an entry widget.

char * ewl_entry_text_get (Ewl_Entry *e)
 Get the text from an entry widget.

void ewl_entry_editable_set (Ewl_Entry *e, unsigned int edit)
 Change the ability to edit the text in an entry.

void ewl_entry_multiline_set (Ewl_Entry *e, int m)
 Set multiline for an entry widget.

int ewl_entry_multiline_get (Ewl_Entry *e)
 Get the text from an entry widget.

void ewl_entry_text_prepend (Ewl_Entry *e, char *text)
 Append text to a entry widget.

void ewl_entry_text_append (Ewl_Entry *e, char *text)
 Append text to a entry widget.

void ewl_entry_text_insert (Ewl_Entry *e, char *text, int index)
 Append text to a entry widget.

void ewl_entry_text_at_cursor_insert (Ewl_Entry *e, char *text)
 Inserts text at cursor position.

int ewl_entry_length_get (Ewl_Entry *e)
 Retrieve the length of the text displayed by the entry widget.

void ewl_entry_font_set (Ewl_Entry *e, char *font, int size)
 Changes the currently applied font of the text to specified values.

char * ewl_entry_font_get (Ewl_Entry *e)
 Retrieve the name of the currently used font.

int ewl_entry_font_size_get (Ewl_Entry *e)
 Retrieve the size of the currently used font.

void ewl_entry_style_set (Ewl_Entry *e, char *style)
 Changes the currently applied style of the text to specified values.

char * ewl_entry_style_get (Ewl_Entry *e)
 Retrieves the currently used text style from a text widget.

void ewl_entry_color_set (Ewl_Entry *e, int r, int g, int b, int a)
 Changes the currently applied color of the text to specified values.

void ewl_entry_align_set (Ewl_Entry *e, unsigned int align)
 Changes the currently applied alignment of the text to specified value.

unsigned int ewl_entry_align_get (Ewl_Entry *e)
 Retrieves the currently used text alignment from an entry widget.

void ewl_entry_index_geometry_map (Ewl_Entry *e, int index, int *xx, int *yy, int *ww, int *hh)
 Maps a character index to a set of coordinates and sizes.

int ewl_entry_coord_index_map (Ewl_Entry *e, int x, int y)
 Finds the index of the character under the specified coordinates.


Detailed Description

Defines the Ewl_Entry class to allow for single line editable text.


Function Documentation

unsigned int ewl_entry_align_get Ewl_Entry e  ) 
 

Retrieves the currently used text alignment from an entry widget.

Parameters:
e: the entry widget to get the current alignment
Returns:
Returns the currently used text alignment.

void ewl_entry_align_set Ewl_Entry e,
unsigned int  align
 

Changes the currently applied alignment of the text to specified value.

Parameters:
e: the entry widget to change alignment
align: the new alignment of the entry widget
Returns:
Returns no value.

void ewl_entry_color_set Ewl_Entry e,
int  r,
int  g,
int  b,
int  a
 

Changes the currently applied color of the text to specified values.

Parameters:
e: the entry to change color
r: the new red value
g: the new green value
b: the new blue value
a: the new alpha value
Returns:
Returns no value.

int ewl_entry_coord_index_map Ewl_Entry e,
int  x,
int  y
 

Finds the index of the character under the specified coordinates.

Parameters:
e: the entry widget to map a coordinate to a character index
x: the x coordinate over the desired character
y: the y coordinate over the desired character
Returns:
Returns the index of the found character on success, 0 otherwise.

void ewl_entry_editable_set Ewl_Entry e,
unsigned int  edit
 

Change the ability to edit the text in an entry.

Parameters:
e: then entry to change
edit: a boolean value indicating the ability to edit the entry
Returns:
Returns no value.

char* ewl_entry_font_get Ewl_Entry e  ) 
 

Retrieve the name of the currently used font.

Parameters:
e: the entry widget to retrieve the current font
Returns:
Returns a copied string containing the name of the current font.

void ewl_entry_font_set Ewl_Entry e,
char *  font,
int  size
 

Changes the currently applied font of the text to specified values.

Parameters:
e: the entry widget to change font
font: the name of the font
size: the size of the font
Returns:
Returns no value.

int ewl_entry_font_size_get Ewl_Entry e  ) 
 

Retrieve the size of the currently used font.

Parameters:
e: the entry widget to retrieve the current font size
Returns:
Returns the currently used size of the font.

void ewl_entry_index_geometry_map Ewl_Entry e,
int  index,
int *  x,
int *  y,
int *  w,
int *  h
 

Maps a character index to a set of coordinates and sizes.

Parameters:
e: the entry widget to map index to character geometry
index: character index to be mapped
x: pointer to store determined character x coordinate
y: pointer to store determined character y coordinate
w: pointer to store determined character width
h: pointer to store determined character height
Returns:
Returns no value.
Any of the coordinate parameters may be NULL, they will be ignored. If the index fails to map successfully, the values at the locations pointed to by the coordinate pointers will not be altered. This function can only succeed after the entry widget has been realized.

int ewl_entry_init Ewl_Entry e,
char *  text
 

Initialize an entry widget to default values.

Parameters:
e: the entry widget to initialize
text: the initial text to display in the widget
Returns:
Returns TRUE on success, FALSE on failure.
Initializes the entry widget e to it's default values and callbacks.

int ewl_entry_length_get Ewl_Entry e  ) 
 

Retrieve the length of the text displayed by the entry widget.

Parameters:
e: the entry to retrieve length
Returns:
Returns the length of the text contained in the widget.

int ewl_entry_multiline_get Ewl_Entry e  ) 
 

Get the text from an entry widget.

Parameters:
e: the entry widget to retrieve the multiline flag
Returns:
Returns the multiline flag on success, -1 on failure.

Ewl_Widget* ewl_entry_multiline_new char *  text  ) 
 

Allocate and initialize a new multiline input entry widget.

Parameters:
text: the initial text to display in the widget
Returns:
Returns a new entry widget on success, NULL on failure.

void ewl_entry_multiline_set Ewl_Entry e,
int  m
 

Set multiline for an entry widget.

Parameters:
e: the entry widget to set multiline
m: the value to set multiline to
Returns:
Returns no value.
Set the multiline flag for $a e to m

Ewl_Widget* ewl_entry_new char *  text  ) 
 

Allocate and initialize a new entry widget.

Parameters:
text: the initial text to display in the widget
Returns:
Returns a new entry widget on success, NULL on failure.

char* ewl_entry_style_get Ewl_Entry e  ) 
 

Retrieves the currently used text style from a text widget.

Parameters:
e: the entry widget to get the current style
Returns:
Returns the currently used text style.

void ewl_entry_style_set Ewl_Entry e,
char *  style
 

Changes the currently applied style of the text to specified values.

Parameters:
e: the entry widget to change style
style: the name of the style
Returns:
Returns no value.

void ewl_entry_text_append Ewl_Entry e,
char *  text
 

Append text to a entry widget.

Parameters:
e: the entrywidget to append the text
text: the text to append in the entry widget e
Returns:
Returns no value.
Appends text to the entry widget e.

void ewl_entry_text_at_cursor_insert Ewl_Entry e,
char *  text
 

Inserts text at cursor position.

Parameters:
e: the entry widget to insert the text
text: the text to insert in the entry widget e
Returns:
Returns no value.
Inserts text to the entry widget e at the current cursor position.

char* ewl_entry_text_get Ewl_Entry e  ) 
 

Get the text from an entry widget.

Parameters:
e: the entry widget to retrieve the text
Returns:
Returns the entry text on success, NULL on failure.

void ewl_entry_text_insert Ewl_Entry e,
char *  text,
int  index
 

Append text to a entry widget.

Parameters:
e: the entry widget to insert the text
text: the text to insert in the entry widget e
index: the index into the text to start inserting new text
Returns:
Returns no value.
Appends text to the entry widget e.

void ewl_entry_text_prepend Ewl_Entry e,
char *  text
 

Append text to a entry widget.

Parameters:
e: the entry widget to prepend the text
text: the text to prepend in the entry widget e
Returns:
Returns no value.
Appends text to the entry widget e.

void ewl_entry_text_set Ewl_Entry e,
char *  text
 

Set the text for an entry widget.

Parameters:
e: the entry widget to change the text
text: the text to set for the entry widget
Returns:
Returns no value.
Change the text of the entry widget e to the string t.