29 #ifndef _CEGUIMultiLineEditbox_h_
30 #define _CEGUIMultiLineEditbox_h_
33 #include "../Window.h"
39 # pragma warning(push)
40 # pragma warning(disable : 4251)
68 virtual Rectf getTextRenderArea(
void)
const = 0;
72 void onLookNFeelAssigned();
176 bool hasInputFocus(
void)
const;
208 size_t getSelectionStartIndex(
void)
const;
219 size_t getSelectionEndIndex(
void)
const;
229 size_t getSelectionLength(
void)
const;
250 bool isWordWrapped(
void)
const;
274 bool isVertScrollbarAlwaysShown(
void)
const;
298 Rectf getTextRenderArea(
void)
const;
301 const LineList& getFormattedLines(
void)
const {
return d_lines;}
308 size_t getLineNumberFromIndex(
size_t index)
const;
323 virtual void initialiseComponents(
void);
337 void setReadOnly(
bool setting);
351 void setCaretIndex(
size_t caret_pos);
369 void setSelection(
size_t start_pos,
size_t end_pos);
383 void setSelectionStart(
size_t start_pos);
395 void setSelectionLength(
size_t length);
407 void setMaxTextLength(
size_t max_len);
414 void ensureCaretIsVisible(
void);
428 void setWordWrapping(
bool setting);
441 void setShowVertScrollbar(
bool setting);
444 void setSelectionBrushImage(
const Image* image);
445 const Image* getSelectionBrushImage()
const;
448 virtual bool performCopy(Clipboard& clipboard);
451 virtual bool performCut(Clipboard& clipboard);
454 virtual bool performPaste(Clipboard& clipboard);
464 void formatText(
const bool update_scrollbars);
473 MultiLineEditbox(
const String& type,
const String& name);
480 virtual ~MultiLineEditbox(
void);
507 void formatText(
void);
519 size_t getNextTokenLength(
const String& text,
size_t start_idx)
const;
526 void configureScrollbars(
void);
539 size_t getTextIndexFromPosition(
const Vector2f& pt)
const;
546 void clearSelection(
void);
556 void eraseSelectedText(
bool modify_text =
true);
563 void handleBackspace(
void);
570 void handleDelete(
void);
577 void handleCharLeft(uint sysKeys);
584 void handleWordLeft(uint sysKeys);
591 void handleCharRight(uint sysKeys);
598 void handleWordRight(uint sysKeys);
605 void handleDocHome(uint sysKeys);
612 void handleDocEnd(uint sysKeys);
619 void handleLineHome(uint sysKeys);
626 void handleLineEnd(uint sysKeys);
633 void handleLineUp(uint sysKeys);
640 void handleLineDown(uint sysKeys);
647 void handleNewLine(uint sysKeys);
654 void handlePageUp(uint sysKeys);
661 void handlePageDown(uint sysKeys);
667 bool handle_scrollChange(
const EventArgs& args);
670 bool handle_vertScrollbarVisibilityChanged(
const EventArgs&);
673 virtual bool validateWindowRenderer(
const WindowRenderer* renderer)
const;
682 void onReadOnlyChanged(WindowEventArgs& e);
689 void onWordWrapModeChanged(WindowEventArgs& e);
696 void onMaximumTextLengthChanged(WindowEventArgs& e);
703 void onCaretMoved(WindowEventArgs& e);
710 void onTextSelectionChanged(WindowEventArgs& e);
717 void onEditboxFullEvent(WindowEventArgs& e);
724 void onVertScrollbarModeChanged(WindowEventArgs& e);
731 void onHorzScrollbarModeChanged(WindowEventArgs& e);
737 virtual void onMouseButtonDown(MouseEventArgs& e);
738 virtual void onMouseButtonUp(MouseEventArgs& e);
739 virtual void onMouseDoubleClicked(MouseEventArgs& e);
740 virtual void onMouseTripleClicked(MouseEventArgs& e);
741 virtual void onMouseMove(MouseEventArgs& e);
742 virtual void onCaptureLost(WindowEventArgs& e);
743 virtual void onCharacter(KeyEventArgs& e);
744 virtual void onKeyDown(KeyEventArgs& e);
745 virtual void onTextChanged(WindowEventArgs& e);
746 virtual void onSized(ElementEventArgs& e);
747 virtual void onMouseWheel(MouseEventArgs& e);
748 virtual void onFontChanged(WindowEventArgs& e);
779 void addMultiLineEditboxProperties(
void);
784 #if defined(_MSC_VER)
785 # pragma warning(pop)
788 #endif // end of guard _CEGUIMultiLineEditbox_h_
bool d_forceVertScroll
true if vertical scrollbar should always be displayed
Definition: widgets/MultiLineEditbox.h:768
size_t d_startIdx
Starting index for this line.
Definition: widgets/MultiLineEditbox.h:158
bool isReadOnly(void) const
return true if the edit box is read-only.
Definition: widgets/MultiLineEditbox.h:187
bool d_dragging
true when a selection is being dragged.
Definition: widgets/MultiLineEditbox.h:759
static const String HorzScrollbarName
Widget name for the horizontal scrollbar component.
Definition: widgets/MultiLineEditbox.h:146
Base class for multi-line edit box window renderer objects.
Definition: widgets/MultiLineEditbox.h:51
float d_widestExtent
Holds the extent of the widest line as calculated in the last formatting pass.
Definition: widgets/MultiLineEditbox.h:765
static const String EventNamespace
Namespace for global events.
Definition: widgets/MultiLineEditbox.h:82
Interface for Image.
Definition: Image.h:158
Main namespace for Crazy Eddie's GUI Library.
Definition: arch_overview.dox:1
LineList d_lines
Holds the lines for the current formatting.
Definition: widgets/MultiLineEditbox.h:764
size_t d_caretPos
Position of the caret / insert-point.
Definition: widgets/MultiLineEditbox.h:756
size_t d_dragAnchorIdx
Selection index for drag selection anchor point.
Definition: widgets/MultiLineEditbox.h:760
bool d_wordWrap
true when formatting uses word-wrapping.
Definition: widgets/MultiLineEditbox.h:763
size_t getCaretIndex(void) const
return the current position of the caret.
Definition: widgets/MultiLineEditbox.h:197
bool d_forceHorzScroll
true if horizontal scrollbar should always be displayed
Definition: widgets/MultiLineEditbox.h:769
static const String WidgetTypeName
Window factory name.
Definition: widgets/MultiLineEditbox.h:83
Base-class for the assignable WindowRenderer object.
Definition: WindowRenderer.h:50
const Image * d_selectionBrush
Image to use as the selection brush (should be set by derived class).
Definition: widgets/MultiLineEditbox.h:772
size_t d_maxTextLen
Maximum number of characters for this Editbox.
Definition: widgets/MultiLineEditbox.h:755
static const String EventEditboxFull
Definition: widgets/MultiLineEditbox.h:126
static const String EventCaretMoved
Definition: widgets/MultiLineEditbox.h:113
bool d_readOnly
true if the edit box is in read-only mode
Definition: widgets/MultiLineEditbox.h:754
size_t d_selectionEnd
End of selection area.
Definition: widgets/MultiLineEditbox.h:758
size_t getMaxTextLength(void) const
return the maximum text length set for this edit box.
Definition: widgets/MultiLineEditbox.h:239
static const String EventHorzScrollbarModeChanged
Definition: widgets/MultiLineEditbox.h:140
static const String EventWordWrapModeChanged
Definition: widgets/MultiLineEditbox.h:100
size_t d_selectionStart
Start of selection area.
Definition: widgets/MultiLineEditbox.h:757
An abstract base class providing common functionality and specifying the required interface for deriv...
Definition: Window.h:149
static const String EventTextSelectionChanged
Definition: widgets/MultiLineEditbox.h:119
Base class for the multi-line edit box widget.
Definition: widgets/MultiLineEditbox.h:79
std::vector< LineInfo CEGUI_VECTOR_ALLOC(LineInfo)> LineList
Type for collection of LineInfos.
Definition: widgets/MultiLineEditbox.h:163
static const String EventVertScrollbarModeChanged
Definition: widgets/MultiLineEditbox.h:133
static const String EventReadOnlyModeChanged
Definition: widgets/MultiLineEditbox.h:94
struct used to store information about a formatted line within the paragraph.
Definition: widgets/MultiLineEditbox.h:156
size_t d_length
Code point length of this line.
Definition: widgets/MultiLineEditbox.h:159
static const String VertScrollbarName
Widget name for the vertical scrollbar component.
Definition: widgets/MultiLineEditbox.h:145
static String d_lineBreakChars
Holds what we consider to be line break characters.
Definition: widgets/MultiLineEditbox.h:762
static const String EventMaximumTextLengthChanged
Definition: widgets/MultiLineEditbox.h:107
float d_extent
Rendered extent of this line.
Definition: widgets/MultiLineEditbox.h:160
String class used within the GUI system.
Definition: String.h:62