MyGUI  3.2.0
Public Types | Public Member Functions | Static Public Member Functions | Data Fields | Protected Member Functions | Protected Attributes
MyGUI::EditBox Class Reference

#include <MyGUI_EditBox.h>

+ Inheritance diagram for MyGUI::EditBox:

Public Types

typedef RTTIBase Base
typedef EditBox RTTIBase

Public Member Functions

virtual const std::string & getTypeName () const
virtual bool isType (const std::type_info &_type) const
template<typename Type >
bool isType () const
 EditBox ()
void setTextIntervalColour (size_t _start, size_t _count, const Colour &_colour)
size_t getTextSelectionStart () const
size_t getTextSelectionEnd () const
size_t getTextSelectionLength () const
UString getTextInterval (size_t _start, size_t _count)
void setTextSelection (size_t _start, size_t _end)
void deleteTextSelection ()
UString getTextSelection ()
bool isTextSelection () const
void setTextSelectionColour (const Colour &_value)
void setTextCursor (size_t _index)
size_t getTextCursor () const
virtual void setCaption (const UString &_value)
virtual const UStringgetCaption ()
void setOnlyText (const UString &_value)
UString getOnlyText ()
size_t getTextLength () const
void setOverflowToTheLeft (bool _value)
 Sets if surplus characters should push characters off the left side rather than ignored.
bool getOverflowToTheLeft () const
 Returns true if surplus characters will be pushed off the left rather than ignored.
void setMaxTextLength (size_t _value)
 Sets the max amount of text allowed in the edit field.
size_t getMaxTextLength () const
 Gets the max amount of text allowed in the edit field.
void insertText (const UString &_text, size_t _index=ITEM_NONE)
void addText (const UString &_text)
void eraseText (size_t _start, size_t _count=1)
void setEditReadOnly (bool _value)
bool getEditReadOnly () const
void setEditPassword (bool _value)
bool getEditPassword () const
void setEditMultiLine (bool _value)
bool getEditMultiLine () const
void setEditStatic (bool _value)
bool getEditStatic () const
void setPasswordChar (Char _value)
void setPasswordChar (const UString &_char)
Char getPasswordChar () const
void setEditWordWrap (bool _value)
bool getEditWordWrap () const
void setTabPrinting (bool _value)
bool getTabPrinting () const
bool getInvertSelected ()
void setInvertSelected (bool _value)
virtual void setPosition (const IntPoint &_value)
virtual void setSize (const IntSize &_value)
virtual void setCoord (const IntCoord &_value)
void setPosition (int _left, int _top)
void setSize (int _width, int _height)
void setCoord (int _left, int _top, int _width, int _height)
void setVisibleVScroll (bool _value)
bool isVisibleVScroll () const
size_t getVScrollRange () const
size_t getVScrollPosition ()
void setVScrollPosition (size_t _index)
void setVisibleHScroll (bool _value)
bool isVisibleHScroll () const
size_t getHScrollRange () const
size_t getHScrollPosition ()
void setHScrollPosition (size_t _index)
virtual void setFontName (const std::string &_value)
virtual void setFontHeight (int _value)
virtual void setTextAlign (Align _value)
virtual void setTextColour (const Colour &_value)
virtual IntCoord getTextRegion ()
virtual IntSize getTextSize ()
virtual void setTextShadowColour (const Colour &_value)
virtual void setTextShadow (bool _value)

Static Public Member Functions

static const std::string & getClassTypeName ()

Data Fields

EventPair
< EventHandle_WidgetVoid,
EventHandle_EditPtr
eventEditSelectAccept
EventPair
< EventHandle_WidgetVoid,
EventHandle_EditPtr
eventEditTextChange

Protected Member Functions

virtual void initialiseOverride ()
virtual void shutdownOverride ()
virtual void onMouseDrag (int _left, int _top, MouseButton _id)
virtual void onKeyLostFocus (Widget *_new)
virtual void onKeySetFocus (Widget *_old)
virtual void onKeyButtonPressed (KeyCode _key, Char _char)
void notifyMouseSetFocus (Widget *_sender, Widget *_old)
void notifyMouseLostFocus (Widget *_sender, Widget *_new)
void notifyMousePressed (Widget *_sender, int _left, int _top, MouseButton _id)
void notifyMouseReleased (Widget *_sender, int _left, int _top, MouseButton _id)
void notifyMouseDrag (Widget *_sender, int _left, int _top, MouseButton _id)
void notifyMouseButtonDoubleClick (Widget *_sender)
void notifyScrollChangePosition (ScrollBar *_sender, size_t _position)
void notifyMouseWheel (Widget *_sender, int _rel)
void updateView ()
void updateViewWithCursor ()
void eraseView ()
virtual void setPropertyOverride (const std::string &_key, const std::string &_value)

Protected Attributes

bool mIsPressed
bool mIsFocus
bool mCursorActive
float mCursorTimer
float mActionMouseTimer
size_t mCursorPosition
size_t mTextLength
size_t mStartSelect
size_t mEndSelect
DequeUndoRedoInfo mVectorUndoChangeInfo
DequeUndoRedoInfo mVectorRedoChangeInfo
bool mMouseLeftPressed
bool mModeReadOnly
bool mModePassword
bool mModeMultiline
bool mModeStatic
bool mModeWordWrap
bool mTabPrinting
UString mPasswordText
std::string mOriginalPointer
Char mCharPassword
bool mOverflowToTheLeft
size_t mMaxTextLength
ISubWidgetTextmClientText

Detailed Description

Definition at line 37 of file MyGUI_EditBox.h.


Member Typedef Documentation

Reimplemented from MyGUI::TextBox.

Reimplemented in MyGUI::ComboBox.

Definition at line 42 of file MyGUI_EditBox.h.

Reimplemented from MyGUI::TextBox.

Reimplemented in MyGUI::ComboBox.

Definition at line 42 of file MyGUI_EditBox.h.


Constructor & Destructor Documentation

Definition at line 49 of file MyGUI_EditBox.cpp.


Member Function Documentation

void MyGUI::EditBox::addText ( const UString _text)

Add text

Definition at line 1916 of file MyGUI_EditBox.cpp.

Delete selected text

Definition at line 1886 of file MyGUI_EditBox.cpp.

void MyGUI::EditBox::eraseText ( size_t  _start,
size_t  _count = 1 
)

Erase _count characters from _start position

Definition at line 1921 of file MyGUI_EditBox.cpp.

void MyGUI::EditBox::eraseView ( ) [protected]

Definition at line 1531 of file MyGUI_EditBox.cpp.

const UString & MyGUI::EditBox::getCaption ( ) [virtual]

Get edit text with tags

Reimplemented from MyGUI::TextBox.

Definition at line 1562 of file MyGUI_EditBox.cpp.

static const std::string& MyGUI::EditBox::getClassTypeName ( ) [inline, static]

Reimplemented from MyGUI::TextBox.

Reimplemented in MyGUI::ComboBox.

Definition at line 42 of file MyGUI_EditBox.h.

Get edit multiline mode flag

Definition at line 2125 of file MyGUI_EditBox.cpp.

Get edit password mode flag

Definition at line 2120 of file MyGUI_EditBox.cpp.

Get edit read only mode flag

Definition at line 2115 of file MyGUI_EditBox.cpp.

Get edit static mode flag

Definition at line 2130 of file MyGUI_EditBox.cpp.

Get edit word wrap mode flag

Definition at line 2140 of file MyGUI_EditBox.cpp.

Get current position of horizontal scroll (or 0 if no scroll)

Definition at line 2014 of file MyGUI_EditBox.cpp.

Get range of horizontal scroll (or 0 if no scroll). Range measured in pixels (full text width minus EditBox width). For example if EditBox is 200 pixels width and the longest line is 600 pixels width, then return value is 400 ( = 600 - 200 ).

Definition at line 2009 of file MyGUI_EditBox.cpp.

Get invert selected text color property

Definition at line 2036 of file MyGUI_EditBox.cpp.

Gets the max amount of text allowed in the edit field.

Definition at line 2110 of file MyGUI_EditBox.cpp.

Get edit text without tags

Definition at line 1906 of file MyGUI_EditBox.cpp.

Returns true if surplus characters will be pushed off the left rather than ignored.

Definition at line 2100 of file MyGUI_EditBox.cpp.

Get edit password character

Definition at line 2135 of file MyGUI_EditBox.cpp.

Get edit tab printing wrap mode flag

Definition at line 2150 of file MyGUI_EditBox.cpp.

Get text cursor position

Definition at line 2085 of file MyGUI_EditBox.cpp.

UString MyGUI::EditBox::getTextInterval ( size_t  _start,
size_t  _count 
)

Get _count characters with tags from _start position

Definition at line 1021 of file MyGUI_EditBox.cpp.

Get text length excluding tags For example "Hello" length is 5 and "#00FF00Hello!" length is 6

Definition at line 2090 of file MyGUI_EditBox.cpp.

Get text region coordinate

Reimplemented from MyGUI::TextBox.

Definition at line 1617 of file MyGUI_EditBox.cpp.

Get selected text

Definition at line 1149 of file MyGUI_EditBox.cpp.

Get index of last selected character or ITEM_NONE if nothing selected

Definition at line 1876 of file MyGUI_EditBox.cpp.

Get length of selected text

Definition at line 1896 of file MyGUI_EditBox.cpp.

Get index of first selected character or ITEM_NONE if nothing selected

Definition at line 1871 of file MyGUI_EditBox.cpp.

Get text region size

Reimplemented from MyGUI::TextBox.

Definition at line 1624 of file MyGUI_EditBox.cpp.

virtual const std::string& MyGUI::EditBox::getTypeName ( ) const [inline, virtual]

Get type name as string

Reimplemented from MyGUI::TextBox.

Reimplemented in MyGUI::ComboBox.

Definition at line 42 of file MyGUI_EditBox.h.

Get current position of vertical scroll (or 0 if no scroll)

Definition at line 1987 of file MyGUI_EditBox.cpp.

Get range of vertical scroll (or 0 if no scroll). Range measured in pixels (full text heiht minus EditBox height). For example if EditBox is 200 pixels height and 40 lines of text 30 pixels height each (i.e. 600 pixels total), then return value is 400 ( = 600 - 200 ).

Definition at line 1982 of file MyGUI_EditBox.cpp.

void MyGUI::EditBox::initialiseOverride ( ) [protected, virtual]

Reimplemented from MyGUI::Widget.

Reimplemented in MyGUI::ComboBox.

Definition at line 74 of file MyGUI_EditBox.cpp.

void MyGUI::EditBox::insertText ( const UString _text,
size_t  _index = ITEM_NONE 
)

Inser text at _index position (text end by default)

Definition at line 1911 of file MyGUI_EditBox.cpp.

Is any text selected

Definition at line 1881 of file MyGUI_EditBox.cpp.

template<typename Type >
bool MyGUI::EditBox::isType ( ) const [inline]

Compare with selected type

Reimplemented from MyGUI::TextBox.

Reimplemented in MyGUI::ComboBox.

Definition at line 42 of file MyGUI_EditBox.h.

virtual bool MyGUI::EditBox::isType ( const std::type_info &  _type) const [inline, virtual]

Compare with selected type

Reimplemented from MyGUI::TextBox.

Reimplemented in MyGUI::ComboBox.

Definition at line 42 of file MyGUI_EditBox.h.

Get Show HScroll flag

Definition at line 2175 of file MyGUI_EditBox.cpp.

Get Show VScroll flag

Definition at line 2170 of file MyGUI_EditBox.cpp.

void MyGUI::EditBox::notifyMouseButtonDoubleClick ( Widget _sender) [protected]

Definition at line 219 of file MyGUI_EditBox.cpp.

void MyGUI::EditBox::notifyMouseDrag ( Widget _sender,
int  _left,
int  _top,
MouseButton  _id 
) [protected]

Definition at line 179 of file MyGUI_EditBox.cpp.

void MyGUI::EditBox::notifyMouseLostFocus ( Widget _sender,
Widget _new 
) [protected]

Definition at line 144 of file MyGUI_EditBox.cpp.

void MyGUI::EditBox::notifyMousePressed ( Widget _sender,
int  _left,
int  _top,
MouseButton  _id 
) [protected]

Definition at line 153 of file MyGUI_EditBox.cpp.

void MyGUI::EditBox::notifyMouseReleased ( Widget _sender,
int  _left,
int  _top,
MouseButton  _id 
) [protected]

Definition at line 173 of file MyGUI_EditBox.cpp.

void MyGUI::EditBox::notifyMouseSetFocus ( Widget _sender,
Widget _old 
) [protected]

Definition at line 135 of file MyGUI_EditBox.cpp.

void MyGUI::EditBox::notifyMouseWheel ( Widget _sender,
int  _rel 
) [protected]

Definition at line 1650 of file MyGUI_EditBox.cpp.

void MyGUI::EditBox::notifyScrollChangePosition ( ScrollBar _sender,
size_t  _position 
) [protected]

Definition at line 1631 of file MyGUI_EditBox.cpp.

void MyGUI::EditBox::onKeyButtonPressed ( KeyCode  _key,
Char  _char 
) [protected, virtual]

Reimplemented from MyGUI::WidgetInput.

Reimplemented in MyGUI::ComboBox.

Definition at line 306 of file MyGUI_EditBox.cpp.

void MyGUI::EditBox::onKeyLostFocus ( Widget _new) [protected, virtual]

Reimplemented from MyGUI::WidgetInput.

Definition at line 287 of file MyGUI_EditBox.cpp.

void MyGUI::EditBox::onKeySetFocus ( Widget _old) [protected, virtual]

Reimplemented from MyGUI::WidgetInput.

Definition at line 264 of file MyGUI_EditBox.cpp.

void MyGUI::EditBox::onMouseDrag ( int  _left,
int  _top,
MouseButton  _id 
) [protected, virtual]

Reimplemented from MyGUI::WidgetInput.

Definition at line 257 of file MyGUI_EditBox.cpp.

void MyGUI::EditBox::setCaption ( const UString _value) [virtual]

Set edit text applying tags

Reimplemented from MyGUI::TextBox.

Definition at line 1557 of file MyGUI_EditBox.cpp.

void MyGUI::EditBox::setCoord ( const IntCoord _value) [virtual]

Set widget position and size

Reimplemented from MyGUI::Widget.

Definition at line 1550 of file MyGUI_EditBox.cpp.

void MyGUI::EditBox::setCoord ( int  _left,
int  _top,
int  _width,
int  _height 
)

See Widget::setCoord(const IntCoord& _coord)

Reimplemented from MyGUI::Widget.

Definition at line 2165 of file MyGUI_EditBox.cpp.

void MyGUI::EditBox::setEditMultiLine ( bool  _value)

Enable or disable edit multiline mode
Multile mode: new line character moves text to new line.
Otherwise new lines replaced with space and all text is in single line.
Disabled (false) by default.

Definition at line 1933 of file MyGUI_EditBox.cpp.

void MyGUI::EditBox::setEditPassword ( bool  _value)

Enable or disable edit password mode
Password mode: you see password chars (*** by default) instead text.
Disabled (false) by default.

Definition at line 1158 of file MyGUI_EditBox.cpp.

void MyGUI::EditBox::setEditReadOnly ( bool  _value)

Enable or disable edit read only mode
Read only mode: you can't edit text, but can select it.
Disabled (false) by default.

Definition at line 1926 of file MyGUI_EditBox.cpp.

void MyGUI::EditBox::setEditStatic ( bool  _value)

Enable or disable edit static mode
Static mode is same as read only, but you also can't select text.
Disabled (false) by default.

Definition at line 1950 of file MyGUI_EditBox.cpp.

void MyGUI::EditBox::setEditWordWrap ( bool  _value)

Enable or disable edit word wrap mode
Word Wrap mode: move words to new line if they goes out of width. Also in this mode you can't edit or select text.
Disabled (false) by default.

Definition at line 1701 of file MyGUI_EditBox.cpp.

void MyGUI::EditBox::setFontHeight ( int  _value) [virtual]

Set widget text font height

Reimplemented from MyGUI::TextBox.

Definition at line 1720 of file MyGUI_EditBox.cpp.

void MyGUI::EditBox::setFontName ( const std::string &  _value) [virtual]

Set widget text font

Reimplemented from MyGUI::TextBox.

Definition at line 1710 of file MyGUI_EditBox.cpp.

void MyGUI::EditBox::setHScrollPosition ( size_t  _index)

Set current position of horizontal scroll

Definition at line 2019 of file MyGUI_EditBox.cpp.

void MyGUI::EditBox::setInvertSelected ( bool  _value)

Enable or disable inverting color of selected text
Enabled (true) by default

Definition at line 2041 of file MyGUI_EditBox.cpp.

void MyGUI::EditBox::setMaxTextLength ( size_t  _value)

Sets the max amount of text allowed in the edit field.

Definition at line 2105 of file MyGUI_EditBox.cpp.

void MyGUI::EditBox::setOnlyText ( const UString _value)

Set edit text without tags

Definition at line 1901 of file MyGUI_EditBox.cpp.

void MyGUI::EditBox::setOverflowToTheLeft ( bool  _value)

Sets if surplus characters should push characters off the left side rather than ignored.

Definition at line 2095 of file MyGUI_EditBox.cpp.

Set edit password character ('*' by default)

Definition at line 1499 of file MyGUI_EditBox.cpp.

void MyGUI::EditBox::setPasswordChar ( const UString _char)

Set edit password character ('*' by default). First character of string used.

Definition at line 1964 of file MyGUI_EditBox.cpp.

void MyGUI::EditBox::setPosition ( const IntPoint _value) [virtual]

Set widget position (position of left top corner)

Reimplemented from MyGUI::Widget.

Definition at line 1526 of file MyGUI_EditBox.cpp.

void MyGUI::EditBox::setPosition ( int  _left,
int  _top 
)

See Widget::setPosition(const IntPoint& _pos)

Reimplemented from MyGUI::Widget.

Definition at line 2155 of file MyGUI_EditBox.cpp.

void MyGUI::EditBox::setPropertyOverride ( const std::string &  _key,
const std::string &  _value 
) [protected, virtual]

Reimplemented from MyGUI::TextBox.

Reimplemented in MyGUI::ComboBox.

Definition at line 2047 of file MyGUI_EditBox.cpp.

void MyGUI::EditBox::setSize ( const IntSize _value) [virtual]

Set widget size

Reimplemented from MyGUI::Widget.

Definition at line 1543 of file MyGUI_EditBox.cpp.

void MyGUI::EditBox::setSize ( int  _width,
int  _height 
)

See Widget::setSize(const IntSize& _size)

Reimplemented from MyGUI::Widget.

Definition at line 2160 of file MyGUI_EditBox.cpp.

void MyGUI::EditBox::setTabPrinting ( bool  _value)

Enable or disable tab printing mode
Tab printing mode: when editing text and pressing Tab key it displayed. If this mode disabled Tab key ignored.
Disabled (false) by default.

Definition at line 2145 of file MyGUI_EditBox.cpp.

void MyGUI::EditBox::setTextAlign ( Align  _value) [virtual]

Set widget text align

Reimplemented from MyGUI::TextBox.

Definition at line 1598 of file MyGUI_EditBox.cpp.

void MyGUI::EditBox::setTextColour ( const Colour _value) [virtual]

Set widget text colour

Reimplemented from MyGUI::TextBox.

Definition at line 1609 of file MyGUI_EditBox.cpp.

void MyGUI::EditBox::setTextCursor ( size_t  _index)

Set text cursor position

Definition at line 819 of file MyGUI_EditBox.cpp.

void MyGUI::EditBox::setTextIntervalColour ( size_t  _start,
size_t  _count,
const Colour _colour 
)

Colour interval

Definition at line 1866 of file MyGUI_EditBox.cpp.

void MyGUI::EditBox::setTextSelection ( size_t  _start,
size_t  _end 
)

Set selected text interval

Parameters:
_startof interval
_endof interval

Definition at line 840 of file MyGUI_EditBox.cpp.

Colour selected text

Definition at line 1891 of file MyGUI_EditBox.cpp.

void MyGUI::EditBox::setTextShadow ( bool  _value) [virtual]

Set widget text shadow

Reimplemented from MyGUI::TextBox.

Definition at line 2199 of file MyGUI_EditBox.cpp.

void MyGUI::EditBox::setTextShadowColour ( const Colour _value) [virtual]

Set widget text shadow colour

Reimplemented from MyGUI::TextBox.

Definition at line 2191 of file MyGUI_EditBox.cpp.

void MyGUI::EditBox::setVisibleHScroll ( bool  _value)

Show HScroll when text size larger than EditBox

Definition at line 1976 of file MyGUI_EditBox.cpp.

void MyGUI::EditBox::setVisibleVScroll ( bool  _value)

Show VScroll when text size larger than EditBox

Definition at line 1970 of file MyGUI_EditBox.cpp.

void MyGUI::EditBox::setVScrollPosition ( size_t  _index)

Set current position of vertical scroll

Definition at line 1992 of file MyGUI_EditBox.cpp.

void MyGUI::EditBox::shutdownOverride ( ) [protected, virtual]

Reimplemented from MyGUI::Widget.

Reimplemented in MyGUI::ComboBox.

Definition at line 125 of file MyGUI_EditBox.cpp.

void MyGUI::EditBox::updateView ( ) [protected]

Definition at line 1730 of file MyGUI_EditBox.cpp.

Definition at line 1736 of file MyGUI_EditBox.cpp.


Field Documentation

Event : Enter pressed (Ctrl+enter in multiline mode).
signature : void method(MyGUI::EditBox* _sender)

Parameters:
_senderwidget that called this event

Definition at line 259 of file MyGUI_EditBox.h.

Event : Text changed.
signature : void method(MyGUI::EditBox* _sender)

Parameters:
_senderwidget that called this event

Definition at line 266 of file MyGUI_EditBox.h.

Definition at line 364 of file MyGUI_EditBox.h.

Definition at line 395 of file MyGUI_EditBox.h.

Definition at line 400 of file MyGUI_EditBox.h.

Definition at line 362 of file MyGUI_EditBox.h.

size_t MyGUI::EditBox::mCursorPosition [protected]

Definition at line 367 of file MyGUI_EditBox.h.

float MyGUI::EditBox::mCursorTimer [protected]

Definition at line 363 of file MyGUI_EditBox.h.

size_t MyGUI::EditBox::mEndSelect [protected]

Definition at line 373 of file MyGUI_EditBox.h.

bool MyGUI::EditBox::mIsFocus [protected]

Definition at line 360 of file MyGUI_EditBox.h.

bool MyGUI::EditBox::mIsPressed [protected]

Definition at line 358 of file MyGUI_EditBox.h.

size_t MyGUI::EditBox::mMaxTextLength [protected]

Definition at line 398 of file MyGUI_EditBox.h.

Definition at line 383 of file MyGUI_EditBox.h.

Definition at line 382 of file MyGUI_EditBox.h.

Definition at line 381 of file MyGUI_EditBox.h.

bool MyGUI::EditBox::mModeStatic [protected]

Definition at line 384 of file MyGUI_EditBox.h.

Definition at line 385 of file MyGUI_EditBox.h.

Definition at line 379 of file MyGUI_EditBox.h.

std::string MyGUI::EditBox::mOriginalPointer [protected]

Definition at line 393 of file MyGUI_EditBox.h.

Definition at line 397 of file MyGUI_EditBox.h.

Definition at line 390 of file MyGUI_EditBox.h.

size_t MyGUI::EditBox::mStartSelect [protected]

Definition at line 372 of file MyGUI_EditBox.h.

bool MyGUI::EditBox::mTabPrinting [protected]

Definition at line 387 of file MyGUI_EditBox.h.

size_t MyGUI::EditBox::mTextLength [protected]

Definition at line 369 of file MyGUI_EditBox.h.

Definition at line 377 of file MyGUI_EditBox.h.

Definition at line 376 of file MyGUI_EditBox.h.


The documentation for this class was generated from the following files: