Crazy Eddie's GUI System
0.8.7
|
29 #ifndef _CEGUIMultiLineEditbox_h_
30 #define _CEGUIMultiLineEditbox_h_
33 #include "../Window.h"
39 # pragma warning(push)
40 # pragma warning(disable : 4251)
301 const LineList& getFormattedLines(
void)
const {
return d_lines;}
444 void setSelectionBrushImage(
const Image* image);
445 const Image* getSelectionBrushImage()
const;
670 bool handle_vertScrollbarVisibilityChanged(
const EventArgs&);
779 void addMultiLineEditboxProperties(
void);
784 #if defined(_MSC_VER)
785 # pragma warning(pop)
788 #endif // end of guard _CEGUIMultiLineEditbox_h_
Defines a clipboard handling class.
Definition: Clipboard.h:84
static const String EventEditboxFull
Definition: widgets/MultiLineEditbox.h:126
size_t d_caretPos
Position of the caret / insert-point.
Definition: widgets/MultiLineEditbox.h:756
virtual void onFontChanged(WindowEventArgs &e)
Handler called when the window's font is changed.
void setMaxTextLength(size_t max_len)
set the maximum text length for this edit box.
virtual bool validateWindowRenderer(const WindowRenderer *renderer) const
Function used in checking if a WindowRenderer is valid for this window.
void onMaximumTextLengthChanged(WindowEventArgs &e)
Handler called when the maximum text length for the edit box changes.
void onVertScrollbarModeChanged(WindowEventArgs &e)
Handler called when the 'always show' setting for the vertical scroll bar changes.
virtual Rectf getTextRenderArea(void) const =0
Return a Rect object describing, in un-clipped pixels, the window relative area that the text should ...
virtual ~MultiLineEditbox(void)
Destructor for the MultiLineEditbox base class.
void onTextSelectionChanged(WindowEventArgs &e)
Handler called when the text selection changes.
size_t getNextTokenLength(const String &text, size_t start_idx) const
Return the length of the next token in String text starting at index start_idx.
void onHorzScrollbarModeChanged(WindowEventArgs &e)
Handler called when 'always show' setting for the horizontal scroll bar changes.
void configureScrollbars(void)
display required integrated scroll bars according to current state of the edit box and update their v...
static const String EventNamespace
Namespace for global events.
Definition: widgets/MultiLineEditbox.h:82
virtual void onMouseDoubleClicked(MouseEventArgs &e)
Handler called when a mouse button has been double-clicked within this window's area.
virtual void onMouseTripleClicked(MouseEventArgs &e)
Handler called when a mouse button has been triple-clicked within this window's area.
size_t getCaretIndex(void) const
return the current position of the caret.
Definition: widgets/MultiLineEditbox.h:197
size_t d_selectionStart
Start of selection area.
Definition: widgets/MultiLineEditbox.h:757
void onWordWrapModeChanged(WindowEventArgs &e)
Handler called when the word wrap mode for the the edit box changes.
size_t getTextIndexFromPosition(const Vector2f &pt) const
Return the text code point index that is rendered closest to screen position pt.
bool d_forceHorzScroll
true if horizontal scrollbar should always be displayed
Definition: widgets/MultiLineEditbox.h:769
bool d_readOnly
true if the edit box is in read-only mode
Definition: widgets/MultiLineEditbox.h:754
void handleDelete(void)
Processing for Delete key.
EventArgs based class that is used for objects passed to handlers triggered for events concerning som...
Definition: Element.h:211
void onEditboxFullEvent(WindowEventArgs &e)
Handler called when the edit box is full.
virtual bool performCut(Clipboard &clipboard)
Asks the widget to perform a clipboard cut to the provided clipboard.
void onCaretMoved(WindowEventArgs &e)
Handler called when the caret moves.
void handlePageDown(uint sysKeys)
Processing to move caret one page down.
virtual void onCaptureLost(WindowEventArgs &e)
Handler called when this window loses capture of mouse inputs.
Base class for multi-line edit box window renderer objects.
Definition: widgets/MultiLineEditbox.h:52
static const String EventTextSelectionChanged
Definition: widgets/MultiLineEditbox.h:119
Scrollbar * getHorzScrollbar() const
Return a pointer to the horizontal scrollbar component widget for this MultiLineEditbox.
void handleDocEnd(uint sysKeys)
Processing to move caret to the end of the text.
static const String EventWordWrapModeChanged
Definition: widgets/MultiLineEditbox.h:100
void setSelectionLength(size_t length)
Define the current selection for the Editbox.
void setWordWrapping(bool setting)
Set whether the text will be word wrapped or not.
float d_widestExtent
Holds the extent of the widest line as calculated in the last formatting pass.
Definition: widgets/MultiLineEditbox.h:765
Rectf getTextRenderArea(void) const
Return a Rect object describing, in un-clipped pixels, the window relative area that the text should ...
Main namespace for Crazy Eddie's GUI Library.
Definition: arch_overview.dox:1
EventArgs based class that is used for objects passed to input event handlers concerning mouse input.
Definition: InputEvent.h:281
static const String EventHorzScrollbarModeChanged
Definition: widgets/MultiLineEditbox.h:140
bool isReadOnly(void) const
return true if the edit box is read-only.
Definition: widgets/MultiLineEditbox.h:187
virtual void onTextChanged(WindowEventArgs &e)
Handler called when the window's text is changed.
virtual void onMouseWheel(MouseEventArgs &e)
Handler called when the mouse wheel (z-axis) position changes within this window's area.
const Image * d_selectionBrush
Image to use as the selection brush (should be set by derived class).
Definition: widgets/MultiLineEditbox.h:772
MultiLineEditbox(const String &type, const String &name)
Constructor for the MultiLineEditbox base class.
struct used to store information about a formatted line within the paragraph.
Definition: widgets/MultiLineEditbox.h:157
void setShowVertScrollbar(bool setting)
Set whether the vertical scroll bar should always be shown.
Scrollbar * getVertScrollbar() const
Return a pointer to the vertical scrollbar component widget for this MultiLineEditbox.
EventArgs based class that is used for objects passed to handlers triggered for events concerning som...
Definition: InputEvent.h:252
virtual void onMouseMove(MouseEventArgs &e)
Handler called when the mouse cursor has been moved within this window's area.
size_t d_dragAnchorIdx
Selection index for drag selection anchor point.
Definition: widgets/MultiLineEditbox.h:760
LineList d_lines
Holds the lines for the current formatting.
Definition: widgets/MultiLineEditbox.h:764
static const String EventCaretMoved
Definition: widgets/MultiLineEditbox.h:113
virtual void onMouseButtonDown(MouseEventArgs &e)
Handler called when a mouse button has been depressed within this window's area.
virtual void initialiseComponents(void)
Initialise the Window based object ready for use.
void handleDocHome(uint sysKeys)
Processing to move caret to the start of the text.
EventArgs based class that is used for objects passed to input event handlers concerning keyboard inp...
Definition: InputEvent.h:315
Base class for the multi-line edit box widget.
Definition: widgets/MultiLineEditbox.h:80
float d_extent
Rendered extent of this line.
Definition: widgets/MultiLineEditbox.h:160
MultiLineEditboxWindowRenderer(const String &name)
Constructor.
size_t getMaxTextLength(void) const
return the maximum text length set for this edit box.
Definition: widgets/MultiLineEditbox.h:239
void handleLineHome(uint sysKeys)
Processing to move caret to the start of the current line.
bool isWordWrapped(void) const
Return whether the text in the edit box will be word-wrapped.
size_t d_maxTextLen
Maximum number of characters for this Editbox.
Definition: widgets/MultiLineEditbox.h:755
void handleBackspace(void)
Processing for backspace key.
size_t d_startIdx
Starting index for this line.
Definition: widgets/MultiLineEditbox.h:158
void handleLineEnd(uint sysKeys)
Processing to move caret to the end of the current line.
size_t getLineNumberFromIndex(size_t index) const
Return the line number a given index falls on with the current formatting. Will return last line if i...
static const String WidgetTypeName
Window factory name.
Definition: widgets/MultiLineEditbox.h:83
void setReadOnly(bool setting)
Specify whether the edit box is read-only.
size_t getSelectionLength(void) const
return the length of the current selection (in code points / characters).
void clearSelection(void)
Clear the current selection setting.
void handleWordLeft(uint sysKeys)
Processing to move caret one word left.
void setCaretIndex(size_t caret_pos)
Set the current position of the caret.
virtual void onCharacter(KeyEventArgs &e)
Handler called when a character-key has been pressed while this window has input focus.
virtual void onSized(ElementEventArgs &e)
Handler called when the window's size changes.
void setSelection(size_t start_pos, size_t end_pos)
Define the current selection for the edit box.
size_t d_length
Code point length of this line.
Definition: widgets/MultiLineEditbox.h:159
size_t d_selectionEnd
End of selection area.
Definition: widgets/MultiLineEditbox.h:758
void handlePageUp(uint sysKeys)
Processing to move caret one page up.
static const String VertScrollbarName
Widget name for the vertical scrollbar component.
Definition: widgets/MultiLineEditbox.h:145
bool isVertScrollbarAlwaysShown(void) const
Return whether the vertical scroll bar is always shown.
bool handle_scrollChange(const EventArgs &args)
Internal handler that is triggered when the user interacts with the scrollbars.
bool hasInputFocus(void) const
return true if the edit box has input focus.
bool d_wordWrap
true when formatting uses word-wrapping.
Definition: widgets/MultiLineEditbox.h:763
An abstract base class providing common functionality and specifying the required interface for deriv...
Definition: Window.h:151
size_t getSelectionStartIndex(void) const
return the current selection start point.
void handleLineUp(uint sysKeys)
Processing to move caret up a line.
Base-class for the assignable WindowRenderer object.
Definition: WindowRenderer.h:52
std::vector< LineInfo CEGUI_VECTOR_ALLOC(LineInfo)> LineList
Type for collection of LineInfos.
Definition: widgets/MultiLineEditbox.h:163
static const String EventReadOnlyModeChanged
Definition: widgets/MultiLineEditbox.h:94
static const String EventVertScrollbarModeChanged
Definition: widgets/MultiLineEditbox.h:133
void onLookNFeelAssigned()
Handler called when a Look'N'Feel is assigned to our window.
virtual void onKeyDown(KeyEventArgs &e)
Handler called when a key as been depressed while this window has input focus.
void handleLineDown(uint sysKeys)
Processing to move caret down a line.
void handleNewLine(uint sysKeys)
Processing to insert a new line / paragraph.
String class used within the GUI system.
Definition: String.h:64
void ensureCaretIsVisible(void)
Scroll the view so that the current caret position is visible.
virtual void onMouseButtonUp(MouseEventArgs &e)
Handler called when a mouse button has been released within this window's area.
void formatText(void)
Return a Rect object describing, in un-clipped pixels, the window relative area that the text should ...
void formatText(const bool update_scrollbars)
Format the text into lines as dictated by the formatting options.
bool d_dragging
true when a selection is being dragged.
Definition: widgets/MultiLineEditbox.h:759
virtual bool performCopy(Clipboard &clipboard)
Asks the widget to perform a clipboard copy to the provided clipboard.
size_t getSelectionEndIndex(void) const
return the current selection end point.
void handleCharRight(uint sysKeys)
Processing to move caret one character right.
void handleWordRight(uint sysKeys)
Processing to move caret one word right.
void eraseSelectedText(bool modify_text=true)
Erase the currently selected text.
static String d_lineBreakChars
Holds what we consider to be line break characters.
Definition: widgets/MultiLineEditbox.h:762
static const String HorzScrollbarName
Widget name for the horizontal scrollbar component.
Definition: widgets/MultiLineEditbox.h:146
Interface for Image.
Definition: Image.h:161
void onReadOnlyChanged(WindowEventArgs &e)
Handler called when the read-only state of the edit box changes.
void setSelectionStart(size_t start_pos)
Define the current selection start for the Editbox.
virtual bool performPaste(Clipboard &clipboard)
Asks the widget to perform a clipboard paste from the provided clipboard.
Base class used as the argument to all subscribers Event object.
Definition: EventArgs.h:51
static const String EventMaximumTextLengthChanged
Definition: widgets/MultiLineEditbox.h:107
void handleCharLeft(uint sysKeys)
Processing to move caret one character left.
bool d_forceVertScroll
true if vertical scrollbar should always be displayed
Definition: widgets/MultiLineEditbox.h:768