29#ifndef _CEGUIEditbox_h_
30#define _CEGUIEditbox_h_
32#include "CEGUI/Base.h"
33#include "CEGUI/Window.h"
34#include "CEGUI/RegexMatcher.h"
38# pragma warning(disable : 4251)
222 {
return d_validationString;}
275 {
return d_maskCodePoint; }
291 {
return d_maxTextLen;}
646 void addEditboxProperties(
void);
Defines a clipboard handling class.
Definition Clipboard.h:84
Base class for the EditboxWindowRenderer class.
Definition widgets/Editbox.h:46
virtual size_t getTextIndexFromPosition(const Vector2f &pt) const =0
Return the text code point index that is rendered closest to screen position pt.
EditboxWindowRenderer(const String &name)
Constructor.
Base class for an Editbox widget.
Definition widgets/Editbox.h:70
bool d_previousValidityChangeResponse
Previous match state change response.
Definition widgets/Editbox.h:642
void setValidationString(const String &validation_string)
Set the text validation string.
bool handleValidityChangeForString(const String &str)
size_t d_maxTextLen
Maximum number of characters for this Editbox.
Definition widgets/Editbox.h:622
static const String WidgetTypeName
Window factory name.
Definition widgets/Editbox.h:77
size_t getSelectionEndIndex(void) const
return the current selection end point.
virtual void onTextSelectionChanged(WindowEventArgs &e)
Handler called when the current text selection changes.
virtual void onMaskedRenderingModeChanged(WindowEventArgs &e)
Handler called when the masked rendering mode (password mode) has been changed.
bool d_readOnly
True if the editbox is in read-only mode.
Definition widgets/Editbox.h:616
void onMouseButtonUp(MouseEventArgs &e)
Handler called when a mouse button has been released within this window's area.
void setReadOnly(bool setting)
Specify whether the Editbox is read-only.
virtual void onMaximumTextLengthChanged(WindowEventArgs &e)
Handler called when the maximum text length for the edit box is changed.
virtual void onCaretMoved(WindowEventArgs &e)
Handler called when the caret (insert point) position changes.
size_t d_selectionEnd
End of selection area.
Definition widgets/Editbox.h:628
void onCaptureLost(WindowEventArgs &e)
Handler called when this window loses capture of mouse inputs.
void setMaskCodePoint(String::value_type code_point)
set the code point used when rendering masked text.
static const String EventNamespace
Namespace for global events.
Definition widgets/Editbox.h:75
static const String EventCaretMoved
Definition widgets/Editbox.h:128
void handleCharLeft(uint sysKeys)
Processing to move caret one character left.
virtual void onValidationStringChanged(WindowEventArgs &e)
Event fired internally when the validation string is changed.
bool d_maskText
True if the editbox text should be rendered masked.
Definition widgets/Editbox.h:618
void handleWordLeft(uint sysKeys)
Processing to move caret one word left.
void onMouseMove(MouseEventArgs &e)
Handler called when the mouse cursor has been moved within this window's area.
void onMouseTripleClicked(MouseEventArgs &e)
Handler called when a mouse button has been triple-clicked within this window's area.
static const String EventMaskedRenderingModeChanged
Definition widgets/Editbox.h:89
void clearSelection(void)
Clear the currently defined selection (just the region, not the text).
void eraseSelectedText(bool modify_text=true)
Erase the currently selected text.
void setCaretIndex(size_t caret_pos)
Set the current position of the caret.
size_t d_caretPos
Position of the caret / insert-point.
Definition widgets/Editbox.h:624
virtual void onTextValidityChanged(RegexMatchStateEventArgs &e)
Handler called when something has caused the validity state of the current text to change.
static const String EventTextAccepted
Definition widgets/Editbox.h:147
virtual ~Editbox(void)
Destructor for Editbox class.
virtual bool performCopy(Clipboard &clipboard)
Asks the widget to perform a clipboard copy to the provided clipboard.
static const String EventReadOnlyModeChanged
Definition widgets/Editbox.h:83
void handleBackspace(void)
Processing for backspace key.
const String & getValidationString(void) const
return the currently set validation string
Definition widgets/Editbox.h:221
String d_validationString
Copy of validation reg-ex string.
Definition widgets/Editbox.h:630
size_t getTextIndexFromPosition(const Vector2f &pt) const
Return the text code point index that is rendered closest to screen position pt.
virtual void onMaskCodePointChanged(WindowEventArgs &e)
Handler called when the code point to use for masked rendering has been changed.
void onMouseDoubleClicked(MouseEventArgs &e)
Handler called when a mouse button has been double-clicked within this window's area.
size_t getSelectionLength(void) const
return the length of the current selection (in code points / characters).
String::value_type getMaskCodePoint(void) const
return the code point used when rendering masked text.
Definition widgets/Editbox.h:274
size_t d_selectionStart
Start of selection area.
Definition widgets/Editbox.h:626
size_t getSelectionStartIndex(void) const
return the current selection start point.
static const String EventEditboxFull
Definition widgets/Editbox.h:140
void onMouseButtonDown(MouseEventArgs &e)
Handler called when a mouse button has been depressed within this window's area.
virtual bool performCut(Clipboard &clipboard)
Asks the widget to perform a clipboard cut to the provided clipboard.
void handleWordRight(uint sysKeys)
Processing to move caret one word right.
bool d_dragging
true when a selection is being dragged.
Definition widgets/Editbox.h:636
virtual void onReadOnlyChanged(WindowEventArgs &e)
Handler called when the read only state of the Editbox has been changed.
virtual void onTextAcceptedEvent(WindowEventArgs &e)
Handler called when the user accepts the edit box text by pressing Return, Enter, or Tab.
size_t getCaretIndex(void) const
return the current position of the caret.
RegexMatcher * d_validator
Pointer to class used for validation of text.
Definition widgets/Editbox.h:632
bool hasInputFocus(void) const
return true if the Editbox has input focus.
size_t d_dragAnchorIdx
Selection index for drag selection anchor point.
Definition widgets/Editbox.h:638
void setMaxTextLength(size_t max_len)
set the maximum text length for this Editbox.
static const String EventValidationStringChanged
Definition widgets/Editbox.h:102
void handleEnd(uint sysKeys)
Processing to move caret to the end of the text.
virtual bool performPaste(Clipboard &clipboard)
Asks the widget to perform a clipboard paste from the provided clipboard.
static const String EventTextSelectionChanged
Definition widgets/Editbox.h:134
size_t getMaxTextLength(void) const
return the maximum text length set for this Editbox.
Definition widgets/Editbox.h:290
virtual void onEditboxFullEvent(WindowEventArgs &e)
Handler called when the edit box text has reached the set maximum length.
virtual bool validateWindowRenderer(const WindowRenderer *renderer) const
validate window renderer
void onCharacter(KeyEventArgs &e)
Handler called when a character-key has been pressed while this window has input focus.
void handleCharRight(uint sysKeys)
Processing to move caret one character right.
void handleDelete(void)
Processing for Delete key.
MatchState d_validatorMatchState
Current match state of EditboxText.
Definition widgets/Editbox.h:640
void setSelectionStart(size_t start_pos)
Define the current selection start for the Editbox.
Editbox(const String &type, const String &name)
Constructor for Editbox class.
static const String EventTextValidityChanged
Definition widgets/Editbox.h:122
bool isReadOnly(void) const
return true if the Editbox is read-only.
Definition widgets/Editbox.h:167
MatchState getStringMatchState(const String &str) const
return the match state of the given string for the validation regular expression.
bool d_weOwnValidator
specifies whether validator was created by us, or supplied by user.
Definition widgets/Editbox.h:634
String::value_type d_maskCodePoint
Code point to use when rendering masked text.
Definition widgets/Editbox.h:620
MatchState getTextMatchState() const
return the validation MatchState for the current Editbox text, given the currently set validation str...
static const String EventMaximumTextLengthChanged
Definition widgets/Editbox.h:108
void setSelection(size_t start_pos, size_t end_pos)
Define the current selection for the Editbox.
void setValidator(RegexMatcher *matcher)
Set the RegexMatcher based validator for this Editbox.
void onTextChanged(WindowEventArgs &e)
Handler called when the window's text is changed.
void setSelectionLength(size_t length)
Define the current selection for the Editbox.
void handleHome(uint sysKeys)
Processing to move caret to the start of the text.
bool isTextMasked(void) const
return true if the text for the Editbox will be rendered masked.
Definition widgets/Editbox.h:179
static const String EventMaskCodePointChanged
Definition widgets/Editbox.h:96
void onKeyDown(KeyEventArgs &e)
Handler called when a key as been depressed while this window has input focus.
void setTextMasked(bool setting)
Specify whether the text for the Editbox will be rendered masked.
EventArgs based class that is used for objects passed to input event handlers concerning keyboard inp...
Definition InputEvent.h:315
EventArgs based class that is used for objects passed to input event handlers concerning mouse input.
Definition InputEvent.h:281
Definition RegexMatcher.h:70
Interface for Regex matching support classes.
Definition RegexMatcher.h:41
MatchState
Enumeration of possible states when cosidering a regex match.
Definition RegexMatcher.h:45
String class used within the GUI system.
Definition String.h:64
utf32 value_type
Basic 'code point' type used for String (utf32)
Definition String.h:69
EventArgs based class that is used for objects passed to handlers triggered for events concerning som...
Definition InputEvent.h:252
Base-class for the assignable WindowRenderer object.
Definition WindowRenderer.h:52
An abstract base class providing common functionality and specifying the required interface for deriv...
Definition Window.h:151
Main namespace for Crazy Eddie's GUI Library.
Definition arch_overview.dox:1