GEdit Class Reference

An edit box allowing the user to enter text. More...

#include <GEdit.h>

Inheritance diagram for GEdit:

GControl GView

List of all members.

Public Member Functions

 GEdit (int id, int x, int y, int cx, int cy, char *name)
 Constructor.
char * GetClass ()
bool MultiLine ()
 Gets "Allow multiple lines".
void MultiLine (bool m)
 Sets "Allow multiple lines".
bool Password ()
 Is the text obsured by hashes?
void Password (bool m)
 Sets the text to be obsured by hashes.
void Value (int64 i)
 Interprets the text in the control as an integer.
int64 Value ()
 Sets the text in the control to an integer.
void Select (int Start=0, int Len=-1)
 Selects a region of text.
int GetCaret ()
 Gets the Caret position in characters.
void SetCaret (int Pos)
 Sets the Caret position in characters.
int OnEvent (GMessage *Msg)
 Called to process every message received by this window.
bool OnKey (GKey &k)
 A key was pressed while this view has focus.
char * Name ()
 Returns the utf-8 text associated with this view.
bool Name (char *s)
 Sets the utf-8 text associated with this view.
char16NameW ()
 Returns the wide char text associated with this view.
bool NameW (char16 *s)
 Sets the wide char text associated with this view.
void Enabled (bool e)
 Sets the enabled state.
bool Enabled ()
 true if the view is enabled
void Focus (bool f)
 Sets the keyboard focus state on the view.
bool Focus ()
 true if the view has keyboard focus
bool SetPos (GRect &p, bool Repaint=false)
 Set the position of the view in terms of it's parent.
int OnNotify (GViewI *c, int f)
 Called when a child view or view with it's SetNotify() set to this window changes.
void OnCreate ()
 The view is attached.


Detailed Description

An edit box allowing the user to enter text.

Constructor & Destructor Documentation

GEdit::GEdit ( int  id,
int  x,
int  y,
int  cx,
int  cy,
char *  name 
)

Constructor.

Parameters:
id  Ctrl's ID
x  x coord
y  y coord
cx  width
cy  height
name  Initial text

References Name(), GView::SetId(), SetPos(), GView::Sunken(), GdcPt2::x, and GdcPt2::y.


Member Function Documentation

char* GEdit::GetClass (  )  [inline]

The class' name. Should be overriden in child classes to return the right class name. Mostly used for debugging, but in the win32 port it is also the default WIN32 class name passed to RegisterClass() in GView::CreateClass().

Returns:
the Class' name for debugging

Reimplemented from GView.

bool GEdit::Name ( char *  n  ) 

Sets the utf-8 text associated with this view.

Name and NameW are interchangable. Using them in any order will convert the text between utf-8 and wide to satify any requirement. Generally once the opposing version of the string is required both the utf-8 and wide copies of the string remain cached in RAM until the Name is changed.

Reimplemented from GView.

char16 * GEdit::NameW (  )  [virtual]

Returns the wide char text associated with this view.

On Win32 the wide characters are 16 bits, on unix systems they are 32-bit characters.

Reimplemented from GView.

int GEdit::OnNotify ( GViewI *  Ctrl,
int  Flags 
)

Called when a child view or view with it's SetNotify() set to this window changes.

The event by default will bubble up to the GWindow at the top of the window heirarchy visiting each GView on the way. If it reaches a GView that processes it then the event stops propergating up the heirarchy.

Reimplemented from GView.

References GTVN_DOC_CHANGED, and GView::SendNotify().


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

Generated on Wed Dec 1 15:41:03 2010 for Lgi by  doxygen 1.5.7.1