29 #ifndef _CEGUIEditbox_h_
30 #define _CEGUIEditbox_h_
32 #include "CEGUI/Base.h"
33 #include "CEGUI/Window.h"
34 #include "CEGUI/RegexMatcher.h"
37 # pragma warning(push)
38 # pragma warning(disable : 4251)
63 virtual size_t getTextIndexFromPosition(
const Vector2f& pt)
const = 0;
157 bool hasInputFocus(
void)
const;
201 MatchState getTextMatchState()
const;
222 {
return d_validationString;}
231 size_t getCaretIndex(
void)
const;
242 size_t getSelectionStartIndex(
void)
const;
252 size_t getSelectionEndIndex(
void)
const;
263 size_t getSelectionLength(
void)
const;
275 {
return d_maskCodePoint; }
291 {
return d_maxTextLen;}
304 void setReadOnly(
bool setting);
318 void setTextMasked(
bool setting);
341 void setValidationString(
const String& validation_string);
355 void setCaretIndex(
size_t caret_pos);
374 void setSelection(
size_t start_pos,
size_t end_pos);
387 void setSelectionStart(
size_t start_pos);
399 void setSelectionLength(
size_t length);
431 void setMaxTextLength(
size_t max_len);
453 virtual bool performCopy(
Clipboard& clipboard);
456 virtual bool performCut(
Clipboard& clipboard);
459 virtual bool performPaste(
Clipboard& clipboard);
480 size_t getTextIndexFromPosition(
const Vector2f& pt)
const;
483 void clearSelection(
void);
493 void eraseSelectedText(
bool modify_text =
true);
500 MatchState getStringMatchState(
const String& str)
const;
510 bool handleValidityChangeForString(
const String& str);
513 void handleBackspace(
void);
516 void handleDelete(
void);
519 void handleCharLeft(uint sysKeys);
522 void handleWordLeft(uint sysKeys);
525 void handleCharRight(uint sysKeys);
528 void handleWordRight(uint sysKeys);
531 void handleHome(uint sysKeys);
534 void handleEnd(uint sysKeys);
537 virtual bool validateWindowRenderer(
const WindowRenderer* renderer)
const;
646 void addEditboxProperties(
void);
651 #if defined(_MSC_VER)
652 # pragma warning(pop)
655 #endif // end of guard _CEGUIEditbox_h_
bool d_weOwnValidator
specifies whether validator was created by us, or supplied by user.
Definition: widgets/Editbox.h:634
size_t d_dragAnchorIdx
Selection index for drag selection anchor point.
Definition: widgets/Editbox.h:638
size_t d_maxTextLen
Maximum number of characters for this Editbox.
Definition: widgets/Editbox.h:622
Main namespace for Crazy Eddie's GUI Library.
Definition: arch_overview.dox:1
static const String EventReadOnlyModeChanged
Definition: widgets/Editbox.h:83
const String & getValidationString(void) const
return the currently set validation string
Definition: widgets/Editbox.h:221
static const String EventTextAccepted
Definition: widgets/Editbox.h:147
static const String EventMaskedRenderingModeChanged
Definition: widgets/Editbox.h:89
static const String EventValidationStringChanged
Definition: widgets/Editbox.h:102
static const String EventMaximumTextLengthChanged
Definition: widgets/Editbox.h:108
Base class for the EditboxWindowRenderer class.
Definition: widgets/Editbox.h:45
bool d_previousValidityChangeResponse
Previous match state change response.
Definition: widgets/Editbox.h:642
static const String EventMaskCodePointChanged
Definition: widgets/Editbox.h:96
Interface for Regex matching support classes.
Definition: RegexMatcher.h:39
static const String EventTextValidityChanged
Definition: widgets/Editbox.h:122
Definition: RegexMatcher.h:69
static const String EventNamespace
Namespace for global events.
Definition: widgets/Editbox.h:75
Base-class for the assignable WindowRenderer object.
Definition: WindowRenderer.h:50
MatchState
Enumeration of possible states when cosidering a regex match.
Definition: RegexMatcher.h:44
String d_validationString
Copy of validation reg-ex string.
Definition: widgets/Editbox.h:630
Defines a clipboard handling class.
Definition: Clipboard.h:82
size_t getMaxTextLength(void) const
return the maximum text length set for this Editbox.
Definition: widgets/Editbox.h:290
static const String EventCaretMoved
Definition: widgets/Editbox.h:128
EventArgs based class that is used for objects passed to input event handlers concerning keyboard inp...
Definition: InputEvent.h:314
size_t d_selectionStart
Start of selection area.
Definition: widgets/Editbox.h:626
size_t d_selectionEnd
End of selection area.
Definition: widgets/Editbox.h:628
bool isTextMasked(void) const
return true if the text for the Editbox will be rendered masked.
Definition: widgets/Editbox.h:179
size_t d_caretPos
Position of the caret / insert-point.
Definition: widgets/Editbox.h:624
bool d_dragging
true when a selection is being dragged.
Definition: widgets/Editbox.h:636
bool d_maskText
True if the editbox text should be rendered masked.
Definition: widgets/Editbox.h:618
An abstract base class providing common functionality and specifying the required interface for deriv...
Definition: Window.h:149
Base class for an Editbox widget.
Definition: widgets/Editbox.h:69
bool isReadOnly(void) const
return true if the Editbox is read-only.
Definition: widgets/Editbox.h:167
static const String WidgetTypeName
Window factory name.
Definition: widgets/Editbox.h:77
utf32 value_type
Basic 'code point' type used for String (utf32)
Definition: String.h:69
String::value_type getMaskCodePoint(void) const
return the code point used when rendering masked text.
Definition: widgets/Editbox.h:274
EventArgs based class that is used for objects passed to handlers triggered for events concerning som...
Definition: InputEvent.h:251
static const String EventEditboxFull
Definition: widgets/Editbox.h:140
EventArgs based class that is used for objects passed to input event handlers concerning mouse input...
Definition: InputEvent.h:280
RegexMatcher * d_validator
Pointer to class used for validation of text.
Definition: widgets/Editbox.h:632
MatchState d_validatorMatchState
Current match state of EditboxText.
Definition: widgets/Editbox.h:640
String::value_type d_maskCodePoint
Code point to use when rendering masked text.
Definition: widgets/Editbox.h:620
static const String EventTextSelectionChanged
Definition: widgets/Editbox.h:134
bool d_readOnly
True if the editbox is in read-only mode.
Definition: widgets/Editbox.h:616
String class used within the GUI system.
Definition: String.h:62