This class is an implementation of the Built-in TextArea control. You may check Memo control source code in the Standard package to see how it may be used in your controls.
You can find more information in comments below. Overrided methods can be found in corresponding base class or interface.
class CBuiltInTextArea :public virtual IBuiltInTextArea, public CBuiltInControl
{
public:
enum STATE // Possible states
{
stNormal, // Normal
stHovered, // Control is hovered
stFocused, // Control is focused
stFocusedHovered, // Control is focused and hovered
stDisabled // Control is disabled
};
public:
IBuiltInControlListener * getListener() override;
bool isHovered() override;
CURSOR_TYPE getCursor(const PointF &position, const CURSOR_TYPE def) override;
// Since 5.0.0
bool isDown() override;
// Since 6.2.1
bool hasSelection() override;
void setListener(IBuiltInControlListener *value) override;
bool setFocused(const bool value) override;
bool setEnabled(const bool value) override;
bool setSize(const PointF &value) override;
// Since 4.0.0
bool setDPI(const Point &value) override;
void UpdateFromStyle(IStyle *style, const String &class_name) override;
void Render(const bool last_pass, const Matrix &matrix, const BLOCK *block) override;
void Update() override;
void FreeResources() override;
// State change notifications
void NotifyOnAttach() override;
void NotifyOnDeactivate() override;
// Mouse input notifications
bool NotifyOnMouseHover(const PointF &position) override;
bool NotifyOnMouseLeave() override;
bool NotifyOnMouseMove(const PointF &position, const bool left, const bool middle, const bool right, const bool ctrl, const bool alt, const bool shift) override;
bool NotifyOnMouseLeftDown(const PointF &position, const bool middle, const bool right, const bool ctrl, const bool alt, const bool shift) override;
bool NotifyOnMouseLeftUp(const PointF &position, const bool middle, const bool right, const bool ctrl, const bool alt, const bool shift) override;
bool NotifyOnMouseLeftDoubleClick(const PointF &position, const bool middle, const bool right, const bool ctrl, const bool alt, const bool shift) override;
bool NotifyOnMouseMiddleDown(const PointF &position, const bool left, const bool right, const bool ctrl, const bool alt, const bool shift) override;
bool NotifyOnMouseMiddleUp(const PointF &position, const bool left, const bool right, const bool ctrl, const bool alt, const bool shift) override;
bool NotifyOnMouseMiddleDoubleClick(const PointF &position, const bool left, const bool right, const bool ctrl, const bool alt, const bool shift) override;
bool NotifyOnMouseRightDown(const PointF &position, const bool left, const bool middle, const bool ctrl, const bool alt, const bool shift) override;
bool NotifyOnMouseRightUp(const PointF &position, const bool left, const bool middle, const bool ctrl, const bool alt, const bool shift) override;
bool NotifyOnMouseRightDoubleClick(const PointF &position, const bool left, const bool middle, const bool ctrl, const bool alt, const bool shift) override;
void NotifyOnMouseDownCancel() override;
bool NotifyOnMouseVerticalWheel(const PointF &position, const bool left, const bool middle, const bool right, const bool ctrl, const bool alt, const bool shift, const int delta) override;
bool NotifyOnMouseHorizontalWheel(const PointF &position, const bool left, const bool middle, const bool right, const bool ctrl, const bool alt, const bool shift, const int delta) override;
// Keyboard input notifications
bool NotifyOnKeyDown(const KEY key, const bool ctrl, const bool alt, const bool shift, const bool numlock) override;
bool NotifyOnKeyUp(const KEY key, const bool ctrl, const bool alt, const bool shift, const bool numlock) override;
bool NotifyOnChar(const wchar_t chr, const bool ctrl, const bool alt, const bool shift, const bool numlock) override;
bool NotifyOnDeadChar(const wchar_t chr, const bool ctrl, const bool alt, const bool shift, const bool numlock) override;
// Other input notifications
bool NotifyOnDropFiles(const PointF &position, const std::vector<String> &filenames) override;
// Clipboard notifications(since 9.0.0)
bool NotifyOnPasteString(const String &text) override;
String getText() override;
String getSelectedText() override;
Point getSelection() override;
int getCaretPosition() override;
PointF getScroll() override;
int getMaxLength() override;
int getUndoLimitCount() override;
int getUndoLimitSize() override;
bool canUndo() override;
bool canRedo() override;
TEXT_ALIGN getAlign() override;
PointB getScrollRequired(const PointF &size) override;
PointF getTextSize() override;
PointF getXScrollRange() override;
PointF getYScrollRange() override;
bool isWordWrap() override;
bool isWordBreak() override;
bool isMoving() override;
// Since 3.0.0
int getLineCount() override;
String getLine(const int index) override;
bool setText(String value) override;
bool setSelection(const Point &value) override;
bool setCaretPosition(const int value) override;
bool setScroll(const PointF &value) override;
bool setMaxLength(const int value) override;
bool setUndoLimitCount(const int value) override;
bool setUndoLimitSize(const int value) override;
bool setAlign(const TEXT_ALIGN value) override;
bool setWordWrap(const bool value) override;
bool setWordBreak(const bool value) override;
// Since 3.0.0
bool setLine(const int index, const String &value) override;
bool DeleteSelection() override;
bool DeleteCharBeforeCaret() override;
bool DeleteCharAfterCaret() override;
bool DeleteWordBeforeCaret() override;
bool DeleteWordAfterCaret() override;
bool DeleteToLineStart() override;
bool DeleteToLineEnd() override;
bool DeleteAllBeforeCaret() override;
bool DeleteAllAfterCaret() override;
bool MoveCaretLeft(const bool select) override;
bool MoveCaretRight(const bool select) override;
bool MoveCaretWordLeft(const bool select) override;
bool MoveCaretWordRight(const bool select) override;
bool MoveCaretLineStart(const bool select) override;
bool MoveCaretLineEnd(const bool select) override;
bool MoveCaretLineUp(const bool select) override;
bool MoveCaretLineDown(const bool select) override;
bool MoveCaretPageStart(const bool select) override;
bool MoveCaretPageEnd(const bool select) override;
bool MoveCaretPageUp(const bool select) override;
bool MoveCaretPageDown(const bool select) override;
bool MoveCaretStart(const bool select) override;
bool MoveCaretEnd(const bool select) override;
bool Undo(bool &text_changed) override;
bool Redo(bool &text_changed) override;
bool Insert(const wchar_t chr) override;
bool Insert(String str) override;
bool Replace(const wchar_t chr) override;
bool Replace(String str) override;
bool MoveSelection(const int dst_caret_pos) override;
bool CopySelection(const int dst_caret_pos) override;
bool ScrollToCaret() override;
bool ScrollLineUp() override;
bool ScrollLineDown() override;
bool Copy() override;
bool Cut() override;
bool Paste() override;
bool SelectAll() override;
bool DeselectAll() override;
// Since 3.0.0
bool AddLine(const String &text) override;
bool DeleteLine(const int index) override;
CBuiltInTextArea(); // Constructor
bool isReadOnly() const; // Whether it is read only or not
bool isReplacing() const; // Whether control is in replacing or adding mode
bool isHovered() const; // Whether control is hovered
float getScrollInterval() const; // Return scroll interval(in seconds)
virtual STATE getState(); // Return current state
Color getTextColor(const STATE state) const; // Return text color depending on state
Color getShadowColor(const STATE state) const; // Return text shadow color depending on state
Color getSelectionBackgroundColor(const STATE state) const; // Return selected text background color depending on state
Color getSelectionTextColor(const STATE state) const; // Return selected text color depending on state
Color getSelectionShadowColor(const STATE state) const; // Return selected text shadow color depending on state
PointF getShadowShift(const STATE state) const; // Return shadow shift depending on state
int getShadowRadius(const STATE state) const; // Return shadow blur radius depending on state
bool isCopyByMouseEnabled() const; // Whether copy by mouse is enabled
bool isMoveByMouseEnabled() const; // Whether move by mouse is enabled
bool isSelectWordByDoubleClickEnabled() const; // Whether word selection by double click is enabled
bool isKeyLeftEnabled() const; // Whether left key is enabled
bool isKeyRightEnabled() const; // Whether right key is enabled
bool isKeyHomeEnabled() const; // Whether home key is enabled
bool isKeyEndEnabled() const; // Whether end key is enabled
bool isKeyDeleteEnabled() const; // Whether delete key is enabled
bool isKeyBackspaceEnabled() const; // Whether backspace key is enabled
bool isKeyUpEnabled() const; // Whether up arrow key is enabled
bool isKeyDownEnabled() const; // Whether down arrow key is enabled
bool isKeyPageUpEnabled() const; // Whether PageUp key is enabled
bool isKeyPageDownEnabled() const; // Whether PageDown key is enabled
bool isSelectAllByKeyEnabled() const; // Whether Ctrl+A key combination is enabled
bool isPasteByKeyEnabled() const; // Whether Ctrl+V key combination is enabled
bool isCopyByKeyEnabled() const; // Whether Ctrl+C key combination is enabled
bool isCutByKeyEnabled() const; // Whether Ctrl+X key combination is enabled
bool isHistoryByKeyEnabled() const; // Whether Ctrl+Z and Ctrl+Shift+Z are enabled
bool isInsertReplaceChangeByKeyEnabled() const; // Whether Insert key is enabled
bool isWordWrapChangeByKeyEnabled() const; // Whether Ctrl+W key combination is enabled
bool setReadOnly(const bool value); // Set whether control is read only or not
bool setReplacing(const bool value); // Set replacing or adding mode
bool setScrollInterval(const float value); // Set scroll interval(in seconds)
bool setTextColor(const STATE state, const Color &value); // Set text color depending on state
bool setShadowColor(const STATE state, const Color &value); // Set shadow color depending on state
bool setSelectionBackgroundColor(const STATE state, const Color &value); // Set selected text background color depending on state
bool setSelectionTextColor(const STATE state, const Color &value); // Set selected text color depending on state
bool setSelectionShadowColor(const STATE state, const Color &value); // Set selected text shadow color depending on state
bool setShadowShift(const STATE state, const PointF &value); // Set shadow shift depending on state
bool setShadowRadius(const STATE state, const int value); // Set shadow blur radius depending on state
bool setCopyByMouseEnabled(const bool value); // Set whether copy by mouse is enabled
bool setMoveByMouseEnabled(const bool value); // Set whether move by mouse is enabled
bool setSelectWordByDoubleClickEnabled(const bool value); // Set whether word selection by double click is enabled
bool setKeyLeftEnabled(const bool value); // Set whether left key is enabled
bool setKeyRightEnabled(const bool value); // Set whether right key is enabled
bool setKeyHomeEnabled(const bool value); // Set whether home key is enabled
bool setKeyEndEnabled(const bool value); // Set whether end key is enabled
bool setKeyDeleteEnabled(const bool value); // Set whether delete key is enabled
bool setKeyBackspaceEnabled(const bool value); // Set whether backspace key is enabled
bool setKeyUpEnabled(const bool value); // Set whether up arrow key is enabled
bool setKeyDownEnabled(const bool value); // Set whether down arrow key is enabled
bool setKeyPageUpEnabled(const bool value); // Set whether PageUp key is enabled
bool setKeyPageDownEnabled(const bool value); // Set whether PageDown key is enabled
bool setSelectAllByKeyEnabled(const bool value); // Set whether Ctrl+A key combination is enabled
bool setPasteByKeyEnabled(const bool value); // Set whether Ctrl+V key combination is enabled
bool setCopyByKeyEnabled(const bool value); // Set whether Ctrl+C key combination is enabled
bool setCutByKeyEnabled(const bool value); // Set whether Ctrl+X key combination is enabled
bool setHistoryByKeyEnabled(const bool value); // Set whether Ctrl+Z and Ctrl+Shift+Z are enabled
bool setInsertReplaceChangeByKeyEnabled(const bool value); // Set whether Insert key is enabled
bool setWordWrapChangeByKeyEnabled(const bool value); // Set whether Ctrl+W key combination is enabled
};
Namespace: | nitisa |
Include: | Nitisa/BuiltInControls/TextArea/BuiltInTextArea.h |