os::TextEdit Class Reference

Inheritance diagram for os::TextEdit:

os::View os::Handler List of all members.

Public Types

enum  {
  UNDO_INSERT,
  UNDO_DELETE
}

Public Member Functions

 TextEdit (TextView *pcParent, const Rect &cFrame, const String &cTitle, uint32 nResizeMask=CF_FOLLOW_LEFT|CF_FOLLOW_TOP, uint32 nFlags=WID_WILL_DRAW|WID_CLEAR_BACKGROUND)
 ~TextEdit ()
void SetEnable (bool bEnabled=true)
bool IsEnabled () const
void SetMultiLine (bool bMultiLine)
bool GetMultiLine () const
void SetPasswordMode (bool bPassword)
bool GetPasswordMode () const
void SetNumeric (bool bNumeric)
bool GetNumeric () const
void SetReadOnly (bool bFlag)
bool GetReadOnly () const
uint32 GetEventMask () const
void SetEventMask (uint32 nMask)
int GetMaxUndoSize () const
void SetMaxUndoSize (int nSize)
void SetMinPreferredSize (int nWidthChars, int nHeightChars)
IPoint GetMinPreferredSize () const
void SetMaxPreferredSize (int nWidthChars, int nHeightChars)
IPoint GetMaxPreferredSize () const
void GetRegion (IPoint cStart, IPoint cEnd, String *pcBuffer, bool bAddToClipboard=true) const
void GetRegion (String *pcBuffer, bool bAddToClipboard=true) const
void MakeCsrVisible ()
void InsertString (IPoint *pcPos, const char *pzBuffer, bool bMakeUndo=true)
void Delete (IPoint cStart, IPoint cEnd, bool bMakeUndo=true)
void Delete ()
void Clear ()
void Select (const IPoint &cStart, const IPoint &cEnd)
void SelectAll ()
void ClearSelection ()
bool GetSelection (IPoint *pcStart, IPoint *pcEnd) const
void SetCursor (const IPoint &cPos, bool bSelect)
IPoint GetCursor () const
void SetMaxLength (size_t nMaxLength)
size_t GetMaxLength () const
size_t GetCurrentLength () const
const TextView::buffer_typeGetBuffer () const
virtual Point GetPreferredSize (bool bLargest) const
virtual void Activated (bool bIsActive)
 Hook called when the view gain or loose focus.
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.
void MouseMove (const Point &cNewPos, int nCode, uint32 nButtons, Message *pcData)
 Hook called by the system when the mouse is moved.
void MouseDown (const Point &cPosition, uint32 nButtons)
 Hook called by the system when a mouse button is pressed.
void MouseUp (const Point &cPosition, uint32 nButtons, Message *pcData)
 Hook called by the system when a mouse button is release.
bool HandleKeyDown (const char *pzString, const char *pzRawString, uint32 nQualifiers)
void UpdateBackBuffer ()
void CommitEvents ()
void DrawCursor (View *pcView=NULL, float vHOffset=0.0f, float vVOffset=0.0f)
float GetPixelPosX (const String &cString, int x)
float GetPixelPosY (int y)
int GetCharPosX (const String &cString, float vPos)
void MaybeDrawString (View *pcView, float vHOffset, const char *pzString, int nLength)
void RenderLine (View *pcView, int y, float vHOffset, float vVOffset, bool bClear=true)
void InsertChar (char nChar)
void MoveHoriz (int nDelta, bool bExpBlock)
void MoveVert (int nDelta, bool bExpBlock)
void MoveWord (bool bDirection, bool bExpBlock)
void RecalcPrefWidth ()
void AddUndoNode (UndoNode *psNode)
void Undo ()
void Redo ()
void InvalidateLines (int nFirst, int nLast)

Public Attributes

uint32 m_nEventMask
uint32 m_nPendingEvents
float m_vCsrGfxPos
font_height m_sFontHeight
float m_vGlyphHeight
IPoint m_cCsrPos
IPoint m_cPrevCursorPos
IPoint m_cRegionStart
IPoint m_cRegionEnd
bool m_bRegionActive
bool m_bMultiLine
bool m_bPassword
bool m_bReadOnly
bool m_bNumeric
bool m_bEnabled
bool m_bEnforceBackBuffer
bool m_bMouseDownSeen
bool m_bIBeamActive
TextView::buffer_type m_cBuffer
std::vector< float > m_cLineSizes
TextViewm_pcParent
Point m_cPreferredSize
std::list< UndoNode * > m_cUndoStack
std::list< UndoNode * >::iterator m_iUndoIterator
int m_nUndoMemSize
int m_nMaxUndoSize
IPoint m_cMinPreferredSize
IPoint m_cMaxPreferredSize
Color32_s m_sCurFgColor
Color32_s m_sCurBgColor
int m_nMaxLength
int m_nCurrentLength
Bitmapm_pcBackBuffer
Viewm_pcBgView

Classes

struct  UndoNode

Member Enumeration Documentation

anonymous enum

Enumerator:
UNDO_INSERT 
UNDO_DELETE 


Constructor & Destructor Documentation

TextEdit::TextEdit ( TextView pcParent,
const Rect cFrame,
const String cTitle,
uint32  nResizeMask = CF_FOLLOW_LEFT|CF_FOLLOW_TOP,
uint32  nFlags = WID_WILL_DRAW|WID_CLEAR_BACKGROUND 
)

TextEdit::~TextEdit (  ) 


Member Function Documentation

void TextEdit::SetEnable ( bool  bEnabled = true  ) 

bool TextEdit::IsEnabled (  )  const

void os::TextEdit::SetMultiLine ( bool  bMultiLine  )  [inline]

bool os::TextEdit::GetMultiLine (  )  const [inline]

void TextEdit::SetPasswordMode ( bool  bPassword  ) 

bool TextEdit::GetPasswordMode (  )  const

void os::TextEdit::SetNumeric ( bool  bNumeric  )  [inline]

bool os::TextEdit::GetNumeric (  )  const [inline]

void TextEdit::SetReadOnly ( bool  bFlag  ) 

bool TextEdit::GetReadOnly (  )  const

uint32 TextEdit::GetEventMask (  )  const

void TextEdit::SetEventMask ( uint32  nMask  ) 

int os::TextEdit::GetMaxUndoSize (  )  const [inline]

void TextEdit::SetMaxUndoSize ( int  nSize  ) 

void TextEdit::SetMinPreferredSize ( int  nWidthChars,
int  nHeightChars 
)

IPoint TextEdit::GetMinPreferredSize (  )  const

void TextEdit::SetMaxPreferredSize ( int  nWidthChars,
int  nHeightChars 
)

IPoint TextEdit::GetMaxPreferredSize (  )  const

void TextEdit::GetRegion ( IPoint  cStart,
IPoint  cEnd,
String pcBuffer,
bool  bAddToClipboard = true 
) const

void TextEdit::GetRegion ( String pcBuffer,
bool  bAddToClipboard = true 
) const

void TextEdit::MakeCsrVisible (  ) 

void TextEdit::InsertString ( IPoint pcPos,
const char *  pzBuffer,
bool  bMakeUndo = true 
)

void TextEdit::Delete ( IPoint  cStart,
IPoint  cEnd,
bool  bMakeUndo = true 
)

void TextEdit::Delete (  ) 

void TextEdit::Clear (  ) 

void TextEdit::Select ( const IPoint cStart,
const IPoint cEnd 
)

void TextEdit::SelectAll (  ) 

void TextEdit::ClearSelection (  ) 

bool TextEdit::GetSelection ( IPoint pcStart,
IPoint pcEnd 
) const

void TextEdit::SetCursor ( const IPoint cPos,
bool  bSelect 
)

IPoint TextEdit::GetCursor (  )  const

void TextEdit::SetMaxLength ( size_t  nMaxLength  ) 

size_t TextEdit::GetMaxLength (  )  const

size_t TextEdit::GetCurrentLength (  )  const

const TextView::buffer_type& os::TextEdit::GetBuffer (  )  const [inline]

Point TextEdit::GetPreferredSize ( bool  bLargest  )  const [virtual]

Reimplemented from os::View.

void TextEdit::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 ([email protected])

Reimplemented from os::View.

void TextEdit::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:
pcNewFont Pointer to the affected font (same as returned by GetFont()).
See also:
SetFont(), os::Font
Author:
Kurt Skauen ([email protected])

Reimplemented from os::View.

void TextEdit::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:
cDelta The distance the bottom/right corner was moved relative to the upper/left corner.
See also:
FrameMoved(), SetFrame, ResizeBy(), ResizeTo()
Author:
Kurt Skauen ([email protected])

Reimplemented from os::View.

void TextEdit::Paint ( const Rect cUpdateRect  )  [virtual]

Description:
Note:
Warning:
Parameters:
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.
See also:
Invalidate(), Flush()
Author:
Kurt Skauen ([email protected])

Reimplemented from os::View.

void TextEdit::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:
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.
See also:
MouseDown(), MouseUp(), WheelMoved(), BeginDrag()
Author:
Kurt Skauen ([email protected])

Reimplemented from os::View.

void TextEdit::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:
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.
See also:
MouseUp(), MouseMove(), WheelMoved()
Author:
Kurt Skauen ([email protected])

Reimplemented from os::View.

void TextEdit::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:
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.
See also:
MouseDown(), MouseMove(), WheelMoved()
Author:
Kurt Skauen ([email protected])

Reimplemented from os::View.

bool TextEdit::HandleKeyDown ( const char *  pzString,
const char *  pzRawString,
uint32  nQualifiers 
)

void TextEdit::UpdateBackBuffer (  ) 

void TextEdit::CommitEvents (  ) 

void TextEdit::DrawCursor ( View pcView = NULL,
float  vHOffset = 0.0f,
float  vVOffset = 0.0f 
)

float TextEdit::GetPixelPosX ( const String cString,
int  x 
)

float TextEdit::GetPixelPosY ( int  y  ) 

int TextEdit::GetCharPosX ( const String cString,
float  vPos 
)

void TextEdit::MaybeDrawString ( View pcView,
float  vHOffset,
const char *  pzString,
int  nLength 
)

void TextEdit::RenderLine ( View pcView,
int  y,
float  vHOffset,
float  vVOffset,
bool  bClear = true 
)

void TextEdit::InsertChar ( char  nChar  ) 

void TextEdit::MoveHoriz ( int  nDelta,
bool  bExpBlock 
)

void TextEdit::MoveVert ( int  nDelta,
bool  bExpBlock 
)

void TextEdit::MoveWord ( bool  bDirection,
bool  bExpBlock 
)

void TextEdit::RecalcPrefWidth (  ) 

void TextEdit::AddUndoNode ( UndoNode psNode  ) 

void TextEdit::Undo (  ) 

void TextEdit::Redo (  ) 

void TextEdit::InvalidateLines ( int  nFirst,
int  nLast 
)


Member Data Documentation

uint32 os::TextEdit::m_nEventMask

uint32 os::TextEdit::m_nPendingEvents

float os::TextEdit::m_vCsrGfxPos

font_height os::TextEdit::m_sFontHeight

float os::TextEdit::m_vGlyphHeight

IPoint os::TextEdit::m_cCsrPos

IPoint os::TextEdit::m_cPrevCursorPos

IPoint os::TextEdit::m_cRegionStart

IPoint os::TextEdit::m_cRegionEnd

bool os::TextEdit::m_bRegionActive

bool os::TextEdit::m_bMultiLine

bool os::TextEdit::m_bPassword

bool os::TextEdit::m_bReadOnly

bool os::TextEdit::m_bNumeric

bool os::TextEdit::m_bEnabled

bool os::TextEdit::m_bEnforceBackBuffer

bool os::TextEdit::m_bMouseDownSeen

bool os::TextEdit::m_bIBeamActive

TextView::buffer_type os::TextEdit::m_cBuffer

std::vector< float > os::TextEdit::m_cLineSizes

TextView* os::TextEdit::m_pcParent

Point os::TextEdit::m_cPreferredSize

std::list<UndoNode * > os::TextEdit::m_cUndoStack

std::list<UndoNode * >::iterator os::TextEdit::m_iUndoIterator

int os::TextEdit::m_nUndoMemSize

int os::TextEdit::m_nMaxUndoSize

IPoint os::TextEdit::m_cMinPreferredSize

IPoint os::TextEdit::m_cMaxPreferredSize

Color32_s os::TextEdit::m_sCurFgColor

Color32_s os::TextEdit::m_sCurBgColor

int os::TextEdit::m_nMaxLength

int os::TextEdit::m_nCurrentLength

Bitmap* os::TextEdit::m_pcBackBuffer

View* os::TextEdit::m_pcBgView


Generated on Sat May 9 22:51:05 2009 for Syllable higlevel API by  doxygen 1.5.1