Crazy Eddie's GUI System 0.8.7
|
Editbox class for the FalagardBase module. More...
#include <Editbox.h>
Public Member Functions | |
FalagardEditbox (const String &type) | |
Constructor. | |
void | setColourRectToUnselectedTextColour (ColourRect &colour_rect) const |
Set the given ColourRect to the colour to be used for rendering Editbox text oustside of the selected region. | |
void | setColourRectToSelectedTextColour (ColourRect &colour_rect) const |
Set the given ColourRect to the colour to be used for rendering Editbox text falling within the selected region. | |
void | setColourRectToOptionalPropertyColour (const String &propertyName, ColourRect &colour_rect) const |
Set the given ColourRect to the colour(s) fetched from the named property if it exists, else the default colour of 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 Vector2f &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. | |
bool | handleFontRenderSizeChange (const Font *const font) |
Perform any updates needed because the given font's render size has changed. | |
![]() | |
EditboxWindowRenderer (const String &name) | |
Constructor. | |
![]() | |
WindowRenderer (const String &name, const String &class_name="Window") | |
Constructor. | |
virtual | ~WindowRenderer () |
Destructor. | |
const String & | getName () const |
Returns the factory type name of this window renderer. | |
Window * | getWindow () const |
Get the window this windowrenderer is attached to. | |
const String & | getClass () const |
Get the "minimum" Window class this renderer requires. | |
const WidgetLookFeel & | getLookNFeel () const |
Get the Look'N'Feel assigned to our window. | |
virtual Rectf | getUnclippedInnerRect () const |
Get unclipped inner rectangle that our window should 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. | |
virtual void | getRenderingContext (RenderingContext &ctx) const |
update the RenderingContext as needed for our window. This is normally invoked via our window's member function with the same name. | |
![]() |
Static Public Attributes | |
static const String | TypeName |
type name for this widget. | |
static const String | UnselectedTextColourPropertyName |
Name of the optional property to access for the unselected text colour. | |
static const String | SelectedTextColourPropertyName |
Name of the optional property to access for the selected text colour. | |
static const String | ActiveSelectionColourPropertyName |
Name of the optional property to access to obtain active selection rendering colour. | |
static const String | InactiveSelectionColourPropertyName |
Name of the optional property to access to obtain inactive selection rendering 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_text) const |
float | extentToCarretLogical (const float extent_to_caret_visual, const float text_extent, const float caret_width) const |
"Logical" here means that if the text is e.g. right aligned, then it's measured from the right end of the text, whereas "visual" is always measured from the left end of the text. | |
float | calculateTextOffset (const Rectf &text_area, const float text_extent, const float caret_width, const float extent_to_caret) |
float | textOffsetVisual (const Rectf &text_area, const float text_extent) const |
"Visual" here means that it's always measured from the right end of the text area rect, whereas "logical" means that if the text is e.g. right aligned, then it's measured from the right end of the text area rect. | |
void | renderTextNoBidi (const WidgetLookFeel &wlf, const String &text, const Rectf &text_area, float text_offset) |
void | renderTextBidi (const WidgetLookFeel &wlf, const String &text, const Rectf &text_area, float text_offset) |
bool | editboxIsFocussed () const |
bool | editboxIsReadOnly () const |
void | renderCaret (const ImagerySection &imagery, const Rectf &text_area, const float text_offset, const float extent_to_caret) const |
bool | isUnsupportedFormat (const HorizontalTextFormatting format) |
![]() | |
void | registerProperty (Property *property, const bool ban_from_xml) |
Register a property class that will be properly managed by this window renderer. | |
void | registerProperty (Property *property) |
Register a property class that will be properly managed by this window renderer. | |
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 | |
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. | |
![]() | |
Window * | d_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. | |
Additional Inherited Members | |
![]() | |
typedef std::pair< Property *, bool > | PropertyEntry |
type used for entries in the PropertyList. | |
typedef std::vector< PropertyEntry CEGUI_VECTOR_ALLOC(PropertyEntry)> | PropertyList |
type to use for the property list. | |
Editbox class for the FalagardBase module.
This class requires LookNFeel to be assigned. The LookNFeel should provide the following:
States:
NamedAreas:
PropertyDefinitions (optional)
Imagery Sections:
|
virtual |
Return the text code point index that is rendered closest to screen position pt.
pt | Point object describing a position on the screen in pixels. |
Implements CEGUI::EditboxWindowRenderer.
|
virtual |
Perform any updates needed because the given font's render size has changed.
/note This base implementation deals with updates needed for various definitions in the assigned widget look. If you override, you should generally always call this base class implementation.
font | Pointer to the Font whose render size has changed. |
Reimplemented from CEGUI::WindowRenderer.
|
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::setColourRectToOptionalPropertyColour | ( | const String & | propertyName, |
ColourRect & | colour_rect ) const |
Set the given ColourRect to the colour(s) fetched from the named property if it exists, else the default colour of black.
propertyName | String object holding the name of the property to be accessed if it exists. |
colour_rect | Reference to a ColourRect that will be set. |
void CEGUI::FalagardEditbox::setTextFormatting | ( | const HorizontalTextFormatting | format | ) |
Sets the horizontal text formatting to be used from now onwards.
format | Specifies the formatting to use. Currently can only be one of the following HorizontalTextFormatting values:
|
|
virtual |
perform any time based updates for this WindowRenderer.
Reimplemented from CEGUI::WindowRenderer.