Pyro higlevel API
Public Types | Public Member Functions | Friends | List of all members
os::TextView Class Reference
Inheritance diagram for os::TextView:
os::Control os::View os::Invoker os::Handler os::DropdownMenu::DropdownTextView

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< Stringbuffer_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 More...
 
 ~TextView ()
 
virtual void MouseMove (const Point &cNewPos, int nCode, uint32 nButtons, Message *pcData)
 Hook called by the system when the mouse is moved. More...
 
virtual void MouseDown (const Point &cPosition, uint32 nButtons)
 Hook called by the system when a mouse button is pressed. More...
 
virtual void MouseUp (const Point &cPosition, uint32 nButtons, Message *pcData)
 Hook called by the system when a mouse button is release. More...
 
virtual void WheelMoved (const Point &cDelta)
 Hook called by the system when the scroll-wheel is rotated. More...
 
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. More...
 
virtual void LabelChanged (const String &cNewLabel)
 
virtual void EnableStatusChanged (bool bIsEnabled)
 
virtual bool Invoked (Message *pcMessage)
 Intercept outgoing messages. More...
 
virtual void Activated (bool bIsActive)
 Hook called when the view gain or loose focus. More...
 
virtual void SetValue (Variant cValue, bool bInvoke=true)
 
virtual Variant GetValue () const
 
const ViewGetEditor () const
 Get a pointer to the editor view. More...
 
void SetMultiLine (bool bMultiLine=true)
 Enable/disable the TextView. More...
 
bool GetMultiLine () const
 Get the current editor mode. More...
 
void SetPasswordMode (bool bPassword=true)
 Disable/enable password mode. More...
 
bool GetPasswordMode () const
 Get the current echo mode. More...
 
void SetNumeric (bool bNumeric)
 Set the view in "numeric" mode. More...
 
bool GetNumeric () const
 Check if the view is in numeric mode. More...
 
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_typeGetBuffer () const
 
virtual void SetTabOrder (int nOrder)
 Set the keyboard manouvering sorting order. More...
 
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. More...
 
virtual void FrameSized (const Point &cDelta)
 Virtual hook called by the system when the view is resized. More...
 
virtual void Paint (const Rect &cUpdateRect)
 Called by the system update "damaged" areas of the view. More...
 
- Public Member Functions inherited from os::Control
 Control (const Rect &cFrame, const String &cName, const String &cLabel, Message *pcMessage, uint32 nResizeMask, uint32 nFlags=WID_WILL_DRAW|WID_CLEAR_BACKGROUND)
 
 ~Control ()
 
virtual void AttachedToWindow (void)
 
virtual void DetachedFromWindow (void)
 
virtual bool PreValueChange (Variant *pcNewValue)
 
virtual void PostValueChange (const Variant &cNewValue)
 
virtual void SetEnable (bool bEnabled)
 
virtual bool IsEnabled (void) const
 
virtual void SetLabel (const String &cLabel)
 
virtual String GetLabel (void) const
 
virtual void __CTRL_reserved1__ ()
 
virtual void __CTRL_reserved2__ ()
 
virtual void __CTRL_reserved3__ ()
 
virtual void __CTRL_reserved4__ ()
 
virtual void __CTRL_reserved5__ ()
 
- Public Member Functions inherited from os::View
 View (const Rect &cFrame, const String &cTitle, uint32 nResizeMask=CF_FOLLOW_LEFT|CF_FOLLOW_TOP, uint32 nFlags=WID_WILL_DRAW|WID_CLEAR_BACKGROUND)
 View constructor. More...
 
virtual ~View ()
 View destructor. More...
 
virtual void AllAttached ()
 
virtual void AllDetached ()
 
virtual void WindowActivated (bool bIsActive)
 Hook called when the window hosting this view gain or loose focus. More...
 
virtual void KeyUp (const char *pzString, const char *pzRawString, uint32 nQualifiers)
 Hook called by the system when a key is released while the view has focus. More...
 
virtual void FrameMoved (const Point &cDelta)
 Virtual hook called by the system when the view is moved within it's parent. More...
 
virtual void ViewScrolled (const Point &cDelta)
 Virtual hook called by the system when the view content is scrolled. More...
 
virtual Point GetContentSize () const
 
virtual void AddChild (View *pcView, bool bAssignTabOrder=false)
 
void RemoveChild (View *pcChild)
 
void RemoveThis ()
 
ViewGetChildAt (const Point &cPos) const
 
ViewGetChildAt (int nIndex) const
 
ViewGetParent () const
 
ScrollBarGetVScrollBar () const
 
ScrollBarGetHScrollBar () const
 
WindowGetWindow () const
 
String GetTitle () const
 
virtual int GetTabOrder () const
 Get the keybord manouvering order. More...
 
virtual const ShortcutKeyGetShortcut () const
 
virtual void SetShortcut (const ShortcutKey &cShortcut)
 Set keyboard shortcut. More...
 
virtual void SetShortcutFromLabel (const String &cLabel)
 Set keyboard shortcut from Label. More...
 
void SetContextMenu (Menu *pcMenu)
 Set popup menu for a View. More...
 
MenuGetContextMenu () const
 Get popup menu. More...
 
uint32 GetQualifiers () const
 
void GetMouse (Point *pcPosition, uint32 *pnButtons) const
 
void SetMousePos (const Point &cPosition)
 
void BeginDrag (Message *pcData, const Point &cOffset, const Bitmap *pcBitmap, Handler *pcReplyTarget=NULL)
 Start a drag and drop operation. More...
 
void BeginDrag (Message *pcData, const Point &cOffset, const Rect &cBounds, Handler *pcReplyTarget=NULL)
 Start a drag and drop operation. More...
 
void SetFlags (uint32 nFlags)
 
uint32 GetFlags (uint32 nMask=~0L) const
 
void SetResizeMask (uint32 nFlags)
 
uint32 GetResizeMask () const
 
void Show (bool bVisible=true)
 Show/hide a view and all it's children. More...
 
void Hide ()
 
bool IsVisible () const
 
virtual void MakeFocus (bool bFocus=true)
 
virtual bool HasFocus () const
 
Rect GetFrame () const
 
Rect GetBounds () const
 
Rect GetNormalizedBounds () const
 
float Width () const
 
float Height () const
 
Point GetLeftTop () const
 
virtual void SetFrame (const Rect &cRect, bool bNotifyServer=true)
 Set the size and position relative to the parent view. More...
 
virtual void MoveBy (const Point &cDelta)
 Move the view within the parent coordinate system. More...
 
virtual void MoveBy (float vDeltaX, float vDeltaY)
 
virtual void MoveTo (const Point &cPos)
 Set the views position within the parent coordinate system. More...
 
virtual void MoveTo (float x, float y)
 
virtual void ResizeBy (const Point &cDelta)
 
virtual void ResizeBy (float vDeltaW, float vDeltaH)
 
virtual void ResizeTo (const Point &cSize)
 Set a new absolute size for the view. More...
 
virtual void ResizeTo (float W, float H)
 Set a new absolute size for the view. More...
 
void SetDrawingRegion (const Region &cReg)
 Restrict rendering using a clipping region. More...
 
void ClearDrawingRegion ()
 Remove any previously assigned drawing region. More...
 
void SetShapeRegion (const Region &cReg)
 Define a non-square shape for the view. More...
 
void ClearShapeRegion ()
 Remove any previously assigned shape region. More...
 
virtual int ToggleDepth ()
 
Point ConvertFromParent (const Point &cPoint) const
 
void ConvertFromParent (Point *cPoint) const
 
Rect ConvertFromParent (const Rect &cRect) const
 
void ConvertFromParent (Rect *cRect) const
 
Point ConvertToWindow (const Point &cPoint) const
 
void ConvertToWindow (Point *cPoint) const
 
Rect ConvertToWindow (const Rect &cRect) const
 
void ConvertToWindow (Rect *cRect) const
 
Point ConvertFromWindow (const Point &cPoint) const
 
void ConvertFromWindow (Point *cPoint) const
 
Rect ConvertFromWindow (const Rect &cRect) const
 
void ConvertFromWindow (Rect *cRect) const
 
Point ConvertToScreen (const Point &cPoint) const
 
void ConvertToScreen (Point *cPoint) const
 
Rect ConvertToScreen (const Rect &cRect) const
 
void ConvertToScreen (Rect *cRect) const
 
Point ConvertFromScreen (const Point &cPoint) const
 
void ConvertFromScreen (Point *cPoint) const
 
Rect ConvertFromScreen (const Rect &cRect) const
 
void ConvertFromScreen (Rect *cRect) const
 
void Invalidate (const Rect &cRect, bool bRecurse=false)
 Add a rectangle to the damage list. More...
 
void Invalidate (bool bRecurse=false)
 Invalidate the whole view. More...
 
void Flush ()
 Flush the render queue. More...
 
void Sync ()
 Flush the render queue. More...
 
void SetDrawingMode (drawing_mode nMode)
 
drawing_mode GetDrawingMode () const
 
void SetFont (Font *pcFont)
 Change the views text font. More...
 
FontGetFont () const
 
void SetFgColor (int nRed, int nGreen, int nBlue, int nAlpha=255)
 
void SetFgColor (Color32_s sColor)
 
Color32_s GetFgColor () const
 
void SetBgColor (int nRed, int nGreen, int nBlue, int nAlpha=255)
 
void SetBgColor (Color32_s sColor)
 
Color32_s GetBgColor () const
 
void SetEraseColor (int nRed, int nGreen, int nBlue, int nAlpha=255)
 
void SetEraseColor (Color32_s sColor)
 
Color32_s GetEraseColor () const
 
void MovePenTo (const Point &cPos)
 
void MovePenTo (float x, float y)
 
void MovePenBy (const Point &cPos)
 
void MovePenBy (float x, float y)
 
Point GetPenPosition () const
 Get the current pen position. More...
 
void DrawLine (const Point &cToPoint)
 
void DrawLine (const Point &cFromPnt, const Point &cToPnt)
 
virtual void ScrollBy (const Point &cDelta)
 
virtual void ScrollBy (float vDeltaX, float vDeltaY)
 
virtual void ScrollTo (Point cTopLeft)
 
virtual void ScrollTo (float x, float y)
 
Point GetScrollOffset () const
 
void ScrollRect (const Rect &cSrcRect, const Rect &cDstRect)
 Copy a rectangle from one location to another within the view. More...
 
void FillRect (const Rect &cRect)
 
void FillRect (const Rect &cRect, Color32_s sColor)
 
void DrawBitmap (const Bitmap *pcBitmap, const Rect &cSrcRect, const Rect &cDstRect)
 Render a bitmap into the view. More...
 
void EraseRect (const Rect &cRect)
 
void DrawFrame (const Rect &cRect, uint32 nFlags)
 
void DrawRoundedFrame (const os::Rect &cReizeFrame=os::Rect(1, 4,-1,-4), const os::Color32_s &cColor=get_default_color(COL_SHADOW))
 
void DrawRoundedFrame (const os::Rect &cFrame, const os::Rect &cReizeFrame=os::Rect(1, 4,-1,-4), const os::Color32_s &cColor=get_default_color(COL_SHADOW))
 
void DrawString (const Point &cPos, const String &cString)
 
void DrawString (const String &cString)
 Render a text-string at the current pen position. More...
 
void DrawString (const char *pzStr, int Len=-1)
 
void DrawText (const Rect &cPos, const String &cString, uint32 nFlags=0)
 Render a text-string in a specified rectangle. More...
 
void DrawSelectedText (const Rect &cPos, const String &cString, const IPoint &cSel1, const IPoint &cSel2, uint32 nMode=SEL_CHAR, uint32 nFlags=0)
 
void GetSelection (const String &cClipboard="__system_clipboard__")
 
void GetTruncatedStrings (const char **pazStringArray, int nStringCount, uint32 nMode, float nWidth, char **pazResultArray) const
 
float GetStringWidth (const String &cString) const
 
float GetStringWidth (const char *pzString, int nLen=-1) const
 
void GetStringWidths (const char **apzStringArray, const int *anLengthArray, int nStringCount, float *avWidthArray) const
 
Point GetTextExtent (const String &cString, uint32 nFlags=0, int nTargetWidth=-1) const
 
int GetStringLength (const String &cString, float vWidth, bool bIncludeLast=false) const
 
int GetStringLength (const char *pzString, int nLen, float vWidth, bool bIncludeLast=false) const
 
void GetStringLengths (const char **apzStringArray, const int *anLengthArray, int nStringCount, float vWidth, int *anMaxLengthArray, bool bIncludeLast=false) const
 
void GetFontHeight (font_height *psHeight) const
 
void Ping (int nSize=0) const
 
void SetToolTip (const os::String &t)
 
os::String GetToolTip () const
 
Point ConvertToParent (const Point &cPoint) const
 Translate a os::Point into our parents coordinate system. More...
 
void ConvertToParent (Point *cPoint) const
 Translate a os::Point into our parents coordinate system. More...
 
Rect ConvertToParent (const Rect &cRect) const
 
void ConvertToParent (Rect *cRect) const
 
- Public Member Functions inherited from os::Handler
 Handler (const String &cName)
 Construct a handler. More...
 
virtual ~Handler ()
 Destructor. More...
 
virtual void TimerTick (int nID)
 Timer dispatch member. More...
 
virtual void HandleMessage (Message *pcMessage)
 Handle a message targeted at this handler. More...
 
String GetName () const
 Get the handlers name. More...
 
void SetName (const String &cName)
 Rename the handler. More...
 
LooperGetLooper () const
 Get a pointer to the looper this handler belongs to. More...
 
void SetNextHandler (Handler *pcNextHandler)
 Set a handler that should handle messages this handler is not interrested in. More...
 
HandlerGetNextHandler () const
 Get the next handler in a handler chain. More...
 
void AddFilter (MessageFilter *pcFilter)
 
void RemoveFilter (MessageFilter *pcFilter)
 
const MsgFilterListGetFilterList () const
 
const uint32 GetToken ()
 Get the handlers token. More...
 
- Public Member Functions inherited from os::Invoker
 Invoker ()
 Default constructor. More...
 
 Invoker (Message *pcMessage)
 Constructor. More...
 
 Invoker (Message *pcMessage, const Handler *pcHandler, const Looper *pcLooper=NULL)
 Constructor. More...
 
 Invoker (Message *pcMessage, const Messenger &cTarget)
 Constructor. More...
 
virtual ~Invoker ()
 Destructor. More...
 
virtual status_t SetMessage (Message *pcMessage)
 Assign a new message to the invoker. More...
 
MessageGetMessage () const
 Get the message currently assigned to the invoker. More...
 
uint32 GetCode () const
 Get the code field from the currently assigned message. More...
 
virtual void TargetChanged (const Messenger &cOldTarget)
 Virtual hook called by the system after the target has been changed. More...
 
virtual void MessageChanged (const Message &cOldMsg)
 Virtual hook called by the system after the message has been changed. More...
 
virtual status_t SetTarget (const Handler *pcHandler, const Looper *pcLooper=NULL)
 Set a new message target. More...
 
virtual status_t SetTarget (const Messenger &cMessenger)
 Set a new message target. More...
 
bool IsTargetLocal () const
 Check if the target lives in our process. More...
 
HandlerGetTarget (Looper **ppcLooper=NULL) const
 Get the current target. More...
 
Messenger GetMessenger () const
 Get the messenger used to target messages sendt by the invoker. More...
 
virtual status_t SetHandlerForReply (Handler *pcHandler)
 Set a reply target for messages sendt by this messenger. More...
 
HandlerGetHandlerForReply () const
 Get the current reply target for replies on messages sendt by the invoker. More...
 
virtual status_t Invoke (Message *pcMessage=NULL)
 Send the current message to the current target. More...
 

Friends

class TextEdit
 

Detailed Description

Description:
See Also
Author
Kurt Skauen (kurt@.nosp@m.athe.nosp@m.os.cx)

Member Typedef Documentation

typedef std::vector<String> os::TextView::buffer_type

Member Enumeration Documentation

anonymous enum
Enumerator
EI_CONTENT_CHANGED 
EI_ENTER_PRESSED 
EI_ESC_PRESSED 
EI_FOCUS_LOST 
EI_CURSOR_MOVED 
EI_SELECTION_CHANGED 
EI_MAX_SIZE_REACHED 
EI_MAX_SIZE_LEFT 
EI_WAS_EDITED 

Constructor & Destructor Documentation

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 
)
Description:
The contructor will initialize the text view and set all properties to default values. See the documentaition of each Setxxx() members to see what the verious default values might be.
Parameters
cFramePassed on to the os::View constructor.
pzTitlePassed on to the os::View constructor (only used to identify the view. Newer rendered anywhere).
pzTextThe initial content of the TextView or NULL if the TextView should be empty.
nResizeMaskPassed on to the os::View constructor.
nFlagsPassed on to the os::View constructor.
See Also
os::View::View()
Author
Kurt Skauen (kurt@.nosp@m.athe.nosp@m.os.cx)

References os::View::AddChild(), os::CF_FOLLOW_NONE, os::View::GetBounds(), os::Rect::Resize(), Set(), and TextEdit.

TextView::~TextView ( )

Member Function Documentation

void TextView::Activated ( bool  bIsActive)
virtual
Description:
This is a callback member that can be overloaded by derived classes to learn when the view is activated and when it is deactivated. The bIsActive parameter tell whether the focus was lost or gained.
The view has focus when it is the active view in the active window.
Note:
This is a hook function that is called by the system to notify about an event. You should never call this member yourself.

The window is locked when this member is called.

Parameters
bIsActive- true if the view gain and false if it loose focus.
See Also
MakeFocus(), WindowActivated()
Author
Kurt Skauen (kurt@.nosp@m.athe.nosp@m.os.cx)

Reimplemented from os::View.

References os::TextEdit::Activated().

void TextView::Clear ( bool  bSendNotify = true)
void TextView::ClearSelection ( bool  bSendNotify = true)
void TextView::Copy ( )
void TextView::Cut ( bool  bSendNotify = true)
void TextView::Delete ( bool  bSendNotify = true)
void TextView::Delete ( const IPoint cStart,
const IPoint cEnd,
bool  bSendNotify = true 
)
void TextView::EnableStatusChanged ( bool  bIsEnabled)
virtual

Implements os::Control.

References os::TextEdit::SetEnable().

bool TextView::FilterKeyStroke ( const String pcString)
virtual
void TextView::FontChanged ( Font pcNewFont)
virtual
Description:
FontChanged() is a virtual hook function that can be overloaded by inheriting classes to track changes to the view's font.
This hook function is called whenver the font is replaced through the View::SetFont() member or if the currently assigned font is modified in a way that whould alter the graphical appearance of the font.
Note:
View::SetFont() will call FontChanged() syncronously and will cause FontChanged() to be called even if the view is not yet added to a window. Changes done to the font-object cause a message to be sendt to the window thread and FontChanged() will then be called asyncronously from the window thread when the message arrive. For this reason it is only possible to track changes done to the font object itself when the view is added to a window.
Parameters
pcNewFontPointer to the affected font (same as returned by GetFont()).
See Also
SetFont(), os::Font
Author
Kurt Skauen (kurt@.nosp@m.athe.nosp@m.os.cx)

Reimplemented from os::View.

References os::View::SetFont().

void TextView::FrameSized ( const Point cDelta)
virtual
Description:
Overload this member if you need to know when the view is resized.
Note:
This member is called after the view is resized. If you need the old size you can subtract the cDelta calue from the current size.
Parameters
cDeltaThe distance the bottom/right corner was moved relative to the upper/left corner.
See Also
FrameMoved(), SetFrame, ResizeBy(), ResizeTo()
Author
Kurt Skauen (kurt@.nosp@m.athe.nosp@m.os.cx)

Reimplemented from os::View.

References os::Rect::bottom, os::View::GetBounds(), os::View::GetFrame(), os::View::GetHScrollBar(), os::View::GetVScrollBar(), os::Rect::Height(), os::Rect::Resize(), os::Rect::right, os::View::SetFrame(), and os::Rect::Width().

const TextView::buffer_type & TextView::GetBuffer ( ) const
size_t TextView::GetCurrentLength ( ) const
void TextView::GetCursor ( int *  x,
int *  y 
) const
IPoint TextView::GetCursor ( ) const
const View * TextView::GetEditor ( ) const
Description:
The os::TextView class is only responsible for rendering the borders and controlling the scroll-bars. Everything else is handled by a child view crated by the constructor. The os::TextView class provide an interface to all the functionality of the internal editor but in some rare cases it might be useful to have a pointer to this child view.
Note:
In erlier version (before V0.3.3) the only way to change the font used by the text editor was to retrieve the editor and then set it's font manually. This is not neccessarry (and not possible) any longer. Setting the font on the os::TextView class itself will automatically be relected by the internal editor.
Returns
A const pointer to the internal editor.
Author
Kurt Skauen (kurt@.nosp@m.athe.nosp@m.os.cx)
uint32 TextView::GetEventMask ( ) const
size_t TextView::GetMaxLength ( ) const
IPoint TextView::GetMaxPreferredSize ( ) const
int TextView::GetMaxUndoSize ( ) const
IPoint TextView::GetMinPreferredSize ( ) const
bool TextView::GetMultiLine ( ) const
Returns
True if the view is in multiline mode, false if it is in singleline mode.
See Also
SetMultiLine()
Author
Kurt Skauen (kurt@.nosp@m.athe.nosp@m.os.cx)

References os::TextEdit::GetMultiLine().

bool TextView::GetNumeric ( ) const
Returns
True if numeric mode is enabled, false if it is disabled.
See Also
SetNumeric()
Author
Kurt Skauen (kurt@.nosp@m.athe.nosp@m.os.cx)

References os::TextEdit::GetNumeric().

bool TextView::GetPasswordMode ( ) const
Returns
True if the view is in password mode, false if not.
See Also
SetPasswordMode()
Author
Kurt Skauen (kurt@.nosp@m.athe.nosp@m.os.cx)

References os::TextEdit::GetPasswordMode().

Point TextView::GetPreferredSize ( bool  bLargest) const
virtual
bool TextView::GetReadOnly ( ) const
void TextView::GetRegion ( String pcBuffer) const
bool TextView::GetSelection ( IPoint pcStart = NULL,
IPoint pcEnd = NULL 
) const
Variant TextView::GetValue ( void  ) const
virtual

Reimplemented from os::Control.

References os::TextEdit::GetRegion().

void TextView::Insert ( const char *  pzBuffer,
bool  bSendNotify = true 
)
void TextView::Insert ( const IPoint cPos,
const char *  pzBuffer,
bool  bSendNotify = true 
)
bool TextView::Invoked ( Message pcMessage)
virtual
Description:
This member is called from Invoke() just before a message is sendt to the target.
This allow classes that inherits from os::Invoker to add data to or otherwhice modify the message before it is sendt. The message can also be canceled entirely by returning false from this member.
The message passed to Invoked() is a copy of the internal message or the message passed to Invoke() (if any) so any changes made here will not affect the internal message or the message passed to Invoke(). When this method returns the message will imidiatly be sendt to the target and then discarded (unless false is returned in which case the message is simply discarded).
The default implementation of this member does nothing and return true.
Parameters
pcMessagePointer to the message that is about to be sendt. You can do any modification you like to this message (but never delete it).
Returns
Normally you should return true to indicate that the message should be sendt. You can however return false if you for some reason want to cancel the invokation.
See Also
Invoke(), SetMessage(), SetTarget()
Author
Kurt Skauen (kurt@.nosp@m.athe.nosp@m.os.cx)

Reimplemented from os::Control.

References os::Message::AddBool(), os::Message::AddInt32(), EI_CURSOR_MOVED, EI_ENTER_PRESSED, EI_FOCUS_LOST, os::TextEdit::m_cCsrPos, os::TextEdit::m_cPrevCursorPos, os::TextEdit::m_nEventMask, and os::TextEdit::m_nPendingEvents.

void TextView::KeyDown ( const char *  pzString,
const char *  pzRawString,
uint32  nQualifiers 
)
virtual
Description:
Overload this member if your view need to handle keyboard input. This member is called to allow the view to handle M_KEY_DOWN messages. The most common members are exctracted from the message and passed as parameters but you might need to obtain the raw message with os::Looper::GetCurrentMessage() and find some members yourself if you the data you needed are not passed in.
For example if you need the raw key-code for the pressed key you will have to lookup the "_raw_key" member from the message.
Parameters
pzStringString 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.
pzRawStringSame 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'.
nQualifiersBitmask describing which qualifiers that was active when the key was pressed.
See Also
KeyUp(), os::Looper::GetCurrentMessage()
Author
Kurt Skauen (kurt@.nosp@m.athe.nosp@m.os.cx)

Reimplemented from os::View.

Reimplemented in os::DropdownMenu::DropdownTextView.

References os::TextEdit::HandleKeyDown(), and os::View::KeyDown().

void TextView::LabelChanged ( const String cNewLabel)
virtual

Reimplemented from os::Control.

void TextView::MakeCsrVisible ( )
void TextView::MouseDown ( const Point cPosition,
uint32  nButtons 
)
virtual
Description:
This member is called from the window thread whenever a mouse button is clicked above the view. You can overload this member if your view need to know about mouse-down events.
A view will not automatically take focus when clicked so if you want that behaviour you must call MakeFocus() from an overloaded version of this member.
The default implementation of this member will call MouseDown() on it's parent view if one exists.
Parameters
cPositionMouse position in the views coordinate system at the time the mouse was pressed.
nButtonsIndex 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.
See Also
MouseUp(), MouseMove(), WheelMoved()
Author
Kurt Skauen (kurt@.nosp@m.athe.nosp@m.os.cx)

Reimplemented from os::View.

References os::View::MouseDown().

void TextView::MouseMove ( const Point cNewPos,
int  nCode,
uint32  nButtons,
Message pcData 
)
virtual
Description:
This member is called from the window thread whenever the mouse is moved above the view or if the view has focus.
Oveload this member if your view need to handle mouse-move events.
The default implementation of this member will call MouseMove() on it's parent view if one exists.
Parameters
cNewPosNew mouse position given in the views coordinate system.
nCodeEnter/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).
nButtonsBitmask 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.
pcDataPointer 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.
See Also
MouseDown(), MouseUp(), WheelMoved(), BeginDrag()
Author
Kurt Skauen (kurt@.nosp@m.athe.nosp@m.os.cx)

Reimplemented from os::View.

References os::View::MouseMove().

void TextView::MouseUp ( const Point cPosition,
uint32  nButtons,
Message pcData 
)
virtual
Description:
This member is called from the window thread whenever a mouse button is released above the view. You can overload this member if your view need to know about mouse-up events or if your view support drag and drop.
If mouse-up was the result of ending a drag and drop operation the 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.
The default implementation of this member will call MouseDown() on it's parent view if one exists.
Parameters
cPositionMouse position in the views coordinate system at the time the mouse was pressed.
nButtonsIndex 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.
pcDataPointer 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.
See Also
MouseDown(), MouseMove(), WheelMoved()
Author
Kurt Skauen (kurt@.nosp@m.athe.nosp@m.os.cx)

Reimplemented from os::View.

References os::View::MouseUp().

void TextView::Paint ( const Rect cUpdateRect)
virtual
Description:
Note:
Warning:
Parameters
cUpdateRectA 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.
See Also
Invalidate(), Flush()
Author
Kurt Skauen (kurt@.nosp@m.athe.nosp@m.os.cx)

Reimplemented from os::View.

References os::COL_NORMAL, os::View::DrawFrame(), os::FRAME_RECESSED, os::get_default_color(), os::View::GetBounds(), and os::View::SetEraseColor().

void TextView::Paste ( bool  bSendNotify = true)
void TextView::Redo ( void  )

References os::TextEdit::Redo().

void TextView::Select ( const IPoint cStart,
const IPoint cEnd,
bool  bSendNotify = true 
)
void TextView::SelectAll ( bool  bSendNotify = true)
void TextView::Set ( const char *  pzBuffer,
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::SetEventMask ( uint32  nMask)
void TextView::SetMaxLength ( size_t  nMaxLength)
void TextView::SetMaxPreferredSize ( int  nWidthChars,
int  nHeightChars 
)
void TextView::SetMaxUndoSize ( int  nSize)
void TextView::SetMinPreferredSize ( int  nWidthChars,
int  nHeightChars 
)
void TextView::SetMultiLine ( bool  bMultiLine = true)
Description:
When disabled the TextView will not accept any user input and the text will be dark-gray on a light-gray background to indicate that that it is disabled.
Parameters
bEnabledIf true the view will be enabled if false it will be disabled.
See Also
IsEnabled()
Author
Kurt Skauen (kurt@.nosp@m.athe.nosp@m.os.cx) Get the enabled state of the view
Returns
True if the view is enabled, false if the view is disabled.
Error codes:
See Also
SetEnable()
Author
Kurt Skauen (kurt@.nosp@m.athe.nosp@m.os.cx) Enable/disable multiline mode.
Description:
The TextView have two quite different modes. Multiline and single line.

In singleline mode it will only allow a single line of text and it will send the EI_ENTER_PRESSED event (if not masked out) when the user press <ENTER> or <RETURN>. It will also always center the single line vertically inside the views boundary and it will never display scroll bars.

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.

Parameters
bMultiLineTrue to set the view in multiline mode or false to set it in singleline mode.
See Also
GetMultiLine(), SetEventMask(), SetPasswordMode()
Author
Kurt Skauen (kurt@.nosp@m.athe.nosp@m.os.cx)

References os::TextEdit::GetMultiLine(), and os::TextEdit::SetMultiLine().

void TextView::SetNumeric ( bool  bNumeric)
Description:
When numeric mode is enabled the TextView will only accept valid numbers to be typed.

Digits are always accepted. Punctuation (.) is accepted once. "E" is accepted once. Plus and minus (+/-) is accepted as the first character of the line or as the first character after an "E".

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.

Parameters
bNumericTrue to enable numeric mode, false to disable it.
See Also
GetNumeric(), FilterKeyStroke()
Author
Kurt Skauen (kurt@.nosp@m.athe.nosp@m.os.cx)

References os::TextEdit::SetNumeric().

Referenced by os::InputBox::Private::SetNumeric(), and os::Spinner::Spinner().

void TextView::SetPasswordMode ( bool  bPassword = true)
Description:
When setting the view in password mode it will render all characters as asterics (*) to hide it's content and it will not allow the user to copy the content to the clipboard.
Note:
Only single-line TextView's should be set in password mode.
Parameters
bPasswordTrue to enable password mode, false to disable it.
See Also
GetPasswordMode(), SetMultiLine()
Author
Kurt Skauen (kurt@.nosp@m.athe.nosp@m.os.cx)

References os::TextEdit::SetPasswordMode().

void TextView::SetReadOnly ( bool  bFlag = true)
void TextView::SetTabOrder ( int  nOrder)
virtual
Description:
Set the value that will be returned by GetTabOrder().
Parameters
nOrder- The sorting order.
See Also
GetTabOrder()
Author
Kurt Skauen (kurt@.nosp@m.athe.nosp@m.os.cx)

Reimplemented from os::View.

References os::View::SetTabOrder().

Referenced by os::InputBox::Private::Layout(), os::Spinner::SetTabOrder(), and os::DropdownMenu::SetTabOrder().

void TextView::SetValue ( Variant  cValue,
bool  bInvoke = true 
)
virtual
void TextView::Undo ( void  )

References os::TextEdit::Undo().

void TextView::WheelMoved ( const Point cDelta)
virtual
Description:
This member is called from the window thread whenever the user rotates the scroll wheel with the mouse pointer above this view.
The default implementation of this member will call WheelMoved() on it's parent view if one exists.
Since
V0.3.7
Parameters
cDeltaDelta 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.
See Also
MouseMove(), MouseDown(), MouseUp()
Author
Kurt Skauen (kurt@.nosp@m.athe.nosp@m.os.cx)

Reimplemented from os::View.

References os::View::GetVScrollBar(), os::ScrollBar::WheelMoved(), and os::View::WheelMoved().

Friends And Related Function Documentation

friend class TextEdit
friend

Referenced by TextView().