Inheritance diagram for os::TextView:
Public Types | |
enum | { EI_CONTENT_CHANGED = 0x0001, EI_ENTER_PRESSED = 0x0002, EI_ESC_PRESSED = 0x0004, EI_FOCUS_LOST = 0x0008, EI_CURSOR_MOVED = 0x0010, EI_SELECTION_CHANGED = 0x0020, EI_MAX_SIZE_REACHED = 0x0040, EI_MAX_SIZE_LEFT = 0x0080, EI_WAS_EDITED = 0x0100 } |
typedef std::vector< String > | buffer_type |
Public Member Functions | |
TextView (const Rect &cFrame, const String &cTitle, const char *pzBuffer, uint32 nResizeMask=CF_FOLLOW_LEFT|CF_FOLLOW_TOP, uint32 nFlags=WID_WILL_DRAW|WID_FULL_UPDATE_ON_RESIZE) | |
os::TextView constructor | |
~TextView () | |
virtual void | MouseMove (const Point &cNewPos, int nCode, uint32 nButtons, Message *pcData) |
Hook called by the system when the mouse is moved. | |
virtual void | MouseDown (const Point &cPosition, uint32 nButtons) |
Hook called by the system when a mouse button is pressed. | |
virtual void | MouseUp (const Point &cPosition, uint32 nButtons, Message *pcData) |
Hook called by the system when a mouse button is release. | |
virtual void | WheelMoved (const Point &cDelta) |
Hook called by the system when the scroll-wheel is rotated. | |
virtual void | KeyDown (const char *pzString, const char *pzRawString, uint32 nQualifiers) |
Hook called by the system when a key is pressed while the view has focus. | |
virtual void | LabelChanged (const String &cNewLabel) |
virtual void | EnableStatusChanged (bool bIsEnabled) |
virtual bool | Invoked (Message *pcMessage) |
Intercept outgoing messages. | |
virtual void | Activated (bool bIsActive) |
Hook called when the view gain or loose focus. | |
virtual void | SetValue (Variant cValue, bool bInvoke=true) |
virtual Variant | GetValue () const |
const View * | GetEditor () const |
Get a pointer to the editor view. | |
void | SetMultiLine (bool bMultiLine=true) |
Enable/disable multiline mode. | |
bool | GetMultiLine () const |
Get the current editor mode. | |
void | SetPasswordMode (bool bPassword=true) |
Disable/enable password mode. | |
bool | GetPasswordMode () const |
Get the current echo mode. | |
void | SetNumeric (bool bNumeric) |
Set the view in "numeric" mode. | |
bool | GetNumeric () const |
Check if the view is in numeric mode. | |
void | SetReadOnly (bool bFlag=true) |
bool | GetReadOnly () const |
int | GetMaxUndoSize () const |
void | SetMaxUndoSize (int nSize) |
uint32 | GetEventMask () const |
void | SetEventMask (uint32 nMask) |
void | GetRegion (String *pcBuffer) const |
void | SetMinPreferredSize (int nWidthChars, int nHeightChars) |
IPoint | GetMinPreferredSize () const |
void | SetMaxPreferredSize (int nWidthChars, int nHeightChars) |
IPoint | GetMaxPreferredSize () const |
void | MakeCsrVisible () |
void | Clear (bool bSendNotify=true) |
void | Set (const char *pzBuffer, bool bSendNotify=true) |
void | Insert (const char *pzBuffer, bool bSendNotify=true) |
void | Insert (const IPoint &cPos, const char *pzBuffer, bool bSendNotify=true) |
void | Select (const IPoint &cStart, const IPoint &cEnd, bool bSendNotify=true) |
void | SelectAll (bool bSendNotify=true) |
void | ClearSelection (bool bSendNotify=true) |
bool | GetSelection (IPoint *pcStart=NULL, IPoint *pcEnd=NULL) const |
void | SetCursor (int x, int y, bool bSelect=false, bool bSendNotify=true) |
void | SetCursor (const IPoint &cPos, bool bSelect=false, bool bSendNotify=true) |
void | GetCursor (int *x, int *y) const |
IPoint | GetCursor () const |
void | SetMaxLength (size_t nMaxLength) |
size_t | GetMaxLength () const |
size_t | GetCurrentLength () const |
void | Cut (bool bSendNotify=true) |
void | Copy () |
void | Paste (bool bSendNotify=true) |
void | Delete (bool bSendNotify=true) |
void | Delete (const IPoint &cStart, const IPoint &cEnd, bool bSendNotify=true) |
void | Undo () |
void | Redo () |
const buffer_type & | GetBuffer () const |
virtual void | SetTabOrder (int nOrder) |
Set the keyboard manouvering sorting order. | |
virtual Point | GetPreferredSize (bool bLargest) const |
virtual bool | FilterKeyStroke (const String *pcString) |
virtual void | FontChanged (Font *pcNewFont) |
Called to notify the view that the font has changed. | |
virtual void | FrameSized (const Point &cDelta) |
Virtual hook called by the system when the view is resized. | |
virtual void | Paint (const Rect &cUpdateRect) |
Called by the system update "damaged" areas of the view. | |
Friends | |
class | TextEdit |
typedef std::vector<String> os::TextView::buffer_type |
anonymous enum |
TextView::TextView | ( | const Rect & | cFrame, | |
const String & | cTitle, | |||
const char * | pzText, | |||
uint32 | nResizeMask = CF_FOLLOW_LEFT | CF_FOLLOW_TOP , |
|||
uint32 | nFlags = WID_WILL_DRAW | WID_FULL_UPDATE_ON_RESIZE | |||
) |
cFrame | Passed on to the os::View constructor. | |
pzTitle | Passed on to the os::View constructor (only used to identify the view. Newer rendered anywhere). | |
pzText | The initial content of the TextView or NULL if the TextView should be empty. | |
nResizeMask | Passed on to the os::View constructor. | |
nFlags | Passed on to the os::View constructor. |
TextView::~TextView | ( | ) |
void TextView::MouseMove | ( | const Point & | cNewPos, | |
int | nCode, | |||
uint32 | nButtons, | |||
Message * | pcData | |||
) | [virtual] |
cNewPos | New mouse position given in the views coordinate system. | |
nCode | Enter/exit code. This is MOUSE_ENTERED when the mouse first enter the view, MOUSE_EXITED when the mouse leaves the view, MOUSE_INSIDE whenever the mouse move withing the boundary of the view and MOUSE_OUTSIDE when the mouse move outside the view (will only happen if the view has focus). | |
nButtons | Bitmask telling which buttons that are currently pressed. Bit 0 is button 1 (left), bit 1 is button 2 (right), and bit 2 is button 3 (middle), and so on. | |
pcData | Pointer to a Message object containing the dragged data if the user is in the middle of a drag and drop operation. Otherwise this pointer is NULL. Look at BeginDrag() for a more detailed description of the drag and drop system. |
Reimplemented from os::View.
void TextView::MouseDown | ( | const Point & | cPosition, | |
uint32 | nButtons | |||
) | [virtual] |
cPosition | Mouse position in the views coordinate system at the time the mouse was pressed. | |
nButtons | Index of the pressed button. Buttons start at 1 for the left button, 2 for the right button, 3 for the middle button. Additional buttons might be supported by the mouse driver and will then be assigned numbers from 4 and up. |
Reimplemented from os::View.
pcData
member will point to a Message containing the dragged data. Look at BeginDrag() for a more detailed description of the drag and drop system. cPosition | Mouse position in the views coordinate system at the time the mouse was pressed. | |
nButtons | Index of the pressed button. Buttons start at 1 for the left button, 2 for the right button, 3 for the middle button. Additional buttons might be supported by the mouse driver and will then be assigned numbers from 4 and up. | |
pcData | Pointer to a Message object containing the dragged data if this mouse-up was the end of a drag and drop operation. If no data was dragged it will be NULL. |
Reimplemented from os::View.
void TextView::WheelMoved | ( | const Point & | cDelta | ) | [virtual] |
cDelta | Delta movement. Normally only the y value is used but it is possible for the mouse driver to also support horizontal scroll wheel functionality. The delta value is normally +/- 1.0 for each "click" on the wheel. |
Reimplemented from os::View.
void TextView::KeyDown | ( | const char * | pzString, | |
const char * | pzRawString, | |||
uint32 | nQualifiers | |||
) | [virtual] |
pzString | String containing a single UTF-8 encoded character. This is the character generated by the pressed key according to the current keymap accounting for any qualifiers that might be pressed. | |
pzRawString | Same as pzString except that the key is converted without accounting for qualifiers. Ie. if 'A' is pressed while pressing <SHIFT> pzString will contain 'A' and pzRawString will contain 'a'. | |
nQualifiers | Bitmask describing which qualifiers that was active when the key was pressed. |
Reimplemented from os::View.
Reimplemented in os::DropdownMenu::DropdownTextView.
void TextView::LabelChanged | ( | const String & | cNewLabel | ) | [virtual] |
Reimplemented from os::Control.
void TextView::EnableStatusChanged | ( | bool | bIsEnabled | ) | [virtual] |
Implements os::Control.
bool TextView::Invoked | ( | Message * | pcMessage | ) | [virtual] |
pcMessage | Pointer to the message that is about to be sendt. You can do any modification you like to this message (but never delete it). |
Reimplemented from os::Control.
void TextView::Activated | ( | bool | bIsActive | ) | [virtual] |
bIsActive | - true if the view gain and false if it loose focus. |
Reimplemented from os::View.
void TextView::SetValue | ( | Variant | cValue, | |
bool | bInvoke = true | |||
) | [virtual] |
Reimplemented from os::Control.
Variant TextView::GetValue | ( | ) | const [virtual] |
Reimplemented from os::Control.
const View * TextView::GetEditor | ( | ) | const |
void TextView::SetMultiLine | ( | bool | bMultiLine = true |
) |
In multiline mode it will allow multiple lines of text and <ENTER> and <RETURN> will insert a new line instead of trigging the EI_ENTER_PRESSED event. The view will automatically add and remove vertical and horizontal scroll-bars as needed.
bMultiLine | True to set the view in multiline mode or false to set it in singleline mode. |
bool TextView::GetMultiLine | ( | ) | const |
void TextView::SetPasswordMode | ( | bool | bPassword = true |
) |
bPassword | True to enable password mode, false to disable it. |
bool TextView::GetPasswordMode | ( | ) | const |
void TextView::SetNumeric | ( | bool | bNumeric | ) |
If you have other restrictions on what should be accepted as input (for example hexadecimal numbers) you can overload the FilterKeyStroke() hook and filter the user input yourself.
bNumeric | True to enable numeric mode, false to disable it. |
bool TextView::GetNumeric | ( | ) | const |
void TextView::SetReadOnly | ( | bool | bFlag = true |
) |
bool TextView::GetReadOnly | ( | ) | const |
int TextView::GetMaxUndoSize | ( | ) | const |
void TextView::SetMaxUndoSize | ( | int | nSize | ) |
uint32 TextView::GetEventMask | ( | ) | const |
void TextView::SetEventMask | ( | uint32 | nMask | ) |
void TextView::GetRegion | ( | String * | pcBuffer | ) | const |
void TextView::SetMinPreferredSize | ( | int | nWidthChars, | |
int | nHeightChars | |||
) |
IPoint TextView::GetMinPreferredSize | ( | ) | const |
void TextView::SetMaxPreferredSize | ( | int | nWidthChars, | |
int | nHeightChars | |||
) |
IPoint TextView::GetMaxPreferredSize | ( | ) | const |
void TextView::MakeCsrVisible | ( | ) |
void TextView::Clear | ( | bool | bSendNotify = true |
) |
void TextView::Set | ( | const char * | pzBuffer, | |
bool | bSendNotify = true | |||
) |
void TextView::Insert | ( | const char * | pzBuffer, | |
bool | bSendNotify = true | |||
) |
void TextView::Insert | ( | const IPoint & | cPos, | |
const char * | pzBuffer, | |||
bool | bSendNotify = true | |||
) |
void TextView::SelectAll | ( | bool | bSendNotify = true |
) |
void TextView::ClearSelection | ( | bool | bSendNotify = true |
) |
void TextView::SetCursor | ( | int | x, | |
int | y, | |||
bool | bSelect = false , |
|||
bool | bSendNotify = true | |||
) |
void TextView::SetCursor | ( | const IPoint & | cPos, | |
bool | bSelect = false , |
|||
bool | bSendNotify = true | |||
) |
void TextView::GetCursor | ( | int * | x, | |
int * | y | |||
) | const |
IPoint TextView::GetCursor | ( | ) | const |
void TextView::SetMaxLength | ( | size_t | nMaxLength | ) |
size_t TextView::GetMaxLength | ( | ) | const |
size_t TextView::GetCurrentLength | ( | ) | const |
void TextView::Cut | ( | bool | bSendNotify = true |
) |
void TextView::Copy | ( | ) |
void TextView::Paste | ( | bool | bSendNotify = true |
) |
void TextView::Delete | ( | bool | bSendNotify = true |
) |
void TextView::Undo | ( | ) |
void TextView::Redo | ( | ) |
const TextView::buffer_type & TextView::GetBuffer | ( | ) | const |
void TextView::SetTabOrder | ( | int | nOrder | ) | [virtual] |
nOrder | - The sorting order. |
Reimplemented from os::View.
bool TextView::FilterKeyStroke | ( | const String * | pcString | ) | [virtual] |
void TextView::FontChanged | ( | Font * | pcNewFont | ) | [virtual] |
pcNewFont | Pointer to the affected font (same as returned by GetFont()). |
Reimplemented from os::View.
void TextView::FrameSized | ( | const Point & | cDelta | ) | [virtual] |
cDelta
calue from the current size. cDelta | The distance the bottom/right corner was moved relative to the upper/left corner. |
Reimplemented from os::View.
void TextView::Paint | ( | const Rect & | cUpdateRect | ) | [virtual] |
cUpdateRect | A rectangle enclosing all damaged areas. This is just a rough "worst-case", further fine-grained clipping will be performed by the Application Server to avoid updating non-damaged pixels and make the update as fast and flicker-free as possible. |
Reimplemented from os::View.
friend class TextEdit [friend] |