Pyro higlevel API
Classes | Public Member Functions | Friends | List of all members

Base class for all GUI components. More...

Inheritance diagram for os::View:
os::Handler os::CalendarView::DayView os::CalendarView::DOWView os::DropdownMenu::DropdownView os::IconView::MainView os::AlertView os::CalendarView os::Control os::DropdownMenu os::ImageView os::LayoutView os::ListViewCol os::ListViewContainer os::ListViewHeader os::Menu os::PopupMenu os::ProgressView os::Separator os::Splitter os::StringView os::TableView os::TabView os::TextEdit os::ToolTipView os_priv::SplitterSeparator SplashView TopView

Classes

class  Private
 

Public Member Functions

 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 AttachedToWindow ()
 
virtual void AllAttached ()
 
virtual void DetachedFromWindow ()
 
virtual void AllDetached ()
 
virtual void Activated (bool bIsActive)
 Hook called when the view gain or loose focus. More...
 
virtual void WindowActivated (bool bIsActive)
 Hook called when the window hosting this view gain or loose focus. More...
 
virtual void Paint (const Rect &cUpdateRect)
 Called by the system update "damaged" areas of the view. More...
 
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 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 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 FrameSized (const Point &cDelta)
 Virtual hook called by the system when the view is resized. More...
 
virtual void ViewScrolled (const Point &cDelta)
 Virtual hook called by the system when the view content is scrolled. More...
 
virtual void FontChanged (Font *pcNewFont)
 Called to notify the view that the font has changed. More...
 
virtual Point GetPreferredSize (bool bLargest) const
 
virtual Point GetContentSize () const
 
virtual void WheelMoved (const Point &cDelta)
 Hook called by the system when the scroll-wheel is rotated. More...
 
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 void SetTabOrder (int nOrder=NEXT_TAB_ORDER)
 Set the keyboard manouvering sorting 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
 
ConvertToParent

Convert a point or rectangle from local to parent coordinate system

Description:
Convert a point or rectangle from local to parent coordinate system
Note:
Warning:
Parameters
\return
See Also
Author
Kurt Skauen (kurt@.nosp@m.athe.nosp@m.os.cx)
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...
 

Friends

class Window
 
class ScrollBar
 
class Font
 

Detailed Description

The View class is the work horse in the GUI. Before you can render any graphics into a window, you have to create one or more views and attatch them to it. Views can be added to a window, or to another view to create a hierarchy. To render someting into a window you normaly inherit this class and overload the Pain() function. Each view has it's own graphical environment consisting of three colors (foreground background and erase), a pen position and the drawing mode. Each view lives in a coordinate system relative to its parent. Views are also responsible for receiving user input. The active view in the active window receives keybord and mouse events.

See Also
os::Window, os::Handler, os::view_flags
Author
Kurt Skauen (kurt@.nosp@m.athe.nosp@m.os.cx)

Constructor & Destructor Documentation

View::View ( const Rect cFrame,
const String cTitle,
uint32  nResizeMask = CF_FOLLOW_LEFT | CF_FOLLOW_TOP,
uint32  nFlags = WID_WILL_DRAW | WID_CLEAR_BACKGROUND 
)
Parameters
cFrameThe frame rectangle in the parents coordinate system.
pzTitleThe logical name of the view. This parameter is newer rendered anywhere, but is passed to the Handler::Handler() constructor to identify the view.
nResizeMaskFlags defining how the views frame rectangle is affected if the parent view is resized.
nFlagsVarious flags to control the views behavour.
See Also
AttachedToWindow(), AllAttached(), os::view_flags, os::view_resize_flags, Handler::Handler()
Author
Kurt Skauen (kurt@.nosp@m.athe.nosp@m.os.cx)

References os::Color32_s::blue, os::COL_NORMAL, DEFAULT_FONT_REGULAR, DM_COPY, Flush(), Font, os::get_default_color(), os::Color32_s::green, os::View::Private::m_cFrame, os::View::Private::m_cTitle, os::View::Private::m_eDrawingMode, os::View::Private::m_hReplyPort, os::View::Private::m_hViewHandle, os::View::Private::m_nBeginPaintCount, os::View::Private::m_nFlags, os::View::Private::m_nHideCount, os::View::Private::m_nMouseMode, os::View::Private::m_nMouseMoveRun, os::View::Private::m_nResizeMask, os::View::Private::m_nTabOrder, os::View::Private::m_pcBottomChild, os::View::Private::m_pcContextMenu, os::View::Private::m_pcFont, os::View::Private::m_pcHigherSibling, os::View::Private::m_pcHScrollBar, os::View::Private::m_pcLowerSibling, os::View::Private::m_pcParent, os::View::Private::m_pcPrevFocus, os::View::Private::m_pcToolTip, os::View::Private::m_pcTopChild, os::View::Private::m_pcVScrollBar, os::View::Private::m_sBgColor, os::View::Private::m_sEraseColor, os::View::Private::m_sFgColor, os::MOUSE_OUTSIDE, os::Color32_s::red, os::Font::Release(), and SetFont().

Referenced by os::IconDirectoryView::DragSelection(), os::Slider::Slider(), and os::TextEdit::TextEdit().

View::~View ( )
virtual
Description:
The destructor will release all resources used by the view itseld, and then recursively delete all child views.
To prevent a children to be deleted you must unlink it with View::RemoveChild() before deleting it's parent.
Author
Kurt Skauen (kurt@.nosp@m.athe.nosp@m.os.cx)

References GetWindow(), os::View::Private::m_hReplyPort, os::View::Private::m_pcHScrollBar, os::View::Private::m_pcParent, os::View::Private::m_pcTopChild, os::View::Private::m_pcVScrollBar, RemoveChild(), and os::ScrollBar::SetScrollTarget().

Member Function Documentation

void View::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 in os::TextEdit, os::Slider, os::DropdownMenu, os::Spinner, os::TextView, os::ScrollBar, os::Button, os::DropdownMenu::DropdownView, os::CheckBox, and os::ImageButton.

Referenced by os::Window::SetFocusChild().

void View::AddChild ( View pcView,
bool  bAssignTabOrder = false 
)
virtual
void View::AllAttached ( void  )
virtual
void View::AllDetached ( )
virtual
void View::AttachedToWindow ( void  )
virtual
void View::BeginDrag ( Message pcData,
const Point cHotSpot,
const Bitmap pcBitmap,
Handler pcReplyHandler = NULL 
)
Description:
 This member is normally called from the MouseMove() member to
 initiate a drag and drop operation. The function takes a
 os::Message containing the data to drag, and information about
 how to visually represent the dragged data to the user. The
 visual representation can be eighter a bitmap (possibly with
 an alpha-channel to make it half-transparent) or a simple
 rectangle.
When a drag and drop operation is in progress the application server will include the message given here in pcData in M_MOUSE_MOVED (os::View::MouseMove()) messages sendt to views as the user moves the mouse and also in the M_MOUSE_UP (os::View::MouseUp()) message that terminate the operation.
Parameters
pcDataA os::Message object containing the data to be dragged.
cHotSpotMouse position relative to the visible representation of the dragged object.
pcBitmapA bitmap that will be used as the visible representation of the dragged data. The bitmap can have an alpha channel.
cBoundsAnd alternate way to visually represent the dragged data. If a rectangle is used instead of an bitmap the appserver will render a rectangle instead of a bitmap.
pcReplyHandlerThe handler that should receive replies sendt by the receiver of the dragged data.
See Also
MouseMove(), MouseUp(), os::Message, os::Handler
Author
Kurt Skauen (kurt@.nosp@m.athe.nosp@m.os.cx)

References os::Message::AddInt32(), os::Message::AddMessage(), os::Message::AddPoint(), GetWindow(), and os::Handler::Messenger.

Referenced by os::IconDirectoryView::DragSelection().

void View::BeginDrag ( Message pcData,
const Point cHotSpot,
const Rect cBounds,
Handler pcReplyHandler = NULL 
)
Description:
 Same as void View::BeginDrag( Message* pcData, const Point& cHotSpot,
 const Bitmap* pcBitmap, Handler* pcReplyHandler ) except that this
 version accept a rectangle instead of a bitmap for the "drag gismo".
When starting a drag operation with this member the appserver will render a x-or'ed rectangle according to cBounds to indicate the drag. This is useful when the selection image would be to large to be rendered efficiently or when there is no good graphical representation of the dragged data.
See void View::BeginDrag( Message* pcData, const Point& cHotSpot, const Bitmap* pcBitmap, Handler* pcReplyHandler ) for a more detailed description of the drag and drop system.
See Also
void View::BeginDrag( Message* pcData, const Point& cHotSpot, const Bitmap* pcBitmap, Handler* pcReplyHandler )
Author
Kurt Skauen (kurt@.nosp@m.athe.nosp@m.os.cx)

References os::Message::AddInt32(), os::Message::AddMessage(), os::Message::AddPoint(), os::Message::AddRect(), GetWindow(), and os::Handler::Messenger.

void View::ClearDrawingRegion ( )
Description:
Remove any previously assigned drawing region and allow subsequent rendering commands to alter any visible areas of the view (rendering will still be restricted by the damage-list during a Paint() update).
Since
0.3.7
See Also
SetDrawingRegion(), SetShapeRegion(), ClearShapeRegion()
Author
Kurt Skauen (kurt@.nosp@m.athe.nosp@m.os.cx)

References GetWindow().

void View::ClearShapeRegion ( )
Description:
Restore the view to it's normal rectangular shape as defined by it's frame rectangle.
Note
Clearing the shape rectangle will automatically flush the render queue.
See Also
SetShapeRegion(), os::Window::ClearShapeRegion()
Author
Kurt Skauen (kurt@.nosp@m.athe.nosp@m.os.cx)

References Flush(), and GetWindow().

Referenced by os::Window::ClearShapeRegion().

Point View::ConvertFromParent ( const Point cPoint) const
void View::ConvertFromParent ( Point cPoint) const
Rect View::ConvertFromParent ( const Rect cRect) const
void View::ConvertFromParent ( Rect cRect) const
Point View::ConvertFromScreen ( const Point cPoint) const
void View::ConvertFromScreen ( Point cPoint) const
Rect View::ConvertFromScreen ( const Rect cRect) const
void View::ConvertFromScreen ( Rect cRect) const
Point View::ConvertFromWindow ( const Point cPoint) const
void View::ConvertFromWindow ( Point cPoint) const
Rect View::ConvertFromWindow ( const Rect cRect) const
void View::ConvertFromWindow ( Rect cRect) const
Point View::ConvertToParent ( const Point cPoint) const

Returning the the result

References GetLeftTop(), and os::View::Private::m_cScrollOffset.

Referenced by MouseDown(), and MouseUp().

void View::ConvertToParent ( Point pcPoint) const

Modifying the passet Point object

References GetLeftTop(), and os::View::Private::m_cScrollOffset.

Rect View::ConvertToParent ( const Rect cRect) const
void View::ConvertToParent ( Rect cRect) const
Point View::ConvertToScreen ( const Point cPoint) const
void View::ConvertToScreen ( Point cPoint) const
Rect View::ConvertToScreen ( const Rect cRect) const
void View::ConvertToScreen ( Rect cRect) const
Point View::ConvertToWindow ( const Point cPoint) const
void View::ConvertToWindow ( Point cPoint) const
Rect View::ConvertToWindow ( const Rect cRect) const
void View::ConvertToWindow ( Rect cRect) const
void View::DetachedFromWindow ( void  )
virtual
void View::DrawBitmap ( const Bitmap pcBitmap,
const Rect cSrcRect,
const Rect cDstRect 
)
Description:
DrawBitmap() copy a region of a bitmap into the view performing any required color space conversion.
How the bitmap is rendered depends on the drawing mode and the format of the source bitmap.
The following drawing modes are suppoted by DrawBitmap():
DM_COPY:
Copy the content of the bitmap directly into the view. Only color space conversion is performed (when needed).

DM_OVER:

Almost like DM_COPY but pixels with the value TRANSPARENT_CMAP8 in CS_CMAP8 bitmaps or TRANSPARENT_RGB32 in CS_RGB32 bitmaps will not be copyed.

DM_BLEND:

Blend the bitmap into the original content of the view based on the bitmaps alpha channel. This mode only works for CS_RGB32 bitmaps.

Parameters
pcBitmapThe bitmap to render. Only CS_CMAP8, CS_RGB15, CS_RGB16, and CS_RGB32 type bitmaps are currently supported.
cSrcRectThe source rectangle. Only the area described by this rectangle will be copyed into the view.
cDstRectDestination rectangle.
See Also
Bitmap
Author
Kurt Skauen (kurt@.nosp@m.athe.nosp@m.os.cx)

References GetWindow().

Referenced by os::RadioMenuItem::Draw(), os::CheckMenu::Draw(), os::BitmapImage::Draw(), os::TreeViewCheckNode::Paint(), os::CheckRow::Paint(), os::AlertView::Paint(), os::RadioButton::Paint(), os::ScrollBar::Paint(), os::Spinner::Paint(), os::DropdownMenu::Paint(), os::Slider::Paint(), and os::TextEdit::Paint().

void View::DrawFrame ( const Rect cRect,
uint32  nFlags 
)
void View::DrawLine ( const Point cToPoint)
void View::DrawLine ( const Point cFromPnt,
const Point cToPnt 
)

References GetWindow(), and MovePenTo().

void View::DrawRoundedFrame ( const os::Rect cReizeFrame = os::Rect(1,4,-1,-4),
const os::Color32_s cColor = get_default_color(COL_SHADOW) 
)

References GetBounds().

Referenced by SplashView::Paint().

void View::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 View::DrawSelectedText ( const Rect cPos,
const String cString,
const IPoint cSel1,
const IPoint cSel2,
uint32  nMode = SEL_CHAR,
uint32  nFlags = 0 
)
void View::DrawString ( const Point cPos,
const String cString 
)
void View::DrawString ( const String cString)
Description:
DrawString() render an UTF-8 encoded character string at the current pen position using the current font, pen color and drawing mode.
There is a few issues you should be aware of when rendering text. Since AtheOS antialiaze the glyphs to improve the quality and readability of the text it need a bit more information than just a pen color. If the drawing mode is DM_COPY the text will be antialiazed against color of the current background pen (as set by SetBgColor()). If it is DM_OVER the text will be antialiazed against the existing graphics under the text. If the drawing mode is DM_BLEND the antialiazing is written to the alpha channel of the destination bitmap. This is useful when you render text into a transparent bitmap that will later be render on top of a background with unknown color. One examaple of this is when you create a bitmap that will be used as a drag and drop image. This mode only work when rendering into 32-bit bitmaps.
You should always use the DM_COPY mode when rendering against a static background where you know the background color. When using DM_OVER it is necessary to read the old pixels from the frame-buffer and this is a very slow operations.
Parameters
cStringUTF-8 encoded string to render.
nLengthNumber of bytes to render from pString. If the string is NULL terminated a length of -1 can be used to render the entire string.
See Also
SetFont(), os::Font, SetDrawingMode(), SetFgColor(), SetBgColor()
Author
Kurt Skauen (kurt@.nosp@m.athe.nosp@m.os.cx)

References os::String::c_str(), GetWindow(), and os::String::size().

void View::DrawString ( const char *  pzStr,
int  Len = -1 
)

References GetWindow().

void View::DrawText ( const Rect cPos,
const String cString,
uint32  nFlags = 0 
)
Description:
DrawText() renders a UTF-8 encoded character string inside the rectangle specified, using the current font, pen color and drawing mode.
DrawText() parses the specified text string for the following formatting codes:
\n = newline
_ = underscore next character
ESCc = center text
ESCl = left align text
ESCr = right align text
There is a few issues you should be aware of when rendering text. Since Syllable antialiases the glyphs to improve the quality and readability of the text, it needs a bit more information than just a pen color. If the drawing mode is DM_COPY the text will be antialiased against the colour of the current background pen (as set by SetBgColor()). If it is DM_OVER the text will be antialiased against the existing graphics under the text. If the drawing mode is DM_BLEND the antialiazing is written to the alpha channel of the destination bitmap. This is useful when you render text into a transparent bitmap that will later be rendered on top of a background with unknown color. One examaple of this is when you create a bitmap that will be used as a drag and drop image. This mode only works when rendering into 32-bit bitmaps.
You should always use the DM_COPY mode when rendering against a static background where you know the background color. When using DM_OVER it is necessary to read the old pixels from the frame-buffer and this is a very slow operations.
Parameters
cPosRectangle to render the text in, the text may be centred, left or right aligned inside this rectangle.
cStringUTF-8 encoded string to render.
nLengthNumber of bytes to render from pString. If the string is NULL terminated a length of -1 can be used to render the entire string.
nFlagsFlags that control how the text is rendered.
See Also
SetFont(), os::Font, SetDrawingMode(), SetFgColor(), SetBgColor()
Author
Henrik Isaksson (henri.nosp@m.k@is.nosp@m.aksso.nosp@m.n.tk)

References os::String::c_str(), GetWindow(), and os::String::size().

Referenced by os::MenuItem::Draw(), os::ToolTipView::Paint(), os::TreeViewCheckNode::Paint(), os::CheckRow::Paint(), SplashView::Paint(), os::CheckBox::Paint(), os::RadioButton::Paint(), os::TabViewTab::Paint(), os::FrameView::Paint(), os::StringView::Paint(), os::ImageButton::Paint(), os::Button::Paint(), and os::TreeViewStringNode::Paint().

void View::EraseRect ( const Rect cRect)
void View::FillRect ( const Rect cRect)
void View::FillRect ( const Rect cRect,
Color32_s  sColor 
)

References GetWindow().

void View::Flush ( void  )
Description:
Call the window's Flush() member to flush the render queue.
If the view is not attached to a window, this member does nothing.
To get more info take a look at Window::Flush()
See Also
Sync(), Window::Flush()
Author
Kurt Skauen (kurt@.nosp@m.athe.nosp@m.os.cx)

References os::Window::Flush(), and GetWindow().

Referenced by os::CheckBox::Activated(), os::Button::Activated(), os::ScrollBar::Activated(), os::Spinner::Activated(), os::DropdownMenu::Activated(), os::TextEdit::Activated(), os::ListView::Clear(), os::ImageButton::ClearImage(), os::TextEdit::ClearSelection(), ClearShapeRegion(), os::TextEdit::Delete(), os::CheckBox::EnableStatusChanged(), os::RadioButton::EnableStatusChanged(), os::ScrollBar::EnableStatusChanged(), os::Button::EnableStatusChanged(), os::Slider::EnableStatusChanged(), os::FrameView::FontChanged(), os::TextEdit::FontChanged(), os::FrameView::FrameSized(), os::TabView::FrameSized(), os::Menu::FrameSized(), os::ListView::FrameSized(), os::DropdownMenu::HandleMessage(), os::ListView::Highlight(), os::ListView::InsertColumn(), os::ListView::InsertRow(), os::TextEdit::InsertString(), os::ListView::InvalidateRow(), os::DropdownMenu::KeyDown(), os::Menu::KeyDown(), os::IconView::MainView::KeyDown(), os::CheckBox::LabelChanged(), os::RadioButton::LabelChanged(), os::Button::LabelChanged(), os::ProgressView::Layout(), os::IconView::Private::LayoutIcons(), os::ListView::MakeVisible(), os::ScrollBar::MouseDown(), os::Spinner::MouseDown(), os::DropdownMenu::MouseDown(), os::TextEdit::MouseDown(), os::Menu::MouseDown(), os::IconView::MainView::MouseDown(), os::ImageButton::MouseMove(), os::ScrollBar::MouseMove(), os::Spinner::MouseMove(), os::TabView::MouseMove(), os::Menu::MouseMove(), os::IconView::MainView::MouseMove(), os::RadioMenu::MouseUp(), os::ScrollBar::MouseUp(), os::Spinner::MouseUp(), os::IconView::MainView::MouseUp(), os::Menu::Open(), os::CheckBox::PostValueChange(), os::RadioButton::PostValueChange(), os::ScrollBar::PostValueChange(), os::Button::PostValueChange(), os::ListView::RefreshLayout(), os::ListView::RemoveRow(), os::ListView::Select(), os::StringView::SetAlignment(), os::IconView::SetBackground(), os::IconView::SetBackgroundColor(), os::Splash::SetBgColor(), os::TextEdit::SetCursor(), SplashView::SetEnable(), os::Spinner::SetEnable(), os::DropdownMenu::SetEnable(), os::TextEdit::SetEnable(), os::Menu::SetEnable(), os::Splash::SetFont(), SplashView::SetFont(), os::ListView::SetHasColumnHeader(), os::IconView::SetIconImage(), os::IconView::SetIconPosition(), os::IconView::SetIconSelected(), os::IconView::SetIconString(), SplashView::SetImage(), os::Button::SetInputMode(), os::FrameView::SetLabel(), os::ScrollBar::SetProportion(), os::ListView::SetRenderBorder(), os::IconView::SetSelectionColor(), SetShapeRegion(), os::Splitter::SetSplitRatio(), os::StringView::SetString(), SplashView::SetText(), SplashView::SetTextColor(), os::IconView::SetTextColor(), os::ImageButton::SetTextPosition(), os::IconView::SetTextShadowColor(), Show(), os::Splitter::SplitBy(), os::IconView::MainView::TimerTick(), os::TreeViewCheckNode::Toggle(), os::CheckRow::Toggle(), View(), os::DropdownMenu::WheelMoved(), and os::IconView::MainView::WindowActivated().

void View::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 in os::TextView, os::TextEdit, os::DropdownMenu, os::Spinner, os::DropdownMenu::DropdownView, and os::FrameView.

Referenced by os::Window::DispatchMessage(), and SetFont().

void View::FrameMoved ( const Point cDelta)
virtual
Description:
Overload this member if you need to know when the view is moved within the coordinate system of the parent.
Note:
This member is called after the view is moved. If you need the old position you can subtract the cDelta value from the current position.
Parameters
cDeltaThe distance the view was moved.
See Also
FrameSized(), SetFrame(), MoveBy(), MoveTo()
Author
Kurt Skauen (kurt@.nosp@m.athe.nosp@m.os.cx)

Reimplemented in TopView.

Referenced by SetFrame().

void View::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 in os::IconView::MainView, os::LayoutView, os::ListView, os::Menu, os::TextView, os::TextEdit, os::ProgressView, os::Slider, os::TabView, os::Splitter, os::DropdownMenu, os::Spinner, os::TableView, os::CalendarView::DOWView, os::ScrollBar, os::FrameView, TopView, and os::CalendarView::DayView.

Referenced by os::Splitter::FrameSized(), and SetFrame().

Color32_s View::GetBgColor ( ) const
Rect View::GetBounds ( void  ) const

References os::Rect::left, os::View::Private::m_cFrame, os::View::Private::m_cScrollOffset, and os::Rect::top.

Referenced by os::ImageButton::Activated(), os::Splitter::AdjustLayout(), os::IconView::Private::AdjustScrollBars(), os::TableView::AllAttached(), os::IconView::Private::DeselectAll(), os::MenuItem::Draw(), os::MenuSeparator::Draw(), os::TextEdit::DrawCursor(), DrawRoundedFrame(), os::FrameView::FontChanged(), os::ScrollBar::FrameSized(), os::TableView::FrameSized(), os::DropdownMenu::FrameSized(), os::TabView::FrameSized(), os::ProgressView::FrameSized(), os::TextView::FrameSized(), os::Menu::FrameSized(), os::ListView::FrameSized(), os::Window::GetBounds(), os::IconView::Private::GetViewFrame(), os::TextEdit::HandleKeyDown(), os::DropdownMenu::HandleMessage(), os::IconView::IconView(), os::TextEdit::InsertString(), os::TabView::InsertTab(), os::TextEdit::InvalidateLines(), os::DropdownMenu::KeyDown(), os::TableView::Layout(), os::TextEdit::MakeCsrVisible(), os::CheckBox::MouseDown(), os::RadioButton::MouseDown(), os::Button::MouseDown(), os::DropdownMenu::MouseDown(), os::Menu::MouseDown(), os::IconDirectoryView::MouseMove(), os::TabView::MouseMove(), os::TextEdit::MouseMove(), os::Menu::MouseMove(), os::RadioMenu::MouseUp(), os::Menu::MouseUp(), os::ToolTipView::Paint(), SplashView::Paint(), os::PopupMenu::Paint(), os::Separator::Paint(), os::AlertView::Paint(), os::CheckBox::Paint(), os::RadioButton::Paint(), os::StringView::Paint(), os::ImageButton::Paint(), os::ImageView::Paint(), os::Button::Paint(), os::ScrollBar::Paint(), os::TableView::Paint(), os::Spinner::Paint(), os::DropdownMenu::Paint(), os::TabView::Paint(), os::TextEdit::Paint(), os::TextView::Paint(), os::Menu::Paint(), os::ListView::Paint(), os::IconView::MainView::Paint(), os::ProgressView::ProgressView(), os::ImageView::Refresh(), os::ListViewCol::Refresh(), os::TextEdit::RenderLine(), os::IconView::ScrollToIcon(), os::TextEdit::SetEnable(), SplashView::SetEnableProgressBar(), os::FrameView::SetLabel(), os::TabView::SetSelection(), os::TabView::SetTabTitle(), SplashView::SplashView(), os::Splitter::SplitBy(), os::TextView::TextView(), os::IconView::MainView::TimerTick(), os::TextEdit::UpdateBackBuffer(), and os::DropdownMenu::WheelMoved().

View * View::GetChildAt ( const Point cPos) const
View * View::GetChildAt ( int  nIndex) const
Point View::GetContentSize ( ) const
virtual
Menu * View::GetContextMenu ( ) const
Description:
Returns the popup menu assigned to this View, or null if no popup menu is assigned.
See Also
SetContextMenu()
Author
Henrik Isaksson (henri.nosp@m.k@is.nosp@m.aksso.nosp@m.n.tk)

References os::View::Private::m_pcContextMenu.

drawing_mode View::GetDrawingMode ( ) const
Color32_s View::GetEraseColor ( ) const
Color32_s View::GetFgColor ( ) const

References os::View::Private::m_sFgColor.

Referenced by DrawFrame().

uint32 View::GetFlags ( uint32  nMask = ~0L) const
Font * View::GetFont ( ) const
void View::GetFontHeight ( font_height psHeight) const
Rect View::GetFrame ( ) const
ScrollBar * View::GetHScrollBar ( void  ) const
Point View::GetLeftTop ( ) const
void View::GetMouse ( Point pcPosition,
uint32 *  pnButtons 
) const
Rect View::GetNormalizedBounds ( ) const
View * View::GetParent ( void  ) const
Point View::GetPenPosition ( ) const
Note:
This member will do a syncronous request to the application server which is a rather expensive operation. Since some operations like text-rendering move the cursor in a fashion that is not predictable by the View class it does not cache the pen position. You should avoid using this member unless you have to know how much the pen was moved by a text rendering operation.
Returns
The current pen position in the views coordinate system.
See Also
MovePenTo(), MovePenBy()
Author
Kurt Skauen (kurt@.nosp@m.athe.nosp@m.os.cx)

References GetWindow(), and os::View::Private::m_hViewHandle.

Referenced by os::TextEdit::MaybeDrawString().

Point View::GetPreferredSize ( bool  bLargest) const
virtual
uint32 View::GetQualifiers ( ) const
uint32 View::GetResizeMask ( ) const
Point View::GetScrollOffset ( void  ) const
void View::GetSelection ( const String cClipboard = "__system_clipboard__")

References os::String::c_str(), and GetWindow().

const ShortcutKey & View::GetShortcut ( ) const
virtual
int View::GetStringLength ( const String cString,
float  vWidth,
bool  bIncludeLast = false 
) const
int View::GetStringLength ( const char *  pzString,
int  nLen,
float  vWidth,
bool  bIncludeLast = false 
) const
void View::GetStringLengths ( const char **  apzStringArray,
const int *  anLengthArray,
int  nStringCount,
float  vWidth,
int *  anMaxLengthArray,
bool  bIncludeLast = false 
) const
float View::GetStringWidth ( const String cString) const
float View::GetStringWidth ( const char *  pzString,
int  nLen = -1 
) const
void View::GetStringWidths ( const char **  apzStringArray,
const int *  anLengthArray,
int  nStringCount,
float *  avWidthArray 
) const
int View::GetTabOrder ( ) const
virtual
Description:
This member is called by the system to decide which view to select next when the <TAB> key is pressed. The focus is given to the next view with higher or equal tab-order as the current. You can overload this member to decide the order whenever it is called, or rely on the default implementation that will return whatever was set by SetTabOrder(). A negative return value means that the view should not be skipped when searching for the next view to activate.
Returns
The views sorting order for keyboard manouvering.
See Also
SetTabOrder()
Author
Kurt Skauen (kurt@.nosp@m.athe.nosp@m.os.cx)

Reimplemented in os::IconView, os::DropdownMenu, and os::Spinner.

References os::View::Private::m_nTabOrder.

Referenced by os::Window::DispatchMessage(), os::Spinner::GetTabOrder(), os::DropdownMenu::GetTabOrder(), and os::IconView::GetTabOrder().

Point View::GetTextExtent ( const String cString,
uint32  nFlags = 0,
int  nTargetWidth = -1 
) const
String View::GetTitle ( ) const
os::String View::GetToolTip ( ) const
void os::View::GetTruncatedStrings ( const char **  pazStringArray,
int  nStringCount,
uint32  nMode,
float  nWidth,
char **  pazResultArray 
) const
ScrollBar * View::GetVScrollBar ( void  ) const
Window* os::View::GetWindow ( ) const
inline
bool View::HasFocus ( void  ) const
virtual
float View::Height ( void  ) const
void os::View::Hide ( )
inline
void View::Invalidate ( const Rect cRect,
bool  bRecurse = false 
)
Description:
To avoid rendering the whole view when a new area is made visible, the appserver maintain a damage list containing areas made visible since the last paint message was sendt to the view. When the View respond to the paint message the appserver will clip the rendering to the damage list to avoid rendering any pixels that are still intact. By calling Invalidate() you can force an area into the damage list, and make the appserver send a paint message to the view. This will again make the Paint() member be called to revalidate the damaged areas.
Parameters
cRectThe rectangle to invalidate.
bRecurseIf true cRect will also be converted into each children's coordinate system and added to their damage list.
See Also
Invalidate( bool ), Paint()
Author
Kurt Skauen (kurt@.nosp@m.athe.nosp@m.os.cx)

References GetWindow().

Referenced by os::CheckBox::Activated(), os::Button::Activated(), os::ScrollBar::Activated(), os::Spinner::Activated(), os::DropdownMenu::Activated(), os::AlertView::AlertView(), os::TextEdit::Clear(), os::ImageButton::ClearImage(), os::TextEdit::Delete(), os::TabView::DeleteTab(), os::IconView::Private::DeselectAll(), os::CheckBox::EnableStatusChanged(), os::RadioButton::EnableStatusChanged(), os::ScrollBar::EnableStatusChanged(), os::Button::EnableStatusChanged(), os::Slider::EnableStatusChanged(), os::FrameView::FontChanged(), os::TextEdit::FontChanged(), os::FrameView::FrameSized(), os::TableView::FrameSized(), os::TabView::FrameSized(), os::Slider::FrameSized(), os::Menu::FrameSized(), os::DropdownMenu::HandleMessage(), os::TextEdit::InsertString(), os::TextEdit::InvalidateLines(), os::DropdownMenu::KeyDown(), os::CheckBox::LabelChanged(), os::RadioButton::LabelChanged(), os::Button::LabelChanged(), os::IconView::Private::LayoutIcons(), os::ScrollBar::MouseDown(), os::Spinner::MouseDown(), os::DropdownMenu::MouseDown(), os::ImageButton::MouseMove(), os::ScrollBar::MouseMove(), os::Spinner::MouseMove(), os::TabView::MouseMove(), os::IconView::MainView::MouseMove(), os::ScrollBar::MouseUp(), os::Spinner::MouseUp(), os::IconView::MainView::MouseUp(), os::CheckBox::PostValueChange(), os::RadioButton::PostValueChange(), os::ScrollBar::PostValueChange(), os::Button::PostValueChange(), os::ListView::RefreshLayout(), os::IconView::Private::Select(), os::StringView::SetAlignment(), os::IconView::SetBackground(), os::IconView::SetBackgroundColor(), os::Splash::SetBgColor(), os::ListView::SetColumnMapping(), SplashView::SetEnable(), os::Spinner::SetEnable(), os::DropdownMenu::SetEnable(), os::TextEdit::SetEnable(), os::Splash::SetFont(), SplashView::SetFont(), os::IconView::SetIconImage(), os::IconView::SetIconPosition(), os::IconView::SetIconString(), SplashView::SetImage(), os::ImageView::SetImage(), os::FrameView::SetLabel(), os::ScrollBar::SetProportion(), os::TabView::SetSelection(), os::IconView::SetSelectionColor(), os::Splitter::SetSplitRatio(), os::StringView::SetString(), os::TabView::SetTabTitle(), SplashView::SetText(), SplashView::SetTextColor(), os::IconView::SetTextColor(), os::ImageButton::SetTextPosition(), os::IconView::SetTextShadowColor(), os::TreeViewCheckNode::Toggle(), os::CheckRow::Toggle(), os::DropdownMenu::WheelMoved(), and os::IconView::MainView::WindowActivated().

void View::Invalidate ( bool  bRecurse = false)
Description:
Same as calling Invalidate( GetBounds() ), but more efficient since the appserver know that the whole view is to be invalidated, and does not have to merge the rectangle into the clipping region.
Parameters
bRecurse- True if all childs should be invalidated reqursivly aswell.
See Also
Invalidate( const Rect&, bool ), Paint()
Author
Kurt Skauen (kurt@.nosp@m.athe.nosp@m.os.cx)

References GetWindow().

bool View::IsVisible ( ) const
void View::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 in os::IconView::MainView, os::ListView, os::Menu, os::DirectoryView, os::Slider, os::TabView, os::IconDirectoryView, os::Splitter, os::DropdownMenu, os::Spinner, os::DropdownMenu::DropdownTextView, os::TextView, os::ScrollBar, os::Button, os::DropdownMenu::DropdownView, os::RadioButton, os::CheckBox, and TopView.

References KeyDown(), and os::View::Private::m_pcParent.

Referenced by os::Window::DispatchMessage(), os::CheckBox::KeyDown(), os::RadioButton::KeyDown(), os::Button::KeyDown(), os::ScrollBar::KeyDown(), os::TextView::KeyDown(), os::Spinner::KeyDown(), os::DropdownMenu::KeyDown(), os::Splitter::KeyDown(), os::IconDirectoryView::KeyDown(), os::TabView::KeyDown(), os::Slider::KeyDown(), os::Menu::KeyDown(), KeyDown(), os::ListView::KeyDown(), os::IconView::MainView::KeyDown(), and os::Button::KeyUp().

void View::KeyUp ( const char *  pzString,
const char *  pzRawString,
uint32  nQualifiers 
)
virtual
Description:
This is the counterpart to KeyDown().
See Also
KeyDown()
Author
Kurt Skauen (kurt@.nosp@m.athe.nosp@m.os.cx)

Reimplemented in os::Spinner, os::Button, and os::CheckBox.

References KeyUp(), and os::View::Private::m_pcParent.

Referenced by os::Window::DispatchMessage(), os::CheckBox::KeyUp(), os::Button::KeyUp(), os::Spinner::KeyUp(), and KeyUp().

void View::MakeFocus ( bool  bFocus = true)
virtual
void View::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 in os::IconView::MainView, os::ListView, os_priv::SplitterSeparator, os::Menu, os::TextEdit, os::ListViewCol, os::Slider, os::TabView, os::DropdownMenu, os::Spinner, os::TextView, os::ScrollBar, os::Button, os::ImageButton, os::DropdownMenu::DropdownView, os::RadioButton, os::CheckBox, os::PopupMenu, and os::CalendarView::DayView.

References ConvertToParent(), ConvertToScreen(), os::View::Private::m_pcContextMenu, os::View::Private::m_pcParent, MouseDown(), and os::Menu::Open().

Referenced by os::Window::DispatchMessage(), os::PopupMenu::MouseDown(), os::CheckBox::MouseDown(), os::RadioButton::MouseDown(), os::Button::MouseDown(), os::ScrollBar::MouseDown(), os::TextView::MouseDown(), os::Spinner::MouseDown(), os::DropdownMenu::MouseDown(), os::TabView::MouseDown(), os::Slider::MouseDown(), os::TextEdit::MouseDown(), os_priv::SplitterSeparator::MouseDown(), MouseDown(), os::ListView::MouseDown(), and os::IconView::MainView::MouseDown().

void View::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 in os::IconView::MainView, os::ListView, os::Menu, os_priv::SplitterSeparator, os::ListViewCol, os::TextEdit, os::DirectoryView, os::Slider, os::TabView, os::IconDirectoryView, os::Splitter, os::Spinner, os::TextView, os::ScrollBar, os::Button, os::ImageButton, os::DropdownMenu::DropdownView, os::PopupMenu, and os::CalendarView::DayView.

References ConvertToScreen(), GetWindow(), os::View::Private::m_pcToolTip, os::MOUSE_INSIDE, os::Window::MoveTo(), and os::ToolTip::ShowTip().

Referenced by os::PopupMenu::MouseMove(), os::Button::MouseMove(), os::ScrollBar::MouseMove(), os::TextView::MouseMove(), os::Spinner::MouseMove(), os::Splitter::MouseMove(), os::IconDirectoryView::MouseMove(), os::Slider::MouseMove(), os::TextEdit::MouseMove(), os_priv::SplitterSeparator::MouseMove(), os::ListView::MouseMove(), and os::IconView::MainView::MouseMove().

void View::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 in os::IconView::MainView, os::ListView, os::Menu, os::ListViewCol, os::TextEdit, os::DirectoryView, os::Slider, os::TabView, os::IconDirectoryView, os::Splitter, os::Spinner, os::TextView, os::ScrollBar, os::Button, os::ImageButton, os::DropdownMenu::DropdownView, os::RadioMenu, os::RadioButton, os::CheckBox, and os::PopupMenu.

References ConvertToParent(), os::View::Private::m_pcParent, and MouseUp().

Referenced by os::Window::DispatchMessage(), os::PopupMenu::MouseUp(), os::CheckBox::MouseUp(), os::RadioButton::MouseUp(), os::Button::MouseUp(), os::ScrollBar::MouseUp(), os::TextView::MouseUp(), os::Spinner::MouseUp(), os::Splitter::MouseUp(), os::IconDirectoryView::MouseUp(), os::Slider::MouseUp(), os::TextEdit::MouseUp(), MouseUp(), os::ListView::MouseUp(), and os::IconView::MainView::MouseUp().

void View::MoveBy ( const Point cDelta)
virtual
Description:
Move the view relative to it's current position.
Parameters
cDeltaThe distance to move the view.
See Also
MoveTo()
Author
Kurt Skauen (kurt@.nosp@m.athe.nosp@m.os.cx)

References os::View::Private::m_cFrame, and SetFrame().

Referenced by os::Window::MoveBy(), and os::Splitter::SplitBy().

void View::MoveBy ( float  vDeltaX,
float  vDeltaY 
)
virtual
void View::MovePenBy ( const Point cPos)

References GetWindow().

Referenced by os::TextEdit::MaybeDrawString().

void os::View::MovePenBy ( float  x,
float  y 
)
inline

References MovePenBy().

Referenced by MovePenBy().

void View::MovePenTo ( const Point cPos)
void os::View::MovePenTo ( float  x,
float  y 
)
inline

References MovePenTo().

Referenced by MovePenTo().

void View::MoveTo ( const Point cPos)
virtual
Description:
Move the view to a new absolute position within the parents coordinate system.
Parameters
cPosThe new position of the upper/left corner of the view
See Also
MoveBy()
Author
Kurt Skauen (kurt@.nosp@m.athe.nosp@m.os.cx)

References GetLeftTop(), os::View::Private::m_cFrame, and SetFrame().

Referenced by os::ProgressView::Layout(), os::Window::MoveTo(), and os::FrameView::SetLabel().

void View::MoveTo ( float  x,
float  y 
)
virtual
void View::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 in os::IconView::MainView, os::ListView, os::TreeView, os::Menu, os::TextView, os::TextEdit, os::ListViewCol, os::ProgressView, os_priv::SplitterSeparator, os::Slider, os::TabView, os::DropdownMenu, os::Spinner, os::TableView, os::ScrollBar, os::Button, os::CalendarView::DOWView, os::ImageView, os::ImageButton, os::StringView, os::FrameView, os::DropdownMenu::DropdownView, os::RadioButton, os::CheckBox, os::AlertView, os::Separator, os::PopupMenu, os::CalendarView, os::CalendarView::DayView, SplashView, and os::ToolTipView.

References os::COL_NORMAL, EraseRect(), os::get_default_color(), and SetEraseColor().

Referenced by os::Window::DispatchMessage(), and os_priv::SplitterSeparator::Paint().

void View::Ping ( int  nSize = 0) const

References GetWindow().

void View::RemoveChild ( View pcChild)
void View::RemoveThis ( void  )
void View::ResizeBy ( const Point cDelta)
virtual
void View::ResizeBy ( float  vDeltaW,
float  vDeltaH 
)
virtual
void View::ResizeTo ( const Point cSize)
virtual
void View::ResizeTo ( float  w,
float  h 
)
virtual
Description:
Move the bottom/right corner of the view to give it the new size. The top/left corner will not be affected. This will cause FrameSized() to be called and any child views to be resized according to their resize flags if the new size differ from the previous.
Note
Coordinates start in the middle of a pixel and all rectangles are inclusive so the real width and height in pixels will be 1 larger than the value given in w and h.
Parameters
wNew width
hNew height.
Returns
Error codes:
See Also
ResizeTo(const Point&), ResizeBy(), SetFrame()
Author
Kurt Skauen (kurt@.nosp@m.athe.nosp@m.os.cx)

References os::Rect::left, os::View::Private::m_cFrame, SetFrame(), and os::Rect::top.

void View::ScrollBy ( const Point cDelta)
virtual
virtual void os::View::ScrollBy ( float  vDeltaX,
float  vDeltaY 
)
inlinevirtual

References ScrollBy().

Referenced by ScrollBy().

void View::ScrollRect ( const Rect cSrcRect,
const Rect cDstRect 
)
Description:
ScrollRect() will copy the source rectangle to the destination rectangle using the blitter. If parts of the source rectangle is obscured (by another window/view or the screen edge) and the same area in the destination area is not that area in the destination rectangle will be invalidated (see Invalidate()).
Note:
Scrolling an area within the view might affect the current "damage-list" of the view and cause a repaint message to be sendt to the view. If ScrollRect() is called repeatadly and the application for some reason can't handle the generated repaint messages fast enough more and more damage-rectangles will accumulate in the views damage list slowing things further down until the appserver is broght to a grinding halt. To avoid this situation the next paint message received after a call to ScrollRect() will cause Sync() instead of Flush() to be called when Paint() returns to syncronize the application with the appserver. So even though the ScrollRect() member itself is asyncronous it might cause Sync() to be called and will have the performance implications mentioned in the documentation of Sync()
Parameters
cSrcRectThe source rectangle in the views coordinate system.
cSrcRectThe destination rectangle in the views coordinate system. This rectangle should have the same size but a difference position than the cSrcRect. In a future version it might be possible to scale the rectangle by using a different size so make sure they don't differ or you might get a surprice some day.
See Also
ScrollTo(), ScrollBy(), Sync()
Author
Kurt Skauen (kurt@.nosp@m.athe.nosp@m.os.cx)

References GetWindow().

void View::ScrollTo ( Point  cTopLeft)
virtual
virtual void os::View::ScrollTo ( float  x,
float  y 
)
inlinevirtual

References ScrollTo().

Referenced by ScrollTo().

void View::SetBgColor ( int  nRed,
int  nGreen,
int  nBlue,
int  nAlpha = 255 
)
void View::SetBgColor ( Color32_s  sColor)
void View::SetContextMenu ( Menu pcMenu)
Description:
Set a popup menu to be used for this View. The popup menu is opened when the user right-clicks inside the View, unless the right-click event is consumed by the subclass.
Parameters
pcMenu- popup menu for this View. Deleted automatically.
See Also
GetContextMenu()
Author
Henrik Isaksson (henri.nosp@m.k@is.nosp@m.aksso.nosp@m.n.tk)

References os::View::Private::m_pcContextMenu.

void View::SetDrawingMode ( drawing_mode  nMode)
void View::SetDrawingRegion ( const Region cReg)
Description:
Restrict rendering using a clipping region. By assigning a drawing region to a view you can restrict what areas of the view that will be affected by subsequent rendering commands. Only areas represented by the region (and are not obscured by other views or resides outside the view frame) will be rendered to.
Unlike SetShapeRegion() the drawing region is not inherited by children views and it will not affect the shape of the view (ie. it will not make any areas of the view transparent) and it will not affect hit testing.
Parameters
cRegA region defining drawable areas. The rectangles in the region should be in the views own coordinate system.
Returns
Error codes:
Since
0.3.7
See Also
Author
Kurt Skauen (kurt@.nosp@m.athe.nosp@m.os.cx)

References os::Region::GetClipCount(), GetWindow(), os::Region::m_cRects, and os::ClipRectList::m_pcFirst.

void View::SetEraseColor ( int  nRed,
int  nGreen,
int  nBlue,
int  nAlpha = 255 
)
void View::SetEraseColor ( Color32_s  sColor)
void View::SetFgColor ( int  nRed,
int  nGreen,
int  nBlue,
int  nAlpha = 255 
)
void View::SetFgColor ( Color32_s  sColor)
void View::SetFlags ( uint32  nFlags)
void View::SetFont ( Font pcFont)
Description:
Replace the font used when rendering text and notify the view itself about the change by calling the View::FontChanged() hook function.
Font's are reference counted and SetFont() will call Font::AddRef() on the new font and Font::Release() on the old font. This means that you retain ownership on the font even after View::SetFont() returns. You must therefor normally call Font::Release() on the font after setting it.
The view will be affected by changes applied to the font after it is set. If someone change the properties of the font later the view will again be notified through the View::FontChanged() hook
Parameters
pcFontPointer to the new font. It's reference count will be increased by one.
See Also
DrawString(), os::Font
Author
Kurt Skauen (kurt@.nosp@m.athe.nosp@m.os.cx)

References os::Font::AddRef(), Font, FontChanged(), os::Font::GetFontID(), GetWindow(), os::View::Private::m_pcFont, os::Font::SetFamilyAndStyle(), and os::Font::SetProperties().

Referenced by os::Spinner::AllAttached(), os::DropdownMenu::AllAttached(), os::DropdownMenu::DropdownView::DropdownView(), os::Spinner::FontChanged(), os::DropdownMenu::FontChanged(), os::TextEdit::FontChanged(), os::TextView::FontChanged(), and View().

void View::SetFrame ( const Rect cRect,
bool  bNotifyServer = true 
)
virtual
Description:
Set the frame-rectangle of the view relative to it's parent. If this cause new areas of this view or any of it's siblings/childs the affected views will receive a paint message to update the newly exposed areas.
If the upper-left corner of the view is moved the View::FrameMoved() hook will be called and if the lower-right corner move relative to the upper-left corner the View::FrameSized() hook will be called.
Parameters
cRectThe new frame rectangle.
See Also
ResizeTo(), ResizeBy(), MoveTo(), MoveBy()
Author
Kurt Skauen (kurt@.nosp@m.athe.nosp@m.os.cx)

References FrameMoved(), FrameSized(), GetWindow(), os::Rect::Height(), os::Rect::left, os::View::Private::m_cFrame, os::View::Private::m_pcBottomChild, os::View::Private::m_pcHigherSibling, os::Rect::top, os::Rect::Width(), os::Point::x, and os::Point::y.

Referenced by os::Splitter::AdjustLayout(), os::IconView::Private::AdjustScrollBars(), os::TabView::DeleteTab(), os::Spinner::FrameSized(), os::DropdownMenu::FrameSized(), os::TabView::FrameSized(), os::Slider::FrameSized(), os::TextView::FrameSized(), os::ListView::FrameSized(), os::IconView::IconView(), os::TabView::InsertTab(), os::TableCell::Layout(), MoveBy(), MoveTo(), os::Menu::Open(), ResizeBy(), ResizeTo(), os::BitmapImage::Private::SetBitmap(), os::LayoutNode::SetFrame(), os::Window::SetFrame(), os::Splitter::SetOrientation(), os::TabView::SetSelection(), os::LayoutNode::SetView(), os::Splitter::SplitBy(), os::Menu::Track(), and os::TextEdit::UpdateBackBuffer().

void View::SetMousePos ( const Point cPosition)
void View::SetResizeMask ( uint32  nFlags)
void View::SetShapeRegion ( const Region cReg)
Description:
Define a non-square shape for the view.
Normally a view's shape is defined by a simple rectangle but it is possible to define views with complex shapes and even with holes by restricting the shape using a clipping region. A clipping region (os::Region) is basically a list of non-overlapping visible rectangles. When adding a shape-defining clipping region to a view all areas not covered by a rectangle in the region will be transparent.
Note that defining complex shapes with many rectangles can quickly become expensive, espesially if multiple complexly shaped views are siblings.
Parameters
cRegThe region defining the new shape of the view. The rectangles in the region should be in the views own coordinate system.
Since
0.3.7
See Also
ClearShapeRegion(), SetDrawingRegion(), os::Window::SetShapeRegion()
Author
Kurt Skauen (kurt@.nosp@m.athe.nosp@m.os.cx)

References Flush(), os::Region::GetClipCount(), GetWindow(), os::Region::m_cRects, and os::ClipRectList::m_pcFirst.

Referenced by os::Window::SetShapeRegion().

void View::SetShortcut ( const ShortcutKey cShortcut)
virtual
Description:
Sets a shortcut that activates the View. The exact behaviour of shortcuts is defined in the various subclasses. For a Button, for instance, pressing the associated key will "push" the button, releasing the associated key will "release" the button and send the associated message. Pressing any other key while the shortcut key is still held, will cancel the operation. Please note that most widgets (including Button) will automatically extract keyboard shortcuts from their labels.
Parameters
cShortcut- key combination to activate View.
See Also
Control::SetLabel(), GetShortcut(), SetShortcutFromLabel(), ShortcutKey
Author
Henrik Isaksson (henri.nosp@m.k@is.nosp@m.aksso.nosp@m.n.tk)

References os::Window::AddShortcut(), GetWindow(), os::ShortcutKey::IsValid(), os::View::Private::m_cKey, and os::Window::RemoveShortcut().

void View::SetShortcutFromLabel ( const String cLabel)
virtual
Description:
Like SetShortcut(), but the key is extracted from a text label. The character following the first unescaped underscore character (_) is used.
Parameters
cLabel- text string containing shortcut.
See Also
GetShortcut(), SetShortcutFromLabel(), ShortcutKey
Author
Henrik Isaksson (henri.nosp@m.k@is.nosp@m.aksso.nosp@m.n.tk)

References os::Window::AddShortcut(), GetWindow(), os::ShortcutKey::IsValid(), os::View::Private::m_cKey, os::Window::RemoveShortcut(), and os::ShortcutKey::SetFromLabel().

Referenced by os::Control::Control(), and os::Control::SetLabel().

void View::SetTabOrder ( int  nOrder = NEXT_TAB_ORDER)
virtual
void View::SetToolTip ( const os::String t)
void View::Show ( bool  bVisible = true)
Description:
Calling show with bVisible == false on a view have the same effect as unlinking it from it's parent, except that the view will remember it's entire state like the font, colors, position, depth, etc etc. A subsequent call to Show() with bVisible == true will restore the view compleatly.
Calls to Show() can be nested. If it is called twice with bVisible == false it must be called twice with bVisible == true before the view is made visible. It is safe to call Show(false) on a view before it is attached to a window. The view will then remember it's state and will not be visible when attached to a window later on.
A hidden view will not receive paint messages or input events from keybord or mouse. It will still receive messages targeted directly at the view.
Note:
It is NOT leagal to show a visible view! Calling Show(true) before Show(false) is an error.
Parameters
bVisible- A boolean telling if the view should be hidden or viewed.
See Also
IsVisible(), Window::Show()
Author
Kurt Skauen (kurt@.nosp@m.athe.nosp@m.os.cx)

References Flush(), GetWindow(), os::View::Private::m_nHideCount, os::View::Private::m_pcBottomChild, and os::View::Private::m_pcHigherSibling.

Referenced by os::IconView::Private::AdjustScrollBars(), os::TabView::DeleteTab(), os::TabView::InsertTab(), MountDialogScanner::Run(), os::FrameView::SetLabel(), os::TabView::SetSelection(), and os::Window::Show().

void View::Sync ( void  )
Description:
Call the window's Flush() member to flush the render queue and syncronize the view with the appserver.
If the view is not attached to a window, this member does nothing.
To get more info take a look at Window::Flush()
See Also
Sync(), Window::Flush()
Author
Kurt Skauen (kurt@.nosp@m.athe.nosp@m.os.cx)

References GetWindow(), and os::Window::Sync().

Referenced by os::Slider::FrameSized(), os::TextEdit::MaybeDrawString(), os::RadioMenu::MouseUp(), os::TextEdit::Paint(), os::ListView::RefreshLayout(), os::Splash::SetBgColor(), SplashView::SetEnable(), os::Splash::SetFont(), SplashView::SetFont(), SplashView::SetImage(), SplashView::SetText(), and SplashView::SetTextColor().

int View::ToggleDepth ( void  )
virtual
void View::ViewScrolled ( const Point cDelta)
virtual
Description:
Overload this member if you need to know when the views content has been scrolled with the ScrollBy() or ScrollTo() members.
See the ScrollBy() documentation for more details on scrolling.
Note:
This member is called after the view has been scrolled. If you need the old scroll offset you can subtract the cDelta value from the current scroll offset.
Parameters
cDeltaThe distance the view was scrolled.
See Also
ScrollBy(), ScrollTo(), GetScrollOffset()
Author
Kurt Skauen (kurt@.nosp@m.athe.nosp@m.os.cx)

Referenced by ScrollBy().

void View::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 in os::IconView::MainView, os::DropdownMenu, os::Spinner, os::TextView, os::ScrollBar, and os::DropdownMenu::DropdownView.

References os::View::Private::m_pcParent, and WheelMoved().

Referenced by os::Window::DispatchMessage(), os::ScrollBar::WheelMoved(), os::TextView::WheelMoved(), and WheelMoved().

float View::Width ( void  ) const
void View::WindowActivated ( bool  bIsActive)
virtual
Description:
This is a callback member that can be overloaded by derived classes to learn when the window that this view is hosted by is activated and when it is deactivated. The bIsActive parameter tell whether the focus was lost or gained. This member is called whenever the window changes focus independent of whether the view is active or not.
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 window gain and false if it loose focus.
See Also
MakeFocus(), Activated()
Author
Kurt Skauen (kurt@.nosp@m.athe.nosp@m.os.cx)

Reimplemented in os::IconView::MainView, and os::Menu.

Friends And Related Function Documentation

friend class Font
friend

Referenced by SetFont(), and View().

friend class ScrollBar
friend
friend class Window
friend