Crazy Eddies GUI System  0.6.2
Public Member Functions | Public Attributes | Static Public Attributes | List of all members
CEGUI::FalagardEditbox Class Reference

Editbox class for the FalagardBase module. More...

+ Inheritance diagram for CEGUI::FalagardEditbox:
+ Collaboration diagram for CEGUI::FalagardEditbox:

Public Member Functions

 FalagardEditbox (const String &type)
 Constructor.
 
colour getUnselectedTextColour () const
 return the colour to be used for rendering Editbox text oustside of the selected region. More...
 
colour getSelectedTextColour () const
 return the colour to be used for rendering Editbox text falling within the selected region. More...
 
colour getOptionalPropertyColour (const String &propertyName) const
 Return a colour object fetched from the named property if it exists, else a default colour (black). More...
 
void render ()
 Populate render cache. More...
 
size_t getTextIndexFromPosition (const Point &pt) const
 Return the text code point index that is rendered closest to screen position pt. More...
 
- Public Member Functions inherited from CEGUI::EditboxWindowRenderer
 EditboxWindowRenderer (const String &name)
 Constructor.
 
- Public Member Functions inherited from CEGUI::WindowRenderer
 WindowRenderer (const String &name, const String &class_name="Window")
 Constructor. More...
 
virtual ~WindowRenderer ()
 Destructor.
 
const StringgetName () const
 Returns the factory type name of this window renderer.
 
WindowgetWindow () const
 Get the window this windowrenderer is attached to.
 
const StringgetClass () const
 Get the "minimum" Window class this renderer requires.
 
const WidgetLookFeelgetLookNFeel () const
 Get the Look'N'Feel assigned to our window.
 
virtual Rect getUnclippedInnerRect () const
 Get unclipped inner rectangle that our window should return from its member function with the same name.
 
virtual Rect getPixelRect () const
 Get actual pixel rectangle our window is to return from its member function with the same name.
 
virtual void performChildWindowLayout ()
 Method called to perform extended laying out of the window's attached child windows.
 

Public Attributes

float d_lastTextOffset
 x rendering offset used last time we drew the widget.
 

Static Public Attributes

static const utf8 TypeName [] = "Falagard/Editbox"
 type name for this widget.
 
static const String UnselectedTextColourPropertyName
 Name of property to access for unselected text colour.
 
static const String SelectedTextColourPropertyName
 Name of property to access for selected text colour.
 

Additional Inherited Members

- Protected Types inherited from CEGUI::WindowRenderer
typedef std::vector< Property * > PropertyList
 
- Protected Member Functions inherited from CEGUI::WindowRenderer
void registerProperty (Property *property)
 Register a property class that will be properly managed by this window renderer. More...
 
virtual void onAttach ()
 Handler called when this windowrenderer is attached to a window.
 
virtual void onDetach ()
 Handler called when this windowrenderer is detached from its window.
 
virtual void onLookNFeelAssigned ()
 Handler called when a Look'N'Feel is assigned to our window.
 
virtual void onLookNFeelUnassigned ()
 Handler called when a Look'N'Feel is removed/unassigned from our window.
 
- Protected Attributes inherited from CEGUI::WindowRenderer
Windowd_window
 Pointer to the window this windowrenderer is assigned to.
 
const String d_name
 Name of the factory type used to create this window renderer.
 
const String d_class
 Name of the widget class that is the "minimum" requirement.
 
PropertyList d_properties
 The list of properties that this windowrenderer will be handling.
 

Detailed Description

Editbox class for the FalagardBase module.

This class requires LookNFeel to be assigned. The LookNFeel should provide the following:

States:

NamedAreas: TextArea - area where text, selection, and carat imagery will appear.

PropertyDefinitions (optional, defaults will be black):

Imagery Sections:

Member Function Documentation

colour CEGUI::FalagardEditbox::getOptionalPropertyColour ( const String propertyName) const

Return a colour object fetched from the named property if it exists, else a default colour (black).

Parameters
propertyNameString object holding the name of the property to be accessed if it exists.

References CEGUI::WindowRenderer::d_window, CEGUI::PropertySet::getProperty(), and CEGUI::PropertySet::isPropertyPresent().

Referenced by getSelectedTextColour(), and getUnselectedTextColour().

colour CEGUI::FalagardEditbox::getSelectedTextColour ( ) const

return the colour to be used for rendering Editbox text falling within the selected region.

Returns
colour value describing the colour to be used.

References getOptionalPropertyColour(), and SelectedTextColourPropertyName.

Referenced by render().

size_t CEGUI::FalagardEditbox::getTextIndexFromPosition ( const Point pt) const
virtual

Return the text code point index that is rendered closest to screen position pt.

Parameters
ptPoint object describing a position on the screen in pixels.
Returns
Code point index into the text that is rendered closest to screen position pt.

Implements CEGUI::EditboxWindowRenderer.

References d_lastTextOffset, CEGUI::WindowRenderer::d_window, CEGUI::Font::getCharAtPixel(), CEGUI::Window::getFont(), CEGUI::Editbox::getMaskCodePoint(), CEGUI::Window::getText(), CEGUI::Editbox::isTextMasked(), CEGUI::String::length(), and CEGUI::CoordConverter::screenToWindowX().

colour CEGUI::FalagardEditbox::getUnselectedTextColour ( ) const

return the colour to be used for rendering Editbox text oustside of the selected region.

Returns
colour value describing the colour to be used.

References getOptionalPropertyColour(), and UnselectedTextColourPropertyName.

Referenced by render().

void CEGUI::FalagardEditbox::render ( )
virtual