Crazy Eddies GUI System: CEGUI::FalagardEditbox Class Reference

Crazy Eddies GUI System 0.7.6

- Main Page
- Related Pages
- Namespaces
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

Public Member Functions | Static Public Attributes | Protected Member Functions | Protected Attributes | Static Protected Attributes
CEGUI::FalagardEditbox Class Reference

Editbox class for the FalagardBase module. More...

Inheritance diagram for CEGUI::FalagardEditbox:
[legend]
Collaboration diagram for CEGUI::FalagardEditbox:
[legend]

List of all members.

## 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.
colour | getSelectedTextColour () const
| return the colour to be used for rendering Editbox text falling within the selected region.
colour | getOptionalPropertyColour (const String &propertyName) const
| Return a colour object fetched from the named property if it exists, else a default colour (black).
bool | isCaretBlinkEnabled () const
| return whether the blinking caret is enabled.
float | getCaretBlinkTimeout () const
| return the caret blink timeout period (only used if blink is enabled).
void | setCaretBlinkEnabled (bool enable)
| set whether the blinking caret is enabled.
void | setCaretBlinkTimeout (float seconds)
| set the caret blink timeout period (only used if blink is enabled).
void | setTextFormatting (const HorizontalTextFormatting format)
| Sets the horizontal text formatting to be used from now onwards.
HorizontalTextFormatting | getTextFormatting () const
void | render ()
| Populate render cache.
size_t | getTextIndexFromPosition (const Point &pt) const
| Return the text code point index that is rendered closest to screen position pt.
void | update (float elapsed)
| perform any time based updates for this WindowRenderer.
## Static Public Attributes
static const utf8 | TypeName []
| 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.
static const float | DefaultCaretBlinkTimeout
| The default timeout (in seconds) used when blinking the caret.
## Protected Member Functions
void | renderBaseImagery (const WidgetLookFeel &wlf) const
| helper to draw the base imagery (container and what have you)
void | setupVisualString (String &visual) const
| helper to set 'visual' to the string we will render (part of)
size_t | getCaretIndex (const String &visual_string) const
float | calculateTextOffset (const Rect &text_area, const float text_extent, const float caret_width, const float extent_to_caret)
void | renderTextNoBidi (const WidgetLookFeel &wlf, const String &text, const Rect &text_area, float text_offset)
void | renderTextBidi (const WidgetLookFeel &wlf, const String &text, const Rect &text_area, float text_offset)
bool | editboxIsFocussed () const
void | renderCaret (const ImagerySection &imagery, const Rect &text_area, const float text_offset, const float extent_to_caret) const
bool | isUnsupportedFormat (const HorizontalTextFormatting format)
## Protected Attributes
float | d_lastTextOffset
| x rendering offset used last time we drew the widget.
bool | d_blinkCaret
| true if the caret imagery should blink.
float | d_caretBlinkTimeout
| time-out in seconds used for blinking the caret.
float | d_caretBlinkElapsed
| current time elapsed since last caret blink state change.
bool | d_showCaret
| true if caret should be shown.
HorizontalTextFormatting | d_textFormatting
| horizontal formatting. Only supports left, right, and centred.
## Static Protected Attributes
static FalagardEditboxProperties::BlinkCaret | d_blinkCaretProperty
static FalagardEditboxProperties::BlinkCaretTimeout | d_blinkCaretTimeoutProperty
static FalagardEditboxProperties::TextFormatting | d_textFormattingProperty

## Detailed Description

Editbox class for the FalagardBase module.

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

States:

- Enabled: Rendering for when the editbox is in enabled and is in read-write mode.
- ReadOnly: Rendering for when the editbox is in enabled and is in read-only mode.
- Disabled: Rendering for when the editbox is disabled.
- ActiveSelection: additional state rendered for text selection (the imagery in this section is rendered within the selection area.)
- InactiveSelection: additional state rendered for text selection (the imagery in this section is rendered within the selection area.)

NamedAreas:

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

PropertyDefinitions (optional)

- NormalTextColour: property that accesses a colour value to be used to render normal unselected text. If this property is not defined, the colour defaults to black.
- SelectedTextColour: property that accesses a colour value to be used to render selected text. If this property is not defined, the colour defaults to black.

Imagery Sections:

- Carat

## 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:

  propertyName | String object holding the name of the property to be accessed if it exists.

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.

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:

  pt | Point 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.

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.

void CEGUI::FalagardEditbox::render | ( |  | ) | `[virtual]`

Populate render cache.

This method must be implemented by all window renderers and should perform the rendering operations needed for this widget. Normally using the Falagard API...

Implements CEGUI::WindowRenderer.

void CEGUI::FalagardEditbox::setTextFormatting | ( | const HorizontalTextFormatting | format | ) |

Sets the horizontal text formatting to be used from now onwards.

Parameters:

  format | Specifies the formatting to use. Currently can only be one of the following HorizontalTextFormatting values: HTF_LEFT_ALIGNED (default) HTF_RIGHT_ALIGNED HTF_CENTRE_ALIGNED