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

os::Button Class Reference

Simple push-button class. More...

#include <button.h>

Inheritance diagram for os::Button:

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

Public Methods

 Button (Rect cFrame, const char *pzName, const char *pzLabel, Message *pcMessage, uint32 nResizeMask=CF_FOLLOW_LEFT|CF_FOLLOW_TOP, uint32 nFlags=WID_WILL_DRAW|WID_CLEAR_BACKGROUND|WID_FULL_UPDATE_ON_RESIZE)
 ~Button ()
virtual Point GetPreferredSize (bool bLargest) const
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 Activated (bool bIsActive)
 Hook called when the view gain or loose focus. More...

virtual void Paint (const Rect &cUpdateRect)
 Called by the system update "damaged" areas of the view. More...


Detailed Description

Simple push-button class.

Description:
A button object renders a labeled button and accept user-input through the mouse or keyboard. The button will Invoke() the Control if the user click it with the mouse or hit space or enter while the button have focus (it will take focus when clicked). Each window can have a "default" button assigned with the os::Window::SetDefaultButton() member. The default button can be invoked with the Enter key even when it don't have the focus.

See also:
Control, Invoker, View
Author(s):
Kurt Skauen (kurt@atheos.cx)


Constructor & Destructor Documentation

Button::Button ( Rect cFrame,
const char * pzName,
const char * pzLabel,
Message * pcMessage,
uint32 nResizeMask = CF_FOLLOW_LEFT | CF_FOLLOW_TOP,
uint32 nFlags = WID_WILL_DRAW | WID_CLEAR_BACKGROUND | WID_FULL_UPDATE_ON_RESIZE )
 

Button::~Button ( )
 


Member Function Documentation

void Button::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 from os::View.

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

Reimplemented from os::View.

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

Reimplemented from os::View.

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

Reimplemented from os::View.

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

Reimplemented from os::View.

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

Reimplemented from os::View.

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

Reimplemented from os::View.

void Button::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 from os::View.


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