Main Page   Modules   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

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 Methods

 TextEdit (TextView *pcParent, const Rect &cFrame, const char *pzTitle, 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 ()
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, std::string *pcBuffer, bool bAddToClipboard=true)
void GetRegion (std::string *pcBuffer, bool bAddToClipboard=true)
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)
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. More...

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...

bool HandleMouseMove (const Point &cNewPos, int nCode, uint32 nButtons, Message *pcData)
bool HandleMouseDown (const Point &cPosition, uint32 nButtons)
bool HandleMouseUp (const Point &cPosition, uint32 nButtons, Message *pcData)
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 RecalcPrefWidth ()
void AddUndoNode (UndoNode *psNode)
void Undo ()
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
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

Member Enumeration Documentation

anonymous enum
 

Enumeration values:
UNDO_INSERT  
UNDO_DELETE  


Constructor & Destructor Documentation

TextEdit::TextEdit TextView * pcParent,
const Rect & cFrame,
const char * pzTitle,
uint32 nResizeMask = CF_FOLLOW_LEFT | CF_FOLLOW_TOP,
uint32 nFlags = WID_WILL_DRAW | WID_CLEAR_BACKGROUND
 

TextEdit::~TextEdit
 


Member Function Documentation

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::AddUndoNode UndoNode * psNode
 

void TextEdit::Clear
 

void TextEdit::ClearSelection
 

void TextEdit::CommitEvents
 

void TextEdit::Delete
 

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

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

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.

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

int TextEdit::GetCharPosX const String & cString,
float vPos
 

size_t TextEdit::GetCurrentLength const
 

IPoint TextEdit::GetCursor const
 

uint32 TextEdit::GetEventMask const
 

size_t TextEdit::GetMaxLength const
 

IPoint TextEdit::GetMaxPreferredSize const
 

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

IPoint TextEdit::GetMinPreferredSize const
 

bool os::TextEdit::GetMultiLine [inline]
 

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

bool TextEdit::GetPasswordMode const
 

float TextEdit::GetPixelPosX const String & cString,
int nChar
 

float TextEdit::GetPixelPosY int nLine
 

Point TextEdit::GetPreferredSize bool bLargest const [virtual]
 

Reimplemented from os::View.

bool TextEdit::GetReadOnly const
 

void TextEdit::GetRegion std::string * pcBuffer,
bool bAddToClipboard = true
 

void TextEdit::GetRegion IPoint cStart,
IPoint cEnd,
std::string * pcBuffer,
bool bAddToClipboard = true
 

bool TextEdit::GetSelection IPoint * pcStart,
IPoint * pcEnd
 

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

bool TextEdit::HandleMouseDown const Point & cPosition,
uint32 nButton
 

bool TextEdit::HandleMouseMove const Point & cPosition,
int nCode,
uint32 nButtons,
Message * pcData
 

bool TextEdit::HandleMouseUp const Point & cPosition,
uint32 nButtons,
Message * pcData
 

void TextEdit::InsertChar char nChar
 

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

void TextEdit::InvalidateLines int nFirst,
int nLast
 

bool TextEdit::IsEnabled const
 

void TextEdit::MakeCsrVisible
 

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

void TextEdit::MoveHoriz int nDelta,
bool bExpBlock
 

void TextEdit::MoveVert int nDelta,
bool bExpBlock
 

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::RecalcPrefWidth
 

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

void TextEdit::Select const IPoint & cStart,
const IPoint & cEnd
 

void TextEdit::SelectAll
 

void TextEdit::SetCursor const IPoint & cPos,
bool bSelect
 

void TextEdit::SetEnable bool bEnabled = true
 

void TextEdit::SetEventMask uint32 nMask
 

void TextEdit::SetMaxLength size_t nMaxLength
 

void TextEdit::SetMaxPreferredSize int nWidthChars,
int nHeightChars
 

void TextEdit::SetMaxUndoSize int nSize
 

void TextEdit::SetMinPreferredSize int nWidthChars,
int nHeightChars
 

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

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

void TextEdit::SetPasswordMode bool bPassword
 

void TextEdit::SetReadOnly bool bFlag
 

void TextEdit::Undo
 

void TextEdit::UpdateBackBuffer
 


Member Data Documentation

bool os::TextEdit::m_bEnabled
 

bool os::TextEdit::m_bEnforceBackBuffer
 

bool os::TextEdit::m_bIBeamActive
 

bool os::TextEdit::m_bMouseDownSeen
 

bool os::TextEdit::m_bMultiLine
 

bool os::TextEdit::m_bNumeric
 

bool os::TextEdit::m_bPassword
 

bool os::TextEdit::m_bReadOnly
 

bool os::TextEdit::m_bRegionActive
 

TextView::buffer_type os::TextEdit::m_cBuffer
 

IPoint os::TextEdit::m_cCsrPos
 

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

IPoint os::TextEdit::m_cMaxPreferredSize
 

IPoint os::TextEdit::m_cMinPreferredSize
 

Point os::TextEdit::m_cPreferredSize
 

IPoint os::TextEdit::m_cPrevCursorPos
 

IPoint os::TextEdit::m_cRegionEnd
 

IPoint os::TextEdit::m_cRegionStart
 

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

int os::TextEdit::m_nCurrentLength
 

uint32 os::TextEdit::m_nEventMask
 

int os::TextEdit::m_nMaxLength
 

int os::TextEdit::m_nMaxUndoSize
 

uint32 os::TextEdit::m_nPendingEvents
 

int os::TextEdit::m_nUndoMemSize
 

Bitmap* os::TextEdit::m_pcBackBuffer
 

View* os::TextEdit::m_pcBgView
 

TextView* os::TextEdit::m_pcParent
 

Color32_s os::TextEdit::m_sCurBgColor
 

Color32_s os::TextEdit::m_sCurFgColor
 

font_height os::TextEdit::m_sFontHeight
 

float os::TextEdit::m_vCsrGfxPos
 

float os::TextEdit::m_vGlyphHeight
 


Generated at Tue Sep 11 15:27:55 2001 for AtheOS higlevel API by doxygen1.2.9.1 written by Dimitri van Heesch, © 1997-2001