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

os::View Class Reference

Base class for all GUI components. More...

#include <view.h>

Inheritance diagram for os::View:

os::Handler os::AlertView os::Control os::DropdownMenu os::LayoutView os::ListView os::ListViewCol os::ListViewContainer os::ListViewHeader os::Menu os::ProgressBar os::ProgressView os::Spinner os::StringView os::TableView os::TabView os::TextEdit os::TextView List of all members.

Public Methods

 View (const Rect &cFrame, const std::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)
virtual void MouseDown (const Point &cPosition, uint32 nButtons)
virtual void MouseUp (const Point &cPosition, uint32 nButtons, Message *pcData)
virtual void KeyDown (const char *pzString, const char *pzRawString, uint32 nQualifiers)
virtual void KeyUp (const char *pzString, const char *pzRawString, uint32 nQualifiers)
virtual void FrameMoved (const Point &cDelta)
virtual void FrameSized (const Point &cDelta)
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 AddChild (View *pcView, bool bAssignTabOrder=false)
void RemoveChild (View *pcChild)
void RemoveThis ()
View* GetChildAt (const Point &cPos)
View* GetChildAt (int nIndex)
View* GetParent () const
ScrollBarGetVScrollBar () const
ScrollBarGetHScrollBar () const
WindowGetWindow () const
std::string GetTitle () const
virtual int GetTabOrder ()
 Get the keybord manouvering order. More...

virtual void SetTabOrder (int nOrder)
 Set the keyboard manouvering sorting order. More...

uint32 GetQualifiers () const
void GetMouse (Point *pcPosition, uint32 *pnButtons)
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)
void SetFlags (uint32 nFlags)
uint32 GetFlags (uint32 nMask=~0L) const
void Show (bool bVisible=true)
 Show/hide a view and all it's children. More...

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)
virtual void MoveBy (float vDeltaX, float vDeltaY)
virtual void MoveTo (const Point &cPos)
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)
virtual void ResizeTo (float W, float H)
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=0)
void SetFgColor (Color32_s sColor)
Color32_s GetFgColor () const
void SetBgColor (int nRed, int nGreen, int nBlue, int nAlpha=0)
void SetBgColor (Color32_s sColor)
Color32_s GetBgColor () const
void SetEraseColor (int nRed, int nGreen, int nBlue, int nAlpha=0)
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
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)
void EraseRect (const Rect &cRect)
void DrawFrame (const Rect &cRect, uint32 nFlags)
void DrawChar (int nChar)
void DrawChar (int nChar, const Point &cPos)
void DrawString (const char *pzString)
void DrawString (const char *pString, int nLength)
void DrawString (const std::string &cString)
void DrawString (const char *pzString, const Point &cPos)
void DrawString (const char *pString, int nLength, const Point &cPos)
void DrawString (const std::string &cString, const Point &cPos)
void GetTruncatedStrings (const char **pazStringArray, int nStringCount, uint32 nMode, float nWidth, char **pazResultArray) const
float GetStringWidth (const char *pzString) const
float GetStringWidth (const char *pzString, int nLength) const
float GetStringWidth (const std::string &cString) const
void GetStringWidths (const char **apzStringArray, const int *anLengthArray, int nStringCount, float *avWidthArray) const
int GetStringLength (const char *pzString, float vWidth, bool bIncludeLast=false) const
int GetStringLength (const char *pzString, int nLength, float vWidth, bool bIncludeLast=false) const
int GetStringLength (const std::string &cString, 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)
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(s):
Kurt Skauen (kurt@atheos.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

Friends

class  Window
class  ScrollBar
class  Font

Detailed Description

Base class for all GUI components.

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(s):
Kurt Skauen (kurt@atheos.cx)


Constructor & Destructor Documentation

View::View ( const Rect & cFrame,
const std::string & cTitle,
uint32 nResizeMask = CF_FOLLOW_LEFT | CF_FOLLOW_TOP,
uint32 nFlags = WID_WILL_DRAW | WID_CLEAR_BACKGROUND )
 

View constructor.

Parameters:
cFrame   The frame rectangle in the parents coordinate system.
pzTitle   The logical name of the view. This parameter is newer rendered anywhere, but is passed to the Handler::Handler() constructor to identify the view.
nResizeMask   Flags defining how the views frame rectangle is affected if the parent view is resized.
nFlags   Various flags to control the views behavour.

See also:
os::view_flags, os::view_resize_flags, Handler::Handler()
Author(s):
Kurt Skauen (kurt@atheos.cx)

View::~View ( ) [virtual]
 

View destructor.

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(s):
Kurt Skauen (kurt@atheos.cx)


Member Function Documentation

void View::Activated ( bool bIsActive ) [virtual]
 

Hook called when the view gain or loose focus.

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(s):
Kurt Skauen (kurt.skauen@c2i.net)

Reimplemented in os::Button, and os::TextEdit.

void View::AddChild ( View * pcChild,
bool bAssignTabOrder = false ) [virtual]
 

void View::AllAttached ( void ) [virtual]
 

Reimplemented in os::DropdownMenu, os::LayoutView, os::ListView, os::AlertView, os::Spinner, os::TableView, and os::TabView.

void View::AllDetached ( ) [virtual]
 

void View::AttachedToWindow ( void ) [virtual]
 

Reimplemented in os::Control, os::DirectoryView, os::FrameView, os::Menu, os::ProgressBar, os::RadioButton, os::Slider, os::StringView, and os::TableView.

void View::BeginDrag ( Message * pcData,
const Point & cHotSpot,
const Rect & cBounds,
Handler * pcReplyHandler = NULL )
 

void View::BeginDrag ( Message * pcData,
const Point & cHotSpot,
const Bitmap * pcBitmap,
Handler * pcReplyHandler = NULL )
 

Start a drag and drop operation.

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:
pcData   A os::Message object containing the data to be dragged.
cHotSpot   Mouse position relative to the visible representation of the dragged object.
pcBitmap   A bitmap that will be used as the visible representation of the dragged data. The bitmap can have an alpha channel.
cBounds   And 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.
pcReplyHandler   The handler that should receive replies sendt by the receiver of the dragged data.
See also:
MouseMove(), MouseUp(), os::Message, os::Handler
Author(s):
Kurt Skauen (kurt@atheos.cx)

void View::ConvertFromParent ( Rect * pcRect ) const
 

Rect View::ConvertFromParent ( const Rect & cRect ) const
 

void View::ConvertFromParent ( Point * pcPoint ) const
 

Point View::ConvertFromParent ( const Point & cPoint ) const
 

void View::ConvertFromScreen ( Rect * pcRect ) const
 

Rect View::ConvertFromScreen ( const Rect & cRect ) const
 

void View::ConvertFromScreen ( Point * pcPoint ) const
 

Point View::ConvertFromScreen ( const Point & cPoint ) const
 

void View::ConvertFromWindow ( Rect * pcRect ) const
 

Rect View::ConvertFromWindow ( const Rect & cRect ) const
 

void View::ConvertFromWindow ( Point * pcPoint ) const
 

Point View::ConvertFromWindow ( const Point & cPoint ) const
 

void View::ConvertToParent ( Rect * pcRect ) const
 

Rect View::ConvertToParent ( const Rect & cRect ) const
 

void View::ConvertToParent ( Point * pcPoint ) const
 

Translate a os::Point into our parents coordinate system.

Modifying the passet Point object

Point View::ConvertToParent ( const Point & cPoint ) const
 

Translate a os::Point into our parents coordinate system.

Returning the the result

void View::ConvertToScreen ( Rect * pcRect ) const
 

Rect View::ConvertToScreen ( const Rect & cRect ) const
 

void View::ConvertToScreen ( Point * pcPoint ) const
 

Point View::ConvertToScreen ( const Point & cPoint ) const
 

void View::ConvertToWindow ( Rect * pcRect ) const
 

Rect View::ConvertToWindow ( const Rect & cRect ) const
 

void View::ConvertToWindow ( Point * pcPoint ) const
 

Point View::ConvertToWindow ( const Point & cPoint ) const
 

void View::DetachedFromWindow ( void ) [virtual]
 

Reimplemented in os::DirectoryView, and os::Menu.

void View::DrawBitmap ( const Bitmap * pcBitmap,
const Rect & cSrcRect,
const Rect & cDstRect )
 

void os::View::DrawChar ( int nChar,
const Point & cPos ) [inline]
 

void os::View::DrawChar ( int nChar ) [inline]
 

void View::DrawFrame ( const Rect & a_cRect,
uint32 nStyle )
 

void View::DrawLine ( const Point & cFromPnt,
const Point & cToPnt )
 

void View::DrawLine ( const Point & cToPnt )
 

void View::DrawString ( const std::string & cString,
const Point & cPos )
 

void View::DrawString ( const char * pzString,
int nLength,
const Point & cPos )
 

void View::DrawString ( const char * pzString,
const Point & cPos )
 

void View::DrawString ( const std::string & cString )
 

void View::DrawString ( const char * pString,
int nLength )
 

void View::DrawString ( const char * pzString )
 

void View::EraseRect ( const Rect & cRect )
 

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

void View::FillRect ( const Rect & cRect )
 

void View::Flush ( void )
 

Flush the render queue.

Description:
Call the window's Flush() member to flush the render queue.

If the view is not attached to a window, this member do nothing.

To get more info take a look at Window::Flush()

See also:
Sync(), Window::Flush()
Author(s):
Kurt Skauen (kurt.skauen@c2i.net)

void View::FontChanged ( Font * pcNewFont ) [virtual]
 

Called to notify the view that the font has changed.

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(s):
Kurt Skauen (kurt@atheos.cx)

Reimplemented in os::FrameView, os::TextView, and os::TextEdit.

void View::FrameMoved ( const Point & cDelta ) [virtual]
 

void View::FrameSized ( const Point & cDelta ) [virtual]
 

Reimplemented in os::DropdownMenu, os::FrameView, os::LayoutView, os::ListView, os::Menu, os::ProgressBar, os::ProgressView, os::Slider, os::Spinner, os::TableView, os::TabView, os::TextView, and os::TextEdit.

Color32_s View::GetBgColor ( ) const
 

Rect View::GetBounds ( ) const
 

View * View::GetChildAt ( int nIndex )
 

View * View::GetChildAt ( const Point & cPos )
 

Point View::GetContentSize ( ) const [virtual]
 

drawing_mode View::GetDrawingMode ( ) const
 

Color32_s View::GetEraseColor ( ) const
 

Color32_s View::GetFgColor ( ) const
 

uint32 View::GetFlags ( uint32 nMask = ~0L ) const
 

Font * os::View::GetFont ( ) const [inline]
 

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 )
 

Rect View::GetNormalizedBounds ( ) const
 

View * View::GetParent ( void ) const
 

Point View::GetPenPosition ( ) const
 

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

Reimplemented in os::Button, os::CheckBox, os::DropdownMenu, os::FrameView, os::LayoutView, os::Menu, os::ProgressBar, os::RadioButton, os::ScrollBar, os::Slider, os::Spinner, os::StringView, os::TableView, os::TabView, os::TextView, and os::TextEdit.

uint32 View::GetQualifiers ( ) const
 

Point View::GetScrollOffset ( void ) const
 

int View::GetStringLength ( const std::string & cString,
float vWidth,
bool bIncludeLast = false ) const
 

int View::GetStringLength ( const char * pzString,
int nLength,
float vWidth,
bool bIncludeLast = false ) const
 

int View::GetStringLength ( const char * pzString,
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 std::string & cString ) const
 

float View::GetStringWidth ( const char * pzString,
int nLength ) const
 

float View::GetStringWidth ( const char * pzString ) const
 

void os::View::GetStringWidths ( const char ** apzStringArray,
const int * anLengthArray,
int nStringCount,
float * avWidthArray ) const
 

int View::GetTabOrder ( ) [virtual]
 

Get the keybord manouvering order.

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(s):
Kurt Skauen (kurt.skauen@c2i.net)

std::string View::GetTitle ( ) 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]
 

Reimplemented in os::ListView.

float View::Height ( ) const
 

void View::Invalidate ( bool bRecurse = false )
 

Invalidate the whole view.

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(s):
Kurt Skauen (kurt.skauen@c2i.net)

void View::Invalidate ( const Rect & cRect,
bool bRecurse = false )
 

Add a rectangle to the damage list.

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:
cRect   The rectangle to invalidate.
bRecurse   If true cRect will also be converted into each children's coordinate system and added to their damage list.

See also:
Invalidate( bool ), Paint()
Author(s):
Kurt Skauen (kurt.skauen@c2i.net)

bool View::IsVisible ( ) const
 

void View::KeyDown ( const char * pzString,
const char * pzRawString,
uint32 nQualifiers ) [virtual]
 

Reimplemented in os::Button, os::DirectoryView, os::DropdownMenu, os::ListView, os::Menu, os::TabView, os::TextView, and os::TextEdit.

void View::KeyUp ( const char * pzString,
const char * pzRawString,
uint32 nQualifiers ) [virtual]
 

Reimplemented in os::Button.

void View::MakeFocus ( bool bFocus = true ) [virtual]
 

Reimplemented in os::Control.

void View::MouseDown ( const Point & cPosition,
uint32 nButton ) [virtual]
 

Reimplemented in os::Button, os::CheckBox, os::DropdownMenu, os::Menu, os::RadioButton, os::ScrollBar, os::Slider, os::Spinner, os::TabView, and os::TextEdit.

void View::MouseMove ( const Point & cPosition,
int nCode,
uint32 nButtons,
Message * pcData ) [virtual]
 

Reimplemented in os::Button, os::DirectoryView, os::Menu, os::ScrollBar, os::Slider, os::Spinner, os::TabView, and os::TextEdit.

void View::MouseUp ( const Point & cPosition,
uint32 nButtons,
Message * pcData ) [virtual]
 

Reimplemented in os::Button, os::CheckBox, os::DirectoryView, os::Menu, os::RadioButton, os::ScrollBar, os::Slider, os::Spinner, os::TabView, and os::TextEdit.

void View::MoveBy ( float vDeltaX,
float vDeltaY ) [virtual]
 

void View::MoveBy ( const Point & cDelta ) [virtual]
 

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

void View::MovePenBy ( const Point & cPos )
 

void os::View::MovePenTo ( float x,
float y ) [inline]
 

void View::MovePenTo ( const Point & cPos )
 

void View::MoveTo ( float x,
float y ) [virtual]
 

void View::MoveTo ( const Point & cPos ) [virtual]
 

void View::Paint ( const Rect & cUpdateRect ) [virtual]
 

Called by the system update "damaged" areas of the view.

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(s):
Kurt Skauen (kurt@atheos.cx)

Reimplemented in os::Button, os::CheckBox, os::DropdownMenu, os::FrameView, os::ListView, os::ListViewCol, os::Menu, os::ProgressBar, os::RadioButton, os::AlertView, os::ProgressView, os::ScrollBar, os::Slider, os::StringView, os::TableView, os::TabView, os::TextView, and os::TextEdit.

void View::Ping ( int nSize = 0 )
 

void View::RemoveChild ( View * pcChild )
 

void View::RemoveThis ( void )
 

void View::ResizeBy ( float vDeltaW,
float vDeltaH ) [virtual]
 

void View::ResizeBy ( const Point & cDelta ) [virtual]
 

void View::ResizeTo ( float w,
float h ) [virtual]
 

void View::ResizeTo ( const Point & cSize ) [virtual]
 

void os::View::ScrollBy ( float vDeltaX,
float vDeltaY ) [inline, virtual]
 

void View::ScrollBy ( const Point & cDelta ) [virtual]
 

void View::ScrollRect ( const Rect & cSrcRect,
const Rect & cDstRect )
 

Copy a rectangle from one location to another within the view.

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:
cSrcRect   The source rectangle in the views coordinate system.
cSrcRect   The 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(s):
Kurt Skauen (kurt@atheos.cx)

void os::View::ScrollTo ( float x,
float y ) [inline, virtual]
 

void View::ScrollTo ( Point cTopLeft ) [virtual]
 

void View::SetBgColor ( Color32_s sColor )
 

void View::SetBgColor ( int nRed,
int nGreen,
int nBlue,
int nAlpha = 0 )
 

void View::SetDrawingMode ( drawing_mode eMode )
 

void View::SetEraseColor ( Color32_s sColor )
 

void View::SetEraseColor ( int nRed,
int nGreen,
int nBlue,
int nAlpha = 0 )
 

void View::SetFgColor ( Color32_s sColor )
 

void View::SetFgColor ( int nRed,
int nGreen,
int nBlue,
int nAlpha = 0 )
 

void View::SetFlags ( uint32 nFlags )
 

void View::SetFont ( Font * pcFont )
 

Change the views text font.

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:
pcFont   Pointer to the new font. It's reference count will be increased by one.

See also:
DrawString(), os::Font
Author(s):
Kurt Skauen (kurt@atheos.cx)

void View::SetFrame ( const Rect & cRect,
bool bNotifyServer = true ) [virtual]
 

Set the size and position relative to the parent view.

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:
cRect   The new frame rectangle.
See also:
ResizeTo(), ResizeBy(), MoveTo(), MoveBy()
Author(s):
Kurt Skauen (kurt@atheos.cx)

void View::SetMousePos ( const Point & cPosition )
 

void View::SetTabOrder ( int nOrder ) [virtual]
 

Set the keyboard manouvering sorting order.

Description:
Set the value that will be returned by GetTabOrder().
Parameters:
nOrder   - The sorting order.
See also:
GetTabOrder()
Author(s):
Kurt Skauen (kurt.skauen@c2i.net)

Reimplemented in os::TextView.

void View::Show ( bool bVisible = true )
 

Show/hide a view and all it's children.

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(s):
Kurt Skauen (kurt.skauen@c2i.net)

void View::Sync ( void )
 

Flush the render queue.

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

To get more info take a look at Window::Flush()

See also:
Sync(), Window::Flush()
Author(s):
Kurt Skauen (kurt.skauen@c2i.net)

int View::ToggleDepth ( void ) [virtual]
 

float View::Width ( ) const
 

void View::WindowActivated ( bool bIsActive ) [virtual]
 

Hook called when the window hosting this view gain or loose focus.

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(s):
Kurt Skauen (kurt.skauen@c2i.net)

Reimplemented in os::Control, and os::Menu.


Friends And Related Function Documentation

class Font [friend]
 

class ScrollBar [friend]
 

class Window [friend]
 


The documentation for this class was generated from the following files:
Generated at Sat Apr 7 16:11:44 2001 for AtheOS higlevel API by doxygen1.2.5 written by Dimitri van Heesch, © 1997-2001