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

os::Spinner Class Reference

#include <spinner.h>

Inheritance diagram for os::Spinner::

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

Public Methods

 Spinner (Rect cFrame, const char *pzName, double vValue, Message *pcMessage, uint32 nResizeMask=CF_FOLLOW_LEFT|CF_FOLLOW_TOP, uint32 nFlags=WID_WILL_DRAW|WID_CLEAR_BACKGROUND)
void SetEnable (bool bEnabled=true)
bool IsEnabled () const
void SetFormat (const char *pzStr)
const std::string & GetFormat () const
void SetMinValue (double vValue)
void SetMaxValue (double vValue)
void SetMinMax (double vMin, double vMax)
void SetStep (double vStep)
void SetScale (double vScale)
void SetMinPreferredSize (int nWidthChars)
void SetMaxPreferredSize (int nWidthChars)
double GetMinValue () const
double GetMaxValue () const
double GetStep () const
double GetScale () const
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 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 AllAttached ()
virtual void HandleMessage (Message *pcMessage)
 Handle a message targeted at this handler. More...

virtual void Paint (const os::Rect &cUpdateRect)
virtual void FrameSized (const Point &cDelta)
 Virtual hook called by the system when the view is resized. More...

virtual Point GetPreferredSize (bool bLargest) const

Protected Methods

virtual std::string FormatString (double vValue)

Detailed Description

Description:
See also:
Author:
Kurt Skauen (kurt@atheos.cx)


Constructor & Destructor Documentation

Spinner::Spinner Rect cFrame,
const char * pzName,
double vValue,
Message * pcMessage,
uint32 nResizeMask = CF_FOLLOW_LEFT | CF_FOLLOW_TOP,
uint32 nFlags = WID_WILL_DRAW | WID_CLEAR_BACKGROUND
 


Member Function Documentation

void Spinner::AllAttached void [virtual]
 

Reimplemented from os::View.

void Spinner::EnableStatusChanged bool bIsEnabled [virtual]
 

Reimplemented from os::Control.

std::string Spinner::FormatString double vValue [protected, virtual]
 

void Spinner::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 (kurt@atheos.cx)

Reimplemented from os::View.

const std::string & Spinner::GetFormat const
 

double Spinner::GetMaxValue const
 

double Spinner::GetMinValue const
 

Point Spinner::GetPreferredSize bool bLargest const [virtual]
 

Reimplemented from os::View.

double Spinner::GetScale const
 

double Spinner::GetStep const
 

void Spinner::HandleMessage Message * pcMessage [virtual]
 

Description:
Overload this member to dispatch messages sendt to this handler. When a looper receives a message for one of it's handlers it will call the taget handlers HandleMessage() to allow the handler to dispatch the message.

The message passed in pcMessage is also available through os::Looper::GetCurrentMessage() and os::Looper::DetachCurrentMessage() until this member returns. This is normally not very usefull for HandleMessage() itself but it can be convinient for other members called from HandleMessage() in case they need data from the message that was not passed on from HandleMessage().

The looper will be locked when this member is called. The default implementation of this member will pass the message on to the next handler if one was set with SetNextHandler().

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.
Parameters:
pcMessage   The message that should be handled. This message will be deleted by the looper when HandleMessage() returns unless you detach it with os::Looper::DetachCurrentMessage(),
See also:
os::Looper::DispatchMessage(), os::Looper::DetachCurrentMessage()
Author:
Kurt Skauen (kurt@atheos.cx)

Reimplemented from os::Handler.

bool Spinner::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 (kurt@atheos.cx)

Reimplemented from os::Control.

bool Spinner::IsEnabled void const [virtual]
 

Reimplemented from os::Control.

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

Reimplemented from os::Control.

void Spinner::MouseDown const Point & cPosition,
uint32 nButton
[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 (kurt@atheos.cx)

Reimplemented from os::View.

void Spinner::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 (kurt@atheos.cx)

Reimplemented from os::View.

void Spinner::MouseUp const Point & cPosition,
uint32 nButton,
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 (kurt@atheos.cx)

Reimplemented from os::View.

void Spinner::Paint const os::Rect & cUpdateRect [virtual]
 

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

Reimplemented from os::Control.

void Spinner::SetEnable bool bEnabled = true [virtual]
 

Reimplemented from os::Control.

void Spinner::SetFormat const char * pzStr
 

void Spinner::SetMaxPreferredSize int nWidthChars
 

void Spinner::SetMaxValue double VValue
 

void os::Spinner::SetMinMax double vMin,
double vMax
[inline]
 

void Spinner::SetMinPreferredSize int nWidthChars
 

void Spinner::SetMinValue double VValue
 

void Spinner::SetScale double vScale
 

void Spinner::SetStep double vStep
 

void Spinner::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 (kurt@atheos.cx)

Reimplemented from os::View.


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