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

os::ScrollBar Class Reference

#include <scrollbar.h>

Inheritance diagram for os::ScrollBar::

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

Public Methods

 ScrollBar (const Rect &cFrame, const char *pzName, Message *pcMsg, float vMin=0, float vMax=FLT_MAX, int nOrientation=VERTICAL, uint32 nResizeMask=0)
 ~ScrollBar ()
void SetScrollTarget (View *pcTarget)
ViewGetScrollTarget (void)
virtual void PostValueChange (const Variant &cNewValue)
virtual void LabelChanged (const std::string &cNewLabel)
virtual void EnableStatusChanged (bool bIsEnabled)
virtual bool Invoked (Message *pcMessage)
 Intercept outgoing messages. More...

virtual void FrameSized (const Point &cDelta)
 Virtual hook called by the system when the view is resized. 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 WheelMoved (const Point &cDelta)
 Hook called by the system when the scroll-wheel is rotated. More...

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

virtual Point GetPreferredSize (bool bLargest) const
virtual void TimerTick (int nID)
 Timer dispatch member. More...

void SetSteps (float vSmall, float vBig)
void GetSteps (float *pvSmall, float *pvBig) const
void SetMinMax (float vMin, float vMax)
void SetProportion (float vProp)
float GetProportion () const

Detailed Description

Description:
See also:
Author:
Kurt Skauen ([email protected])


Constructor & Destructor Documentation

ScrollBar::ScrollBar const Rect & cFrame,
const char * pzName,
Message * pcMsg,
float vMin = 0,
float vMax = FLT_MAX,
int nOrientation = VERTICAL,
uint32 nResizeMask = 0
 

ScrollBar::~ScrollBar
 


Member Function Documentation

void ScrollBar::EnableStatusChanged bool bIsEnabled [virtual]
 

Reimplemented from os::Control.

void ScrollBar::FrameSized const Point & cDelta [virtual]
 

Description:
Overload this member if you need to know when the view is resized.
Note:
This member is called after the view is resized. If you need the old size you can subtract the cDelta calue from the current size.
Parameters:
cDelta   The distance the bottom/right corner was moved relative to the upper/left corner.
See also:
FrameMoved(), SetFrame, ResizeBy(), ResizeTo()
Author:
Kurt Skauen ([email protected])

Reimplemented from os::View.

Point ScrollBar::GetPreferredSize bool bLargest const [virtual]
 

Reimplemented from os::View.

float ScrollBar::GetProportion const
 

View * ScrollBar::GetScrollTarget void
 

void ScrollBar::GetSteps float * pvSmall,
float * pvBig
const
 

bool ScrollBar::Invoked Message * pcMessage [virtual]
 

Description:
This member is called from Invoke() just before a message is sendt to the target.

This allow classes that inherits from os::Invoker to add data to or otherwhice modify the message before it is sendt. The message can also be canceled entirely by returning false from this member.

The message passed to Invoked() is a copy of the internal message or the message passed to Invoke() (if any) so any changes made here will not affect the internal message or the message passed to Invoke(). When this method returns the message will imidiatly be sendt to the target and then discarded (unless false is returned in which case the message is simply discarded).

The default implementation of this member does nothing and return true.

Parameters:
pcMessage   Pointer to the message that is about to be sendt. You can do any modification you like to this message (but never delete it).
Returns:
Normally you should return true to indicate that the message should be sendt. You can however return false if you for some reason want to cancel the invokation.
See also:
Invoke(), SetMessage(), SetTarget()
Author:
Kurt Skauen ([email protected])

Reimplemented from os::Control.

void ScrollBar::LabelChanged const std::string & cNewLabel [virtual]
 

Reimplemented from os::Control.

void ScrollBar::MouseDown const Point & cPosition,
uint32 nButtons
[virtual]
 

Description:
This member is called from the window thread whenever a mouse button is clicked above the view. You can overload this member if your view need to know about mouse-down events.

A view will not automatically take focus when clicked so if you want that behaviour you must call MakeFocus() from an overloaded version of this member.

The default implementation of this member will call MouseDown() on it's parent view if one exists.

Parameters:
cPosition   Mouse position in the views coordinate system at the time the mouse was pressed.
nButtons   Index of the pressed button. Buttons start at 1 for the left button, 2 for the right button, 3 for the middle button. Additional buttons might be supported by the mouse driver and will then be assigned numbers from 4 and up.

See also:
MouseUp(), MouseMove(), WheelMoved()
Author:
Kurt Skauen ([email protected])

Reimplemented from os::View.

void ScrollBar::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 have focus.

Oveload this member if your view need to handle mouse-move events.

The default implementation of this member will call MouseMove() on it's parent view if one exists.

Parameters:
cNewPos   New mouse position given in the views coordinate system.
nCode   Enter/exit code. This is MOUSE_ENTERED when the mouse first enter the view, MOUSE_EXITED when the mouse leaves the view, MOUSE_INSIDE whenever the mouse move withing the boundary of the view and MOUSE_OUTSIDE when the mouse move outside the view (will only happen if the view have focus).
nButtons   Bitmask telling which buttons that are currently pressed. Bit 0 is button 1 (left), bit 1 is button 2 (right), and bit 2 is button 3 (middle), and so on.
pcData   Pointer to a Message object containing the dragged data if the user is in the middle of a drag and drop operation. Otherwise this pointer is NULL. Look at BeginDrag() for a more detailed description of the drag and drop system.

See also:
MouseDown(), MouseUp(), WheelMoved(), BeginDrag()
Author:
Kurt Skauen ([email protected])

Reimplemented from os::View.

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

Description:
This member is called from the window thread whenever a mouse button is released above the view. You can overload this member if your view need to know about mouse-up events or if your view support drag and drop.

If mouse-up was the result of ending a drag and drop operation the pcData member will point to a Message containing the dragged data. Look at BeginDrag() for a more detailed description of the drag and drop system.

The default implementation of this member will call MouseDown() on it's parent view if one exists.

Parameters:
cPosition   Mouse position in the views coordinate system at the time the mouse was pressed.
nButtons   Index of the pressed button. Buttons start at 1 for the left button, 2 for the right button, 3 for the middle button. Additional buttons might be supported by the mouse driver and will then be assigned numbers from 4 and up.
pcData   Pointer to a Message object containing the dragged data if this mouse-up was the end of a drag and drop operation. If no data was dragged it will be NULL.

See also:
MouseDown(), MouseMove(), WheelMoved()
Author:
Kurt Skauen ([email protected])

Reimplemented from os::View.

void ScrollBar::Paint const Rect & cUpdateRect [virtual]
 

Description:
Note:
Warning:
Parameters:
cUpdateRect   A rectangle enclosing all damaged areas. This is just a rough "worst-case", further fine-grained clipping will be performed by the Application Server to avoid updating non-damaged pixels and make the update as fast and flicker-free as possible.

See also:
Invalidate(), Flush()
Author:
Kurt Skauen ([email protected])

Reimplemented from os::View.

void ScrollBar::PostValueChange const Variant & cNewValue [virtual]
 

Reimplemented from os::Control.

void ScrollBar::SetMinMax float vMin,
float vMax
 

void ScrollBar::SetProportion float vProp
 

void ScrollBar::SetScrollTarget View * pcTarget
 

void ScrollBar::SetSteps float vSmall,
float vBig
 

void ScrollBar::TimerTick int nID [virtual]
 

Description:
This member will be called by the looper thread when a timer targeting this handler expires.

When a timer created with os::Looper::AddTimer() expires the looper thread will lock the looper and call this member on the target for the expired timer. If more than one timers are created it is possible to distinguish them by the timer ID that is assigned to the timer with os::Looper::AddTimer() and that is passed to TimerTick() through the nID parameter.

Note:
Never do any lenthy operations in any hook members that are called from the looper thread if the looper is involved with the GUI (for example if the looper is a os::Window). The looper will not be able to dispatch messages until the hook returns so spending a long time in this members will make the GUI feel unresponsive.
Warning:
Parameters:
return  
Error codes:
See also:
Author:
Kurt Skauen ([email protected])

Reimplemented from os::Handler.

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

Reimplemented from os::View.


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