Cafu Engine
cf::GuiSys::ComponentTextEditT Class Reference

With this component, the user can edit the text in a sibling text component. More...

#include "CompTextEdit.hpp"

Inheritance diagram for cf::GuiSys::ComponentTextEditT:

Public Member Functions

 ComponentTextEditT ()
 The constructor. More...
 
 ComponentTextEditT (const ComponentTextEditT &Comp)
 The copy constructor. More...
 
ComponentTextEditTClone () const
 The virtual copy constructor. More...
 
const char * GetName () const
 Returns the name of this component. More...
 
void UpdateDependencies (WindowT *Window)
 This method is called whenever something "external" to this component has changed: More...
 
void Render () const
 This method implements the graphical output of this component. More...
 
bool OnInputEvent (const CaKeyboardEventT &KE)
 This method handles keyboard input events. More...
 
void OnClockTickEvent (float t)
 This method handles clock-tick events. More...
 
const cf::TypeSys::TypeInfoTGetType () const
 
- Public Member Functions inherited from cf::GuiSys::ComponentBaseT
 ComponentBaseT ()
 The constructor. More...
 
 ComponentBaseT (const ComponentBaseT &Comp)
 The copy constructor. More...
 
virtual ~ComponentBaseT ()
 The virtual destructor. More...
 
WindowTGetWindow () const
 Returns the parent window that contains this component, or NULL if this component is currently not a part of any window. More...
 
TypeSys::VarManTGetMemberVars ()
 Returns the variable manager that keeps generic references to our member variables, providing a simple kind of "reflection" or "type introspection" feature. More...
 
bool CallLuaMethod (const char *MethodName, const char *Signature="",...)
 Calls the given Lua method of this component. More...
 
virtual void OnPostLoad (bool OnlyStatic)
 This method is called after all windows and their components have been loaded. More...
 
virtual bool OnInputEvent (const CaMouseEventT &ME, float PosX, float PosY)
 This method handles mouse input events. More...
 
- Public Member Functions inherited from RefCountedT
unsigned int GetRefCount () const
 

Static Public Member Functions

static void * CreateInstance (const cf::TypeSys::CreateParamsT &Params)
 
- Static Public Member Functions inherited from cf::GuiSys::ComponentBaseT
static void * CreateInstance (const cf::TypeSys::CreateParamsT &Params)
 

Static Public Attributes

static const cf::TypeSys::TypeInfoT TypeInfo
 
- Static Public Attributes inherited from cf::GuiSys::ComponentBaseT
static const cf::TypeSys::TypeInfoT TypeInfo
 

Static Protected Member Functions

static int SetText (lua_State *LuaState)
 
static int toString (lua_State *LuaState)
 
- Static Protected Member Functions inherited from cf::GuiSys::ComponentBaseT
static int Get (lua_State *LuaState)
 
static int Set (lua_State *LuaState)
 
static int GetExtraMessage (lua_State *LuaState)
 
static int Interpolate (lua_State *LuaState)
 
static int toString (lua_State *LuaState)
 

Static Protected Attributes

static const luaL_Reg MethodsList []
 The list of Lua methods for this class. More...
 
static const char * DocClass
 
static const cf::TypeSys::MethsDocT DocMethods []
 
static const cf::TypeSys::VarsDocT DocVars []
 
- Static Protected Attributes inherited from cf::GuiSys::ComponentBaseT
static const luaL_Reg MethodsList []
 The list of Lua methods for this class. More...
 
static const char * DocClass
 
static const cf::TypeSys::MethsDocT DocMethods []
 

Additional Inherited Members

- Protected Member Functions inherited from RefCountedT
 RefCountedT (const RefCountedT &)
 
RefCountedToperator= (const RefCountedT &)
 

Detailed Description

With this component, the user can edit the text in a sibling text component.

The component requires that the window also has a text component, whose value it updates according to user edits.

Constructor & Destructor Documentation

ComponentTextEditT::ComponentTextEditT ( )

The constructor.

ComponentTextEditT::ComponentTextEditT ( const ComponentTextEditT Comp)

The copy constructor.

Parameters
CompThe component to create a copy of.

Member Function Documentation

ComponentTextEditT * ComponentTextEditT::Clone ( ) const
virtual

The virtual copy constructor.

Callers can use this method to create a copy of this component without knowing its concrete type. Overrides in derived classes use a covariant return type to facilitate use when the concrete type is known. The newly cloned component is initially not a part of any window, even if the source component was.

Reimplemented from cf::GuiSys::ComponentBaseT.

const char* cf::GuiSys::ComponentTextEditT::GetName ( ) const
inlinevirtual

Returns the name of this component.

Reimplemented from cf::GuiSys::ComponentBaseT.

void ComponentTextEditT::OnClockTickEvent ( float  t)
virtual

This method handles clock-tick events.

Parameters
tThe time in seconds since the last clock-tick.

Reimplemented from cf::GuiSys::ComponentBaseT.

bool ComponentTextEditT::OnInputEvent ( const CaKeyboardEventT KE)
virtual

This method handles keyboard input events.

Parameters
KEKeyboard event instance.
Returns
Whether the component handled ("consumed") the event.

Reimplemented from cf::GuiSys::ComponentBaseT.

void ComponentTextEditT::Render ( ) const
virtual

This method implements the graphical output of this component.

Reimplemented from cf::GuiSys::ComponentBaseT.

void ComponentTextEditT::UpdateDependencies ( WindowT Window)
virtual

This method is called whenever something "external" to this component has changed:

  • if the parent window has changed, because this component was added to or removed from it,
  • if other components in the parent window have changed. The component can use the opportunity to search the window for "sibling" components that it depends on, and store direct pointers to them. Note however that dependencies among components must not be cyclic, or else the deletion of a window will leave a memory leak.
    Parameters
    WindowThe parent window that contains this component, or NULL to indicate that this component is removed from the window that it used to be a part of.

Reimplemented from cf::GuiSys::ComponentBaseT.

Member Data Documentation

const char * ComponentTextEditT::DocClass
staticprotected
Initial value:
=
"With this component, the user can edit the text in a sibling text component.\n"
"The component requires that the window also has a text component, whose value it updates according to\n"
"user edits."
const cf::TypeSys::MethsDocT ComponentTextEditT::DocMethods
staticprotected
Initial value:
=
{
META_SetText,
META_toString,
{ NULL, NULL, NULL, NULL }
}
const cf::TypeSys::VarsDocT ComponentTextEditT::DocVars
staticprotected
Initial value:
=
{
{ "CursorPos", "The character position of the text cursor in the text. Valid values are 0 to Text.length()." },
{ "CursorType", "The type of the text cursor. 0 is a vertical bar cursor '|', 1 is an underline cursor '_'. Any other values default to the '|' cursor type." },
{ "CursorRate", "The rate in seconds at which the text cursor completes one blink cycle (on/off)." },
{ "CursorColor", "The color of the text cursor." },
{ "CursorAlpha", "The alpha component of the color." },
{ NULL, NULL }
}
const luaL_Reg ComponentTextEditT::MethodsList
staticprotected
Initial value:
=
{
{ "SetText", SetText },
{ "__tostring", toString },
{ NULL, NULL }
}

The list of Lua methods for this class.


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