30 #ifndef _CEGUIMultiLineEditbox_h_
31 #define _CEGUIMultiLineEditbox_h_
33 #include "../CEGUIBase.h"
34 #include "../CEGUIWindow.h"
35 #include "../CEGUIFont.h"
36 #include "CEGUIMultiLineEditboxProperties.h"
42 # pragma warning(push)
43 # pragma warning(disable : 4251)
71 virtual Rect getTextRenderArea(
void)
const = 0;
75 void onLookNFeelAssigned();
178 bool hasInputFocus(
void)
const;
210 size_t getSelectionStartIndex(
void)
const;
221 size_t getSelectionEndIndex(
void)
const;
231 size_t getSelectionLength(
void)
const;
252 bool isWordWrapped(
void)
const;
276 bool isVertScrollbarAlwaysShown(
void)
const;
300 Rect getTextRenderArea(
void)
const;
303 const LineList& getFormattedLines(
void)
const {
return d_lines;}
310 size_t getLineNumberFromIndex(
size_t index)
const;
325 virtual void initialiseComponents(
void);
339 void setReadOnly(
bool setting);
353 void setCaratIndex(
size_t carat_pos);
371 void setSelection(
size_t start_pos,
size_t end_pos);
384 void setMaxTextLength(
size_t max_len);
391 void ensureCaratIsVisible(
void);
405 void setWordWrapping(
bool setting);
418 void setShowVertScrollbar(
bool setting);
421 void setSelectionBrushImage(
const Image* image);
422 const Image* getSelectionBrushImage()
const;
431 MultiLineEditbox(
const String& type,
const String& name);
438 virtual ~MultiLineEditbox(
void);
465 void formatText(
void);
475 void formatText(
const bool update_scrollbars);
487 size_t getNextTokenLength(
const String& text,
size_t start_idx)
const;
494 void configureScrollbars(
void);
507 size_t getTextIndexFromPosition(
const Point& pt)
const;
514 void clearSelection(
void);
524 void eraseSelectedText(
bool modify_text =
true);
531 void handleBackspace(
void);
538 void handleDelete(
void);
545 void handleCharLeft(uint sysKeys);
552 void handleWordLeft(uint sysKeys);
559 void handleCharRight(uint sysKeys);
566 void handleWordRight(uint sysKeys);
573 void handleDocHome(uint sysKeys);
580 void handleDocEnd(uint sysKeys);
587 void handleLineHome(uint sysKeys);
594 void handleLineEnd(uint sysKeys);
601 void handleLineUp(uint sysKeys);
608 void handleLineDown(uint sysKeys);
615 void handleNewLine(uint sysKeys);
622 void handlePageUp(uint sysKeys);
629 void handlePageDown(uint sysKeys);
644 if ((class_name==
"MultiLineEditBox") ||
645 (class_name==
"MultiLineEditbox"))
657 bool handle_scrollChange(
const EventArgs& args);
660 bool handle_vertScrollbarVisibilityChanged(
const EventArgs&);
665 return (name == EventNamespace);
784 void addMultiLineEditboxProperties(
void);
789 #if defined(_MSC_VER)
790 # pragma warning(pop)
793 #endif // end of guard _CEGUIMultiLineEditbox_h_
size_t getCaratIndex(void) const
return the current position of the carat.
Definition: CEGUIMultiLineEditbox.h:199
bool d_forceVertScroll
true if vertical scrollbar should always be displayed
Definition: CEGUIMultiLineEditbox.h:760
size_t d_startIdx
Starting index for this line.
Definition: CEGUIMultiLineEditbox.h:161
bool isReadOnly(void) const
return true if the edit box is read-only.
Definition: CEGUIMultiLineEditbox.h:189
bool d_dragging
true when a selection is being dragged.
Definition: CEGUIMultiLineEditbox.h:751
Base class for multi-line edit box window renderer objects.
Definition: CEGUIMultiLineEditbox.h:54
float d_widestExtent
Holds the extent of the widest line as calculated in the last formatting pass.
Definition: CEGUIMultiLineEditbox.h:757
size_t d_caratPos
Position of the carat / insert-point.
Definition: CEGUIMultiLineEditbox.h:748
static const String EventNamespace
Namespace for global events.
Definition: CEGUIMultiLineEditbox.h:85
Class that represents a single Image of an Imageset.
Definition: CEGUIImage.h:57
Base class used as the argument to all subscribers Event object.
Definition: CEGUIEventArgs.h:52
LineList d_lines
Holds the lines for the current formatting.
Definition: CEGUIMultiLineEditbox.h:756
Property to access the current carat index.
Definition: CEGUIMultiLineEditboxProperties.h:110
size_t d_dragAnchorIdx
Selection index for drag selection anchor point.
Definition: CEGUIMultiLineEditbox.h:752
virtual bool testClassName_impl(const String &class_name) const
Return whether this window was inherited from the given class name at some point in the inheritance h...
Definition: CEGUIWindow.h:3928
static const String HorzScrollbarNameSuffix
Widget name suffix for the horizontal scrollbar component.
Definition: CEGUIMultiLineEditbox.h:149
bool d_wordWrap
true when formatting uses word-wrapping.
Definition: CEGUIMultiLineEditbox.h:755
bool d_forceHorzScroll
true if horizontal scrollbar should always be displayed
Definition: CEGUIMultiLineEditbox.h:761
static const String WidgetTypeName
Window factory name.
Definition: CEGUIMultiLineEditbox.h:86
Base-class for the assignable WindowRenderer object.
Definition: CEGUIWindowRenderer.h:51
const Image * d_selectionBrush
Image to use as the selection brush (should be set by derived class).
Definition: CEGUIMultiLineEditbox.h:764
size_t d_maxTextLen
Maximum number of characters for this Editbox.
Definition: CEGUIMultiLineEditbox.h:747
static const String EventEditboxFull
Definition: CEGUIMultiLineEditbox.h:129
bool d_readOnly
true if the edit box is in read-only mode
Definition: CEGUIMultiLineEditbox.h:746
size_t d_selectionEnd
End of selection area.
Definition: CEGUIMultiLineEditbox.h:750
EventArgs based class that is used for objects passed to input event handlers concerning keyboard inp...
Definition: CEGUIInputEvent.h:308
size_t getMaxTextLength(void) const
return the maximum text length set for this edit box.
Definition: CEGUIMultiLineEditbox.h:241
Property to access the current selection length.
Definition: CEGUIMultiLineEditboxProperties.h:160
static const String EventHorzScrollbarModeChanged
Definition: CEGUIMultiLineEditbox.h:143
static const String EventWordWrapModeChanged
Definition: CEGUIMultiLineEditbox.h:103
size_t d_selectionStart
Start of selection area.
Definition: CEGUIMultiLineEditbox.h:749
static const String EventCaratMoved
Definition: CEGUIMultiLineEditbox.h:116
An abstract base class providing common functionality and specifying the required interface for deriv...
Definition: CEGUIWindow.h:138
static const String EventTextSelectionChanged
Definition: CEGUIMultiLineEditbox.h:122
virtual bool validateWindowRenderer(const String &name) const
Function used in checking if a WindowRenderer is valid for this window.
Definition: CEGUIMultiLineEditbox.h:663
Base class for the multi-line edit box widget.
Definition: CEGUIMultiLineEditbox.h:82
Vector2 Point
Point class.
Definition: CEGUIVector.h:123
std::vector< LineInfo > LineList
Type for collection of LineInfos.
Definition: CEGUIMultiLineEditbox.h:165
EventArgs based class that is used for objects passed to handlers triggered for events concerning som...
Definition: CEGUIInputEvent.h:245
static const String EventVertScrollbarModeChanged
Definition: CEGUIMultiLineEditbox.h:136
static const String EventReadOnlyModeChanged
Definition: CEGUIMultiLineEditbox.h:97
EventArgs based class that is used for objects passed to input event handlers concerning mouse input...
Definition: CEGUIInputEvent.h:274
struct used to store information about a formatted line within the paragraph.
Definition: CEGUIMultiLineEditbox.h:159
static const String VertScrollbarNameSuffix
Widget name suffix for the vertical scrollbar component.
Definition: CEGUIMultiLineEditbox.h:148
Property to access the read-only setting of the edit box.
Definition: CEGUIMultiLineEditboxProperties.h:59
Property to access the current selection start index.
Definition: CEGUIMultiLineEditboxProperties.h:135
size_t d_length
Code point length of this line.
Definition: CEGUIMultiLineEditbox.h:162
static String d_lineBreakChars
Holds what we consider to be line break characters.
Definition: CEGUIMultiLineEditbox.h:754
static const String EventMaximumTextLengthChanged
Definition: CEGUIMultiLineEditbox.h:110
float d_extent
Rendered extent of this line.
Definition: CEGUIMultiLineEditbox.h:163
Property to access the selection brush image.
Definition: CEGUIMultiLineEditboxProperties.h:208
virtual bool testClassName_impl(const String &class_name) const
Return whether this window was inherited from the given class name at some point in the inheritance h...
Definition: CEGUIMultiLineEditbox.h:642
Property to access the word-wrap setting of the edit box.
Definition: CEGUIMultiLineEditboxProperties.h:85
Class encapsulating operations on a Rectangle.
Definition: CEGUIRect.h:44
String class used within the GUI system.
Definition: CEGUIString.h:57
Property to access the maximum text length for the edit box.
Definition: CEGUIMultiLineEditboxProperties.h:185