os::ScrollBar Class Reference
[The Syllable Graphical User Interface API]

Description:
The os::ScrollBar is one object that is used in a lot of other GUI elements.
More...

Inheritance diagram for os::ScrollBar:

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

Public Member Functions

 ScrollBar (const Rect &cFrame, const String &cName, Message *pcMsg, float vMin=0, float vMax=FLT_MAX, int nOrientation=VERTICAL, uint32 nResizeMask=0)
 libSyllable os::ScrollBar
 ~ScrollBar ()
 libSyllable os::ScrollBar
void SetScrollTarget (View *pcTarget)
 Sets the target that the ScrollBar sends messages to.
ViewGetScrollTarget (void)
 Gets the target that the ScrollBar sends messages to.
virtual void PostValueChange (const Variant &cNewValue)
virtual void LabelChanged (const String &cNewLabel)
virtual void EnableStatusChanged (bool bIsEnabled)
virtual bool Invoked (Message *pcMessage)
 Intercept outgoing messages.
virtual void FrameSized (const Point &cDelta)
 Virtual hook called by the system when the view is resized.
virtual void MouseMove (const Point &cNewPos, int nCode, uint32 nButtons, Message *pcData)
 Hook called by the system when the mouse is moved.
virtual void MouseDown (const Point &cPosition, uint32 nButtons)
 Hook called by the system when a mouse button is pressed.
virtual void MouseUp (const Point &cPosition, uint32 nButtons, Message *pcData)
 Hook called by the system when a mouse button is release.
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.
virtual void WheelMoved (const Point &cDelta)
 Hook called by the system when the scroll-wheel is rotated.
virtual void Activated (bool bIsActive)
 Hook called when the view gain or loose focus.
virtual void Paint (const Rect &cUpdateRect)
 Called by the system update "damaged" areas of the view.
virtual Point GetPreferredSize (bool bLargest) const
virtual void TimerTick (int nID)
 Timer dispatch member.
void SetSteps (float vSmall, float vBig)
 Sets the steps.
void GetSteps (float *pvSmall, float *pvBig) const
 Gets the steps.
void SetMinMax (float vMin, float vMax)
 Sets the minimum/maximum step.
void SetProportion (float vProp)
 Sets the propotion.
float GetProportion () const
 Gets the propotion.

Classes

class  Private
 internal More...

Detailed Description

It adds scrolling to an element.
See also:
Author:
Kurt Skauen ([email protected])


Constructor & Destructor Documentation

ScrollBar::ScrollBar ( const Rect cFrame,
const String cName,
Message pcMsg,
float  vMin = 0,
float  vMax = FLT_MAX,
int  nOrientation = VERTICAL,
uint32  nResizeMask = 0 
)

Description:
ScrollBar constructor.
Parameters:
cFrame - The size and position of the ScrollBar
cName - The name of the ScrollBar.
pcMsg - The message for the ScrollBar. Used to pass messages to your element
vMin - The minimum tick for the ScrollBar
vMax - The maximum tick for the ScrollBar
nOrientation - The position of the ScrollBar(use os::VERTICAL or os::HORIZONTAL)
nResizeMask - Determines what way the ScrollBar will follow the rest of the window. Default is CF_FOLLOW_LEFT|CF_FOLLOW_TOP.
Author:
Kurt Skauen with modifications by Rick Caudill([email protected])

ScrollBar::~ScrollBar (  ) 

Description:
The destructor for the ScrollBar. Just sets the target's scrollbar property to NULL
Author:
Kurt Skauen with modifications by Rick Caudill([email protected])


Member Function Documentation

void ScrollBar::SetScrollTarget ( View pcTarget  ) 

Description:
Sets the target that the ScrollBar sends messages to.
Parameters:
pcTarget - the target os::View
Author:
Kurt Skauen

View * ScrollBar::GetScrollTarget ( void   ) 

Description:
Gets the target that the ScrollBar sends messages to.
Author:
Kurt Skauen

void ScrollBar::PostValueChange ( const Variant cNewValue  )  [virtual]

Reimplemented from os::Control.

void ScrollBar::LabelChanged ( const String cNewLabel  )  [virtual]

Reimplemented from os::Control.

void ScrollBar::EnableStatusChanged ( bool  bIsEnabled  )  [virtual]

Implements os::Control.

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::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.

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 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:
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 has 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::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::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::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:
pzString String 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.
pzRawString Same 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'.
nQualifiers Bitmask describing which qualifiers that was active when the key was pressed.
See also:
KeyUp(), os::Looper::GetCurrentMessage()
Author:
Kurt Skauen ([email protected])

Reimplemented from os::View.

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.

void ScrollBar::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 ([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.

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

Reimplemented from os::View.

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::SetSteps ( float  vSmall,
float  vBig 
)

..

Description:
Sets the steps on how much/little the Scrollbar moves
Parameters:
vSmall - the new smallest step
vBig - the new largest step
Author:
Kurt Skauen

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

..

Description:
Gets the steps on how much/little the Scrollbar moves
Parameters:
pvSmall - pointer to the smallest step
pvBig - pointer to the bigest step
Author:
Kurt Skauen

void ScrollBar::SetMinMax ( float  vMin,
float  vMax 
)

..

Description:
Sets the minimum and the maximum step that can be done in one click
Parameters:
vMin - the minimum step
vMax - the maximum step
Author:
Kurt Skauen

void ScrollBar::SetProportion ( float  vProp  ) 

..

Description:
Sets the proportion on how the Scrollbar moves
Parameters:
vProp - the new proportion
Author:
Kurt Skauen

float ScrollBar::GetProportion (  )  const

..

Description:
Gets the proportion on how the Scrollbar moves
Author:
Kurt Skauen


Generated on Sat May 9 22:51:42 2009 for Syllable higlevel API by  doxygen 1.5.1