SophiaFramework UNIVERSE 5.3 |
#include <SFYScrollBarControl.h.hpp>
class SFYScrollBarControl : public SFYControl;
SFMTYPEDEFCLASS(SFYScrollBarControl)
How to use
SFYScrollBarControl is the abstract base class for all scroll bar controls.
In a SFYScrollBarControl, functions to draw a track, increment/decrement arrow, or thumb label and display the scrolling status are implemented by default. Several handlers with default behaviour are also implemented as virtual functions.
The below is the layout of scroll bar control.
The design of scroll bar control can be changed using the functions such as SFYScrollBarControl::SetBevelColor, SFYScrollBarControl::SetTrackColor, or SFYScrollBarControl::SetArrowColor.
The horizontal or vertical orientation of scroll bar can be switched with the SFYScrollBarControl::SetOrientation function.
Events and their handlers
Table 215. Events and their Handlers
Event | Handler(Virtual function) | Default behaviour | Override |
---|---|---|---|
(SFEVT_RESPONDER_BOUND, SFP16_BOUND_REQUEST) event | SFYWidget::HandleBoundRequest | - | Recommended |
(SFEVT_RESPONDER_BOUND, SFP16_BOUND_OPTIMIZE) event | SFYWidget::HandleBoundOptimize | - | Recommended |
(SFEVT_RESPONDER_BOUND, SFP16_BOUND_REAL) event | SFYControl::HandleBoundReal | Equalize the virtual region with the real region *1 | Optional |
(SFEVT_RESPONDER_BOUND, SFP16_BOUND_VIRTUAL) event | SFYScrollBarControl::HandleBoundVirtual | Relocate the parts which the scroll bar control consists of. | Unrecommended (Instead, override the SFYScrollBarControl::RelocateTrackAndArrow function.) |
(SFEVT_RESPONDER_BOUND, SFP16_BOUND_GLOBAL) event | SFYWidget::HandleBoundGlobal | - | Optional |
(SFEVT_RESPONDER_RENDER, SFP16_RENDER_REQUEST) event | SFYWidget::HandleRenderRequest | - | Required |
Note | |
---|---|
*1. Execute SFYResponder::SetVirtualBound (SFXRectangle(SFXGrid::ZeroInstance(), GetRealBound().GetSize())). |
SFYControl | SFZScrollBarControl | SFYScrollBarControl::SetBevelColor | SFYScrollBarControl::SetTrackColor | SFYScrollBarControl::SetArrowColor | SFYScrollBarControl::SetOrientation
Constructor/Destructor |
---|
SFYScrollBarControl( Void ) Constructor of the SFYScrollBarControl class.
|
~SFYScrollBarControl( Void ) Destructor of the SFYScrollBarControl class.
|
Public Functions | |
---|---|
Bool |
Decrement( Void )
Decrement the current value of this scroll bar control.
|
SFXRGBColorConstRef |
GetArrowColor( Void )
Get the color of the decrement or increment arrow of this scroll bar control.
|
SFXBevelColorConstRef |
GetBevelColor( Void )
Get the bevel color to draw the outer frame of this scroll bar control.
|
OrientationEnum |
GetOrientation( Void )
Get the value(horizontal or vertical) of orientation of this scroll bar control.
|
SInt32 |
GetPageValue( Void )
Get the page size of this scroll bar control.
|
SInt32 |
GetScrollStepValue( Void )
Get the value of scroll step of this scroll bar control.
|
SFXRGBColorConstRef |
GetTrackColor( Void )
Get the color of the track of this scroll bar control.
|
Bool |
Increment( Void )
Increment the current value of this scroll bar control.
|
Bool |
IsScrollable( Void )
Get the value of the scrollable flag indicating whether or not the bound responder can be scrolled.
|
Void |
SetArrowColor(
SFXRGBColorConstRef param
)
Set the color of the decrement or increment arrow of this scroll bar control to the specified value.
|
Void |
SetBevelColor(
SFXBevelColorConstRef param
)
Set the bevel color to draw the outer frame of this scroll bar control to the specified value.
|
Void |
SetOrientation(
OrientationEnum param
)
Set the orientation of this scroll bar control to the specified value.
|
Void |
SetPageValue(
SInt32 param
)
Set the page size of this scroll bar control to the specified value.
|
Void |
SetScrollStepValue(
SInt32 param
)
Set the scroll step of this scroll bar control to the specified value.
|
Void |
SetTrackColor(
SFXRGBColorConstRef param
)
Set the color of the track of this scroll bar control to the specified value.
|
Void |
ClearHandler( Void )
(inherits from SFYResponder)
Unregister all handlers from this responder.
|
Void |
ClearTracer( Void )
(inherits from SFYResponder)
Unregister all dispatching rules from the tracer of this responder.
|
SFCError |
Distribute(
SFXEventConstRef event
, BoolPtr result = null
)
(inherits from SFYResponder)
Distribute the specified event.
|
SFXRGBColorConstRef |
GetBackgroundColor( Void )
(inherits from SFYWidget)
Get the background color.
|
SFYResponderSmp |
GetChildBack( Void )
(inherits from SFYResponder)
Get the backmost child responder of this responder,
which matches the specified search condition.
|
SFYResponderSmp |
GetChildBack(
Bool visible
, Bool active
, Bool enable
, Bool focus
)
(inherits from SFYResponder)
Get the backmost child responder of this responder,
which matches the specified search condition.
|
SFYResponderSmp |
GetChildBack(
UInt32 id
)
(inherits from SFYResponder)
Get the backmost child responder of this responder,
which matches the specified search condition.
|
SFYResponderSmp |
GetChildBack(
UInt32 id
, Bool visible
, Bool active
, Bool enable
, Bool focus
)
(inherits from SFYResponder)
Get the backmost child responder of this responder,
which matches the specified search condition.
|
SFYResponderSmp |
GetChildBackward(
SInt32 index
)
(inherits from SFYResponder)
Get the child responder of this responder at the specified position from the back side,
which matches the specified search condition.
|
SFYResponderSmp |
GetChildBackward(
SInt32 index
, Bool visible
, Bool active
, Bool enable
, Bool focus
)
(inherits from SFYResponder)
Get the child responder of this responder at the specified position from the back side,
which matches the specified search condition.
|
SFYResponderSmp |
GetChildBackward(
SInt32 index
, UInt32 id
)
(inherits from SFYResponder)
Get the child responder of this responder at the specified position from the back side,
which matches the specified search condition.
|
SFYResponderSmp |
GetChildBackward(
SInt32 index
, UInt32 id
, Bool visible
, Bool active
, Bool enable
, Bool focus
)
(inherits from SFYResponder)
Get the child responder of this responder at the specified position from the back side,
which matches the specified search condition.
|
SInt32 |
GetChildCount( Void )
(inherits from SFYResponder)
Get the number of child responders of this responder,
which match the specified search condition.
|
SInt32 |
GetChildCount(
Bool visible
, Bool active
, Bool enable
, Bool focus
)
(inherits from SFYResponder)
Get the number of child responders of this responder,
which match the specified search condition.
|
SInt32 |
GetChildCount(
UInt32 id
)
(inherits from SFYResponder)
Get the number of child responders of this responder,
which match the specified search condition.
|
SInt32 |
GetChildCount(
UInt32 id
, Bool visible
, Bool active
, Bool enable
, Bool focus
)
(inherits from SFYResponder)
Get the number of child responders of this responder,
which match the specified search condition.
|
SFYResponderSmp |
GetChildForward(
SInt32 index
)
(inherits from SFYResponder)
Get the child responder of this responder at the specified position from the front side,
which matches the specified search condition.
|
SFYResponderSmp |
GetChildForward(
SInt32 index
, Bool visible
, Bool active
, Bool enable
, Bool focus
)
(inherits from SFYResponder)
Get the child responder of this responder at the specified position from the front side,
which matches the specified search condition.
|
SFYResponderSmp |
GetChildForward(
SInt32 index
, UInt32 id
)
(inherits from SFYResponder)
Get the child responder of this responder at the specified position from the front side,
which matches the specified search condition.
|
SFYResponderSmp |
GetChildForward(
SInt32 index
, UInt32 id
, Bool visible
, Bool active
, Bool enable
, Bool focus
)
(inherits from SFYResponder)
Get the child responder of this responder at the specified position from the front side,
which matches the specified search condition.
|
SFYResponderSmp |
GetChildFront( Void )
(inherits from SFYResponder)
Get the foremost child responder of this responder,
which matches the specified search condition.
|
SFYResponderSmp |
GetChildFront(
Bool visible
, Bool active
, Bool enable
, Bool focus
)
(inherits from SFYResponder)
Get the foremost child responder of this responder,
which matches the specified search condition.
|
SFYResponderSmp |
GetChildFront(
UInt32 id
)
(inherits from SFYResponder)
Get the foremost child responder of this responder,
which matches the specified search condition.
|
SFYResponderSmp |
GetChildFront(
UInt32 id
, Bool visible
, Bool active
, Bool enable
, Bool focus
)
(inherits from SFYResponder)
Get the foremost child responder of this responder,
which matches the specified search condition.
|
SInt32 |
GetCurrentValue( Void )
(inherits from SFYControl)
Get the current value of this control.
|
SFYDistributerPtr |
GetDistributer( Void )
(inherits from SFYResponder)
Get the distributer bound with this responder.
|
SFYResponderSmp |
GetFrame( Void )
(inherits from SFYResponder)
Get the frame which has been attached to this responder.
|
SFXRectangle |
GetGlobalBound( Void )
(inherits from SFYResponder)
Get the globle region of this responder.
|
UInt32 |
GetID( Void )
(inherits from SFYResponder)
Get the ID of this responder instance.
|
SFXRectangle |
GetLocalBound( Void )
(inherits from SFYResponder)
Get the local region of this responder.
|
SInt32 |
GetMaximumValue( Void )
(inherits from SFYControl)
Get the maximum value of this control.
|
SInt32 |
GetMinimumValue( Void )
(inherits from SFYControl)
Get the minimum value of this control.
|
SInt32 |
GetNthBackward( Void )
(inherits from SFYResponder)
Get the position counted from the back side of this responder among a group of sibling responders,
which match the specified search condition.
|
SInt32 |
GetNthBackward(
Bool visible
, Bool active
, Bool enable
, Bool focus
)
(inherits from SFYResponder)
Get the position counted from the back side of this responder among a group of sibling responders,
which match the specified search condition.
|
SInt32 |
GetNthBackward(
UInt32 id
)
(inherits from SFYResponder)
Get the position counted from the back side of this responder among a group of sibling responders,
which match the specified search condition.
|
SInt32 |
GetNthBackward(
UInt32 id
, Bool visible
, Bool active
, Bool enable
, Bool focus
)
(inherits from SFYResponder)
Get the position counted from the back side of this responder among a group of sibling responders,
which match the specified search condition.
|
SInt32 |
GetNthForward( Void )
(inherits from SFYResponder)
Get the position counted from the front side of this responder among a group of sibling responders,
which match the specified search condition.
|
SInt32 |
GetNthForward(
Bool visible
, Bool active
, Bool enable
, Bool focus
)
(inherits from SFYResponder)
Get the position counted from the front side of this responder among a group of sibling responders,
which match the specified search condition.
|
SInt32 |
GetNthForward(
UInt32 id
)
(inherits from SFYResponder)
Get the position counted from the front side of this responder among a group of sibling responders,
which match the specified search condition.
|
SInt32 |
GetNthForward(
UInt32 id
, Bool visible
, Bool active
, Bool enable
, Bool focus
)
(inherits from SFYResponder)
Get the position counted from the front side of this responder among a group of sibling responders,
which match the specified search condition.
|
SFYResponderSmp |
GetParent( Void )
(inherits from SFYResponder)
Get the parent responder of this responder.
|
Bool |
GetPropertyTransparent( Void )
(inherits from SFYResponder)
Get the transparency attribute of this responder.
|
SFXRectangleConstRef |
GetRealBound( Void )
(inherits from SFYResponder)
Get the real region of this responder.
|
VoidPtr |
GetReference( Void )
(inherits from SFYResponder)
Get the reference of this responder.
|
SFYRendererPtr |
GetRenderer( Void )
(inherits from SFYResponder)
Get the renderer bound with this responder.
|
SFYResponderSmp |
GetRoot( Void )
(inherits from SFYResponder)
Get the root responder.
|
Bool |
GetStateActive(
Bool inherit = false
)
(inherits from SFYResponder)
Get the active state of this responder.
|
Bool |
GetStateEnable(
Bool inherit = false
)
(inherits from SFYResponder)
Get the enable state of this responder.
|
Bool |
GetStateFocus(
Bool inherit = false
)
(inherits from SFYResponder)
Get the focus state of this responder.
|
Bool |
GetStateValid(
Bool inherit = false
)
(inherits from SFYResponder)
Get the valid state of this responder.
|
Bool |
GetStateVisible(
Bool inherit = false
)
(inherits from SFYResponder)
Get the visible state of this responder.
|
SFXRectangle |
GetSuitableBound( Void )
(inherits from SFYResponder)
Get the suitable region of this responder.
|
SFXRectangle |
GetSuitableBound(
SFXRectangleConstRef rectangle
)
(inherits from SFYResponder)
Get the suitable region of this responder.
|
SFXRectangle |
GetSuitableBound(
SFXRectangleConstRef param
, HorizontalEnum horizontal
, VerticalEnum vertical
)
(inherits from SFYResponder)
Get the suitable region of this responder.
|
SFXMargin |
GetSuitableMargin( Void )
(inherits from SFYResponder)
Get the suitable frame margin region of this responder.
|
SFCType |
GetType( Void )
(inherits from SFYResponder)
Get the type of this responder class.
|
SFXRectangleConstRef |
GetVirtualBound( Void )
(inherits from SFYResponder)
Get the virtual region of this responder.
|
Bool |
HasFrame( Void )
(inherits from SFYResponder)
Check whether or not this responder is a content-responder.
|
Void |
Initialize( Void )
(inherits from SFYResponder)
Initialize this responder.
|
Bool |
IsBack( Void )
(inherits from SFYResponder)
Check whether or not this responder is the backmost responder among a group of the sibling responders
which match the specified search condition.
|
Bool |
IsBack(
Bool visible
, Bool active
, Bool enable
, Bool focus
)
(inherits from SFYResponder)
Check whether or not this responder is the backmost responder among a group of the sibling responders
which match the specified search condition.
|
Bool |
IsBack(
UInt32 id
)
(inherits from SFYResponder)
Check whether or not this responder is the backmost responder among a group of the sibling responders
which match the specified search condition.
|
Bool |
IsBack(
UInt32 id
, Bool visible
, Bool active
, Bool enable
, Bool focus
)
(inherits from SFYResponder)
Check whether or not this responder is the backmost responder among a group of the sibling responders
which match the specified search condition.
|
Bool |
IsFrame( Void )
(inherits from SFYResponder)
Check whether or not this responder is an attachment-frame.
|
Bool |
IsFront( Void )
(inherits from SFYResponder)
Check whether or not this responder is the foremost responder among a group of the sibling responders
which match the specified search condition.
|
Bool |
IsFront(
Bool visible
, Bool active
, Bool enable
, Bool focus
)
(inherits from SFYResponder)
Check whether or not this responder is the foremost responder among a group of the sibling responders
which match the specified search condition.
|
Bool |
IsFront(
UInt32 id
)
(inherits from SFYResponder)
Check whether or not this responder is the foremost responder among a group of the sibling responders
which match the specified search condition.
|
Bool |
IsFront(
UInt32 id
, Bool visible
, Bool active
, Bool enable
, Bool focus
)
(inherits from SFYResponder)
Check whether or not this responder is the foremost responder among a group of the sibling responders
which match the specified search condition.
|
Bool |
IsNthBackward(
SInt32 index
)
(inherits from SFYResponder)
Check whether or not this responder is at the specified position from the back side among a group of the sibling responders
which match the specified search condition.
|
Bool |
IsNthBackward(
SInt32 index
, Bool visible
, Bool active
, Bool enable
, Bool focus
)
(inherits from SFYResponder)
Check whether or not this responder is at the specified position from the back side among a group of the sibling responders
which match the specified search condition.
|
Bool |
IsNthBackward(
SInt32 index
, UInt32 id
)
(inherits from SFYResponder)
Check whether or not this responder is at the specified position from the back side among a group of the sibling responders
which match the specified search condition.
|
Bool |
IsNthBackward(
SInt32 index
, UInt32 id
, Bool visible
, Bool active
, Bool enable
, Bool focus
)
(inherits from SFYResponder)
Check whether or not this responder is at the specified position from the back side among a group of the sibling responders
which match the specified search condition.
|
Bool |
IsNthForward(
SInt32 index
)
(inherits from SFYResponder)
Check whether or not this responder is at the specified position from the front side among a group of the sibling responders
which match the specified search condition.
|
Bool |
IsNthForward(
SInt32 index
, Bool visible
, Bool active
, Bool enable
, Bool focus
)
(inherits from SFYResponder)
Check whether or not this responder is at the specified position from the front side among a group of the sibling responders
which match the specified search condition.
|
Bool |
IsNthForward(
SInt32 index
, UInt32 id
)
(inherits from SFYResponder)
Check whether or not this responder is at the specified position from the front side among a group of the sibling responders
which match the specified search condition.
|
Bool |
IsNthForward(
SInt32 index
, UInt32 id
, Bool visible
, Bool active
, Bool enable
, Bool focus
)
(inherits from SFYResponder)
Check whether or not this responder is at the specified position from the front side among a group of the sibling responders
which match the specified search condition.
|
Bool |
IsRoot( Void )
(inherits from SFYResponder)
Check whether or not this responder is the root responder.
|
SFCError |
Recover( Void )
(inherits from SFYResponder)
Recover the intersection region between this responder and the responder space by using the saved bitmap to restore the device bitmap.
|
SFCError |
RegisterHandler(
SFXEventRangeConstRef range
, SFYHandler::RuleRecConstRef rule
)
(inherits from SFYResponder)
Register specified handlers into this responder.
|
SFCError |
RegisterHandler(
SFXEventRangeConstRef range
, SFYHandler::HandlerSPP spp
, VoidPtr reference
)
(inherits from SFYResponder)
Register specified handlers into this responder.
|
SFCError |
RegisterHandler(
SFXEventRangeConstPtr range
, SFYHandler::RuleRecConstPtr rule
, SInt32 length
)
(inherits from SFYResponder)
Register specified handlers into this responder.
|
SFCError |
RegisterHandler(
SFXEventRangeConstPtr range
, SFYHandler::HandlerSPPConstPtr spp
, VoidPtrConstPtr reference
, SInt32 length
)
(inherits from SFYResponder)
Register specified handlers into this responder.
|
SFCError |
RegisterTracer(
SFXEventRangeConstRef range
, SFYTracer::RuleRecConstRef rule
)
(inherits from SFYResponder)
Register specified dispatching rules into the tracer of this responder.
|
SFCError |
RegisterTracer(
SFXEventRangeConstRef range
, SFYTracer::OrderEnum order
, SFYTracer::StateEnum state
, Bool overload
)
(inherits from SFYResponder)
Register specified dispatching rules into the tracer of this responder.
|
SFCError |
RegisterTracer(
SFXEventRangeConstPtr range
, SFYTracer::RuleRecConstPtr rule
, SInt32 length
)
(inherits from SFYResponder)
Register specified dispatching rules into the tracer of this responder.
|
SFCError |
RegisterTracer(
SFXEventRangeConstPtr range
, SFYTracer::OrderEnumConstPtr order
, SFYTracer::StateEnumConstPtr state
, BoolConstPtr overload
, SInt32 length
)
(inherits from SFYResponder)
Register specified dispatching rules into the tracer of this responder.
|
SFCError |
Render(
Bool force = false
)
(inherits from SFYResponder)
Boot up the renderer for redrawing this responder and its descendant responders.
|
Void |
SetBackgroundColor(
SFXRGBColorConstRef param
)
(inherits from SFYWidget)
Set the background color to the specified value.
|
Void |
SetCurrentValue(
SInt32 param
)
(inherits from SFYControl)
Set the current value of this control to the specified value.
|
Void |
SetDistributer(
SFYDistributerPtr param
)
(inherits from SFYResponder)
Bind this responder with the specified distributer.
|
SFCError |
SetFrame(
SFYResponderSmpConstRef param
)
(inherits from SFYResponder)
Attach the specified frame to this frame.
|
Void |
SetID(
UInt32 param
)
(inherits from SFYResponder)
Set the ID value of this responder to the specified value.
|
Void |
SetMaximumValue(
SInt32 param
)
(inherits from SFYControl)
Set the maximum value of the control to the specified value.
|
Void |
SetMinimumValue(
SInt32 param
)
(inherits from SFYControl)
Set the minimum value of the control to the specified value.
|
SFCError |
SetParent(
SFYResponderSmpConstRef param
)
(inherits from SFYResponder)
Set the parent responder of this responder to the specified responder.
|
Void |
SetProperty(
Bool transparent
)
(inherits from SFYResponder)
Set the property of this responder to the specified value.
|
Void |
SetPropertyTransparent(
Bool param
)
(inherits from SFYResponder)
Set the transparency attribute of this responder to the specified value.
|
Void |
SetRealBound(
SFXRectangleConstRef param
)
(inherits from SFYResponder)
Set the real region of this responder to the specified region.
|
Void |
SetReference(
VoidPtr param
)
(inherits from SFYResponder)
Set the reference value of this responder to the specified value.
|
Void |
SetRenderer(
SFYRendererPtr param
)
(inherits from SFYResponder)
Bind this responder with the specified renderer.
|
Void |
SetState(
Bool visible
, Bool active
, Bool enable
, Bool focus
)
(inherits from SFYResponder)
Set all states of this responder to specified values together.
|
Void |
SetStateActive(
Bool param
)
(inherits from SFYResponder)
Set the active state of this responder to the specified value.
|
Void |
SetStateEnable(
Bool param
)
(inherits from SFYResponder)
Set the enable state of this responder to the specified value.
|
Void |
SetStateFocus(
Bool param
)
(inherits from SFYResponder)
Set the focus state of this responder to the specified value.
|
Void |
SetStateVisible(
Bool param
)
(inherits from SFYResponder)
Set the visible state of this responder to the specified value.
|
Void |
SetVirtualBound(
SFXRectangleConstRef param
)
(inherits from SFYResponder)
Set the virtual region of this responder to the specified value.
|
SFCError |
Snapshot(
SFBBitmapSmpConstRef bitmap
)
(inherits from SFYResponder)
Get a snapshot image of the intersection region between this responder and the responder space by using the saved bitmap.
|
Void |
Terminate( Void )
(inherits from SFYResponder)
Terminate this responder.
|
Void |
ToBack( Void )
(inherits from SFYResponder)
Move this responder to the backmost position among a group of the sibling responders
which match the specified search condition.
|
Void |
ToBack(
Bool visible
, Bool active
, Bool enable
, Bool focus
)
(inherits from SFYResponder)
Move this responder to the backmost position among a group of the sibling responders
which match the specified search condition.
|
Void |
ToBack(
UInt32 id
)
(inherits from SFYResponder)
Move this responder to the backmost position among a group of the sibling responders
which match the specified search condition.
|
Void |
ToBack(
UInt32 id
, Bool visible
, Bool active
, Bool enable
, Bool focus
)
(inherits from SFYResponder)
Move this responder to the backmost position among a group of the sibling responders
which match the specified search condition.
|
Void |
ToFront( Void )
(inherits from SFYResponder)
Move this responder to the foremost position among a group of the sibling responders
which match the specified search condition.
|
Void |
ToFront(
Bool visible
, Bool active
, Bool enable
, Bool focus
)
(inherits from SFYResponder)
Move this responder to the foremost position among a group of the sibling responders
which match the specified search condition.
|
Void |
ToFront(
UInt32 id
)
(inherits from SFYResponder)
Move this responder to the foremost position among a group of the sibling responders
which match the specified search condition.
|
Void |
ToFront(
UInt32 id
, Bool visible
, Bool active
, Bool enable
, Bool focus
)
(inherits from SFYResponder)
Move this responder to the foremost position among a group of the sibling responders
which match the specified search condition.
|
Void |
ToNthBackward(
SInt32 index
)
(inherits from SFYResponder)
Move this responder to the specified position from the back side among a group of the sibling responders
which match the specified search condition.
|
Void |
ToNthBackward(
SInt32 index
, Bool visible
, Bool active
, Bool enable
, Bool focus
)
(inherits from SFYResponder)
Move this responder to the specified position from the back side among a group of the sibling responders
which match the specified search condition.
|
Void |
ToNthBackward(
SInt32 index
, UInt32 id
)
(inherits from SFYResponder)
Move this responder to the specified position from the back side among a group of the sibling responders
which match the specified search condition.
|
Void |
ToNthBackward(
SInt32 index
, UInt32 id
, Bool visible
, Bool active
, Bool enable
, Bool focus
)
(inherits from SFYResponder)
Move this responder to the specified position from the back side among a group of the sibling responders
which match the specified search condition.
|
Void |
ToNthForward(
SInt32 index
)
(inherits from SFYResponder)
Move this responder to the specified position from the front side among a group of the sibling responders
which match the specified search condition.
|
Void |
ToNthForward(
SInt32 index
, Bool visible
, Bool active
, Bool enable
, Bool focus
)
(inherits from SFYResponder)
Move this responder to the specified position from the front side among a group of the sibling responders
which match the specified search condition.
|
Void |
ToNthForward(
SInt32 index
, UInt32 id
)
(inherits from SFYResponder)
Move this responder to the specified position from the front side among a group of the sibling responders
which match the specified search condition.
|
Void |
ToNthForward(
SInt32 index
, UInt32 id
, Bool visible
, Bool active
, Bool enable
, Bool focus
)
(inherits from SFYResponder)
Move this responder to the specified position from the front side among a group of the sibling responders
which match the specified search condition.
|
Void |
UnregisterHandler(
SFXEventRangeConstRef range
, SFYHandler::RuleRecConstRef rule
)
(inherits from SFYResponder)
Unregister the handler from this responder which matches the specified condition.
|
Void |
UnregisterHandler(
SFXEventRangeConstRef range
, SFYHandler::HandlerSPP spp
, VoidPtr reference
)
(inherits from SFYResponder)
Unregister the handler from this responder which matches the specified condition.
|
Void |
UnregisterHandler(
SFXEventRangeConstPtr range
, SFYHandler::RuleRecConstPtr rule
, SInt32 length
)
(inherits from SFYResponder)
Unregister the handler from this responder which matches the specified condition.
|
Void |
UnregisterHandler(
SFXEventRangeConstPtr range
, SFYHandler::HandlerSPPConstPtr spp
, VoidPtrConstPtr reference
, SInt32 length
)
(inherits from SFYResponder)
Unregister the handler from this responder which matches the specified condition.
|
Void |
UnregisterTracer(
SFXEventRangeConstRef range
)
(inherits from SFYResponder)
Unregister the dispatching rule from the tracer of this responder which matches the specified condition.
|
Void |
UnregisterTracer(
SFXEventRangeConstPtr range
, SInt32 length
)
(inherits from SFYResponder)
Unregister the dispatching rule from the tracer of this responder which matches the specified condition.
|
T const & |
static_catch(
Void
)
(inherits from static_exception)
Get the current exception.
|
Protected Functions | |
---|---|
Void |
DrawDecrement(
SFXGraphicsPtr graphics
)
Draw the "decrement arrow" label of this scroll bar control.
|
Void |
DrawIncrement(
SFXGraphicsPtr graphics
)
Draw the "increment arrow" label of this scroll bar control.
|
Void |
DrawThumb(
SFXGraphicsPtr graphics
)
Draw the "thumb" label of this scroll bar control.
|
Void |
DrawTrack(
SFXGraphicsPtr graphics
)
Draw the track of this scroll bar control.
|
SFXRectangleConstRef |
GetDecrementArrowRectangle( Void )
Get the region for the "decrement arrow" label of this scroll bar control.
|
SFXRectangleConstRef |
GetIncrementArrowRectangle( Void )
Get the region for the "increment arrow" label of this scroll bar control.
|
SInt16 |
GetScrollRange( Void )
Get the scroll range of this scroll bar control.
|
SInt16 |
GetThumbLength( Void )
Get the length of the "thumb" label of this scroll bar control.
|
SFXRectangle |
GetThumbRectangle( Void )
Get the region for the "thumb" label of this scroll bar control.
|
SInt16 |
GetThumbTop( Void )
Get the position of the thumb top of this scroll bar control.
|
SFXRectangleConstRef |
GetTrackRectangle( Void )
Get the region for the track of this scroll bar control.
|
Void |
HandleBoundVirtual( Void )
This function will be called when the (SFEVT_RESPONDER_BOUND, SFP16_BOUND_VIRTUAL) event is received.
[Perform the processing when the virtual region is changed.]
|
Void |
HandleScrollable( Void )
This function will be called when the scrollable status is changed.
|
Void |
RelocateTrackAndArrow( Void )
Relocate the regions for the track and the increment/decrement arrow of this scroll bar control.
|
Void |
SetDecrementArrowRectangle(
SFXRectangleConstRef param
)
Set the region for the "decrement arrow" label of this scroll bar control to the specified value.
|
Void |
SetIncrementArrowRectangle(
SFXRectangleConstRef param
)
Set the region for the "increment arrow" label of this scroll bar control to the specified value.
|
Void |
SetTrackRectangle(
SFXRectangleConstRef param
)
Set the region for the track of this scroll bar control to the specified value.
|
static SFYResponderSmp |
Factory(
SFYResponderPtr responder
, SFCErrorPtr exception = null
)
(inherits from SFYResponder)
This function is used to implement the NewInstance function.
|
SFYResponderSmp |
GetThis( Void )
(inherits from SFYResponder)
Get the smart pointer of this responder.
|
Void |
HandleBoundGlobal(
SFXRectangleConstRef rectangle
)
(inherits from SFYWidget)
This function will be called when the global region is changed.
|
Void |
HandleBoundOptimize(
SFXRectanglePtr rectangle
)
(inherits from SFYWidget)
This function will be called when the (SFEVT_RESPONDER_BOUND, SFP16_BOUND_OPTIMIZE) event is received.
[Calculate the suitable rectangle size of this responder within the specified hint rectangle.]
|
Void |
HandleBoundReal( Void )
(inherits from SFYControl)
This function will be called when the real region is changed.
|
Void |
HandleBoundRequest(
SFXRectanglePtr rectangle
)
(inherits from SFYWidget)
This function will be called when the (SFEVT_RESPONDER_BOUND, SFP16_BOUND_REQUEST) event is received.
[Calculate the suitable rectangle size of this responder.]
|
Void |
HandleRenderRequest(
SFXGraphicsPtr graphics
)
(inherits from SFYWidget)
This function will be called when the (SFEVT_RESPONDER_RENDER, SFP16_RENDER_REQUEST) event is received.
[Draw this responder.]
|
Void |
Invalidate( Void )
(inherits from SFYResponder)
Register the specified redraw region of this responder.
|
Void |
Invalidate(
SFXRectangleConstRef param
)
(inherits from SFYResponder)
Register the specified redraw region of this responder.
|
Void |
InvokeBackward(
SFXEventConstRef event
, Bool overload
, BoolPtr result = null
)
(inherits from SFYResponder)
Call the handlers for the specified event from the end of the handler list registered into this responder.
|
Void |
InvokeForward(
SFXEventConstRef event
, Bool overload
, BoolPtr result = null
)
(inherits from SFYResponder)
Call the handlers for the specified event from the head of the handler list registered into this responder.
|
Void |
SetType(
SFCType param
)
(inherits from SFYResponder)
Set the Type value of this responder to the specified 4-character value.
|
Void |
static_throw(
static_exception< T > const & param
)
(inherits from static_exception)
Set an exception.
|
Void |
static_throw(
T const & param
)
(inherits from static_exception)
Set an exception.
|
Bool |
static_try(
Void
)
(inherits from static_exception)
Confirm whether or not the exception is retained.
|
Types |
---|
CodeEnum Constant that represents the SFYScrollBarControl class.
|
OrientationEnum Constants that represent the orientation of the scroll bar.
|
HorizontalEnum
(inherits from SFYResponder)
Constants that represent the horizontal alignment.
|
VerticalEnum
(inherits from SFYResponder)
Constants that represent the vertical alignment.
|
[ protected, explicit ] SFYScrollBarControl(Void);
This constructor performs the initializations as follows:
Table 216. Event handler
Event | Content of the handler |
---|---|
Value event [SFEVT_RESPONDER_VALUE] which will occur when the minimum or maximum value is changed. | Call the SFYScrollBarControl::HandleScrollable function when the scrollable flag is changed. And relocate this scroll bar control. |
Value event [SFEVT_RESPONDER_VALUE] which will occur when the current value is changed. | Relocate the thumb top. |
Note | |
---|---|
In a responder inheriting from SFYScrollBarControl, the corresponding handler will be called when one of the above events occurs. |
Internal implementation of this constructor is as follows:
/*public */SFYScrollBarControl::SFYScrollBarControl(Void) static_throws { static SFXEventRange::AtomRecConst range[] = { { SFEVT_RESPONDER_VALUE, SFEVT_RESPONDER_VALUE, SFP16_VALUE_MAXIMUM, SFP16_VALUE_CURRENT} }; SFYHandler::RuleRec rule[lengthof(range)]; if (static_try()) { SetType(CODE_TYPE); rule[0].spp = XANDLER_FUNCTION(OnValue); rule[0].reference = this; static_throw(RegisterHandler(atomic_cast(range), rule, lengthof(range))); if (static_try()) { static SFXRGBColor::AtomRecConst theme[] = { {{{0x00, 0xFF, 0xFF, 0xFF}}}, {{{0x00, 0xCC, 0xCC, 0xCC}}}, {{{0x00, 0x88, 0x88, 0x88}}}, {{{0x00, 0xF0, 0xF0, 0xF0}}}, {{{0x00, 0x00, 0x00, 0x00}}} }; _color.bevel.Set(theme[0], theme[1], theme[2]); _color.track.Set(theme[3]); _color.arrow.Set(theme[4]); SetMinimumValue(0); SetMaximumValue(0); SetCurrentValue(0); _pagesize = 0; _scrollstep = 0; _scrollbar.orient = DEFAULT_ORIENTATION; _scrollbar.thumbTop = 0; _scrollbar.thumbLength = 0; _scrollbar.scrollRange = 0; _scrollable = false; } } }// SFYScrollBarControl::SFYScrollBarControl // /*private */XANDLER_IMPLEMENT_VOIDVALUE(SFYScrollBarControl, OnValue, invoker, reason, value) { unused(invoker); unused(value); switch (reason) { case SFP16_VALUE_MAXIMUM: case SFP16_VALUE_MINIMUM: QueryScrollable(); RelocateThumb(); break; case SFP16_VALUE_CURRENT: RelocateThumbTop(); break; default: break; } Invalidate(); return; }// XANDLER_IMPLEMENT_VOIDSTATE(SFYScrollBarControl, OnValue) // /*private */Void SFYScrollBarControl::QueryScrollable(Void) { SInt32Const min(GetMinimumValue()); SInt32Const max(GetMaximumValue()); if (((max > min) && (max - min > _pagesize)) ^ !(!_scrollable)) { _scrollable = !_scrollable; HandleScrollable(); } return; }// SFYScrollBarControl::QueryScrollable // /*protected virtual */Void SFYScrollBarControl::HandleScrollable(Void) { InvokeBackward(SFXEvent(SFEVT_RESPONDER_SCROLLBAR, SFP16_SCROLLBAR_ENABLE, 0), true); return; }// SFYScrollBarControl::HandleScrollable // /*private */Void SFYScrollBarControl::RelocateThumb(Void) { if (IsScrollable()) { RelocateThumbLength(); RelocateThumbTop(); } else { _scrollbar.thumbLength = 0; } return; }// SFYScrollBarControl::RelocateThumb // /*private */Void SFYScrollBarControl::RelocateThumbLength(Void) { SInt32Const min(GetMinimumValue()); SInt32Const max(GetMaximumValue()); SFXRectangleConst rc(GetLocalBound()); SInt16 track; track = (_scrollbar.orient == VERTICAL) ? _track.GetHeight() : _track.GetWidth(); track = (track > 0) ? track : 0; _scrollbar.thumbLength = static_cast<SInt16>(track * _pagesize / (max - min)); if ((_scrollbar.thumbLength < MINIMUM_THUMB_LENGTH) && (MINIMUM_THUMB_LENGTH < track)) { _scrollbar.thumbLength = MINIMUM_THUMB_LENGTH; } _scrollbar.scrollRange = track - _scrollbar.thumbLength; return; }// SFYScrollBarControl::RelocateThumbLength // /*private */ Void SFYScrollBarControl::RelocateThumbTop(Void) { SInt32Const cur(GetCurrentValue()); SInt32Const min(GetMinimumValue()); SInt32Const max(GetMaximumValue()); if (max - min > _pagesize) { // This is always true. // _scrollbar.thumbTop = static_cast<SInt16>(_scrollbar.scrollRange * (cur - min) / (max - min - _pagesize)); } else { _scrollbar.thumbTop = 0; } return; }// SFYScrollBarControl::RelocateThumbTop //
SFYResponder::SetType | SFYScrollBarControl::CodeEnum | SFYScrollBarControl::SetBevelColor | SFYScrollBarControl::SetTrackColor | SFYScrollBarControl::SetArrowColor | SFYScrollBarControl::SetPageValue | SFYScrollBarControl::SetScrollStepValue | SFYScrollBarControl::SetOrientation | SFYScrollBarControl::OrientationEnum | SFYScrollBarControl::GetThumbTop | SFYScrollBarControl::GetThumbLength | SFYScrollBarControl::GetScrollRange | SFYScrollBarControl::IsScrollable | SFYScrollBarControl::HandleScrollable | SFYControl::SetMinimumValue | SFYControl::SetMaximumValue | SFYControl::SetCurrentValue | SFXBevelColor | SFXRGBColor | SFXEvent | Type | State | Event | Value Event[SFEVT_RESPONDER_VALUE]
[ protected, virtual ] virtual ~SFYScrollBarControl(Void);
This destructor does nothing.
[ public ] Bool Decrement(Void);
This function decrements the current value of this scroll bar control by the value of scroll step set with the SFYScrollBarControl::SetScrollStepValue function.
[ protected, const ] Void DrawDecrement( SFXGraphicsPtr graphics // graphics object );
This function draws the "decrement arrow" label of this scroll bar control.
In case you want to perform your own processing, override this function.
Tip | |
---|---|
This function will be called in the SFZScrollBarControl::HandleRenderRequest function. |
Internal implementation of the SFYScrollBarControl::DrawDecrement function is as follows:
enum { MINIMUM_THUMB_LENGTH = 2, MINIMUM_MINOR_AXIS_SIZE = 2, INACTIVE_ARROW = 0x66 }; /*protected */Void SFYScrollBarControl::DrawDecrement(SFXGraphicsPtr graphics) const { SFXRGBColor arrow(GetArrowColor()); SFXBevelColor bevel(GetBevelColor()); SFXRectangleConstRef rc(GetDecrementArrowRectangle()); if (!rc.IsEmpty()) { if (!GetStateActive(true) || !IsScrollable()) { bevel.SetDark(bevel.GetBase()); bevel.SetLight(bevel.GetBase()); (arrow.GetBrightness() > 0x7F) ? arrow.SubRGB(INACTIVE_ARROW) : arrow.AddRGB(INACTIVE_ARROW); } if (GetOrientation() == VERTICAL) { graphics->FillBevelRectangle(rc, bevel); graphics->FillTriangle(CalculateTriangle(rc, SCROLL_UP), arrow); } else { graphics->FillBevelRectangle(rc, bevel); graphics->FillTriangle(CalculateTriangle(rc, SCROLL_LEFT), arrow); } } return; }// SFYScrollBarControl::DrawDecrement /*private */SFXTriangle SFYScrollBarControl::CalculateTriangle(SFXRectangleConstRef rect, ScrollDirectionEnum direction) const { SInt16 w; SInt16 h; SFXRectangle temp(rect); if (direction == SCROLL_UP || direction == SCROLL_DOWN) { h = rect.GetHeight() / 4; w = h * 2; } else { w = rect.GetWidth() / 4; h = w * 2; } temp.SetSize(w, h); temp.Offset((rect.GetWidth() - w - 1) / 2, (rect.GetHeight() - h - 1) / 2); return InscribedTriangle(temp, direction); }// SFZSoftKeyControl::CalculateTriangle // /*private */SFXTriangle SFYScrollBarControl::InscribedTriangle(SFXRectangleConstRef rect, ScrollDirectionEnum direction) const { SFXTriangle result; SInt16 x(rect.GetX()); SInt16 y(rect.GetY()); SInt16 w(rect.GetWidth()); SInt16 h(rect.GetHeight()); switch (direction) { case SCROLL_UP: result.Set(x + w / 2, y, x, y + h, x + w, y + h); break; case SCROLL_DOWN: result.Set(x, y, x + w, y, x + w / 2, y + h); break; case SCROLL_LEFT: result.Set(x + w, y, x, y + h / 2, x + w, y + h); break; case SCROLL_RIGHT: result.Set(x, y, x, y + h, x + w, y + h / 2); break; } return result; }// SFYScrollBarControl::InscribedTriangle //
SFZScrollBarControl::HandleRenderRequest | SFYScrollBarControl::DrawTrack | SFYScrollBarControl::DrawIncrement | SFYScrollBarControl::DrawThumb
[ protected, const ] Void DrawIncrement( SFXGraphicsPtr graphics // graphics object );
This function draws the "increment arrow" label of this scroll bar control.
In case you want to perform your own processing, override this function.
Tip | |
---|---|
This function will be called in the SFZScrollBarControl::HandleRenderRequest function. |
Internal implementation of the SFYWidget::HandleBoundOptimize function is as follows:
enum { MINIMUM_THUMB_LENGTH = 2, MINIMUM_MINOR_AXIS_SIZE = 2, INACTIVE_ARROW = 0x66 }; /*protected */Void SFYScrollBarControl::DrawIncrement(SFXGraphicsPtr graphics) const { SFXRGBColor arrow(GetArrowColor()); SFXBevelColor bevel(GetBevelColor()); SFXRectangleConstRef rc(GetIncrementArrowRectangle()); if (!rc.IsEmpty()) { if (!GetStateActive(true) || !IsScrollable()) { bevel.SetDark(bevel.GetBase()); bevel.SetLight(bevel.GetBase()); (arrow.GetBrightness() > 0x7F) ? arrow.SubRGB(INACTIVE_ARROW) : arrow.AddRGB(INACTIVE_ARROW); } if (GetOrientation() == VERTICAL) { graphics->FillBevelRectangle(rc, bevel); graphics->FillTriangle(CalculateTriangle(rc, SCROLL_DOWN), arrow); } else { graphics->FillBevelRectangle(rc, bevel); graphics->FillTriangle(CalculateTriangle(rc, SCROLL_RIGHT), arrow); } } return; }// SFYScrollBarControl::DrawIncrement // /*private */SFXTriangle SFYScrollBarControl::CalculateTriangle(SFXRectangleConstRef rect, ScrollDirectionEnum direction) const { SInt16 w; SInt16 h; SFXRectangle temp(rect); if (direction == SCROLL_UP || direction == SCROLL_DOWN) { h = rect.GetHeight() / 4; w = h * 2; } else { w = rect.GetWidth() / 4; h = w * 2; } temp.SetSize(w, h); temp.Offset((rect.GetWidth() - w - 1) / 2, (rect.GetHeight() - h - 1) / 2); return InscribedTriangle(temp, direction); }// SFZSoftKeyControl::CalculateTriangle // /*private */SFXTriangle SFYScrollBarControl::InscribedTriangle(SFXRectangleConstRef rect, ScrollDirectionEnum direction) const { SFXTriangle result; SInt16 x(rect.GetX()); SInt16 y(rect.GetY()); SInt16 w(rect.GetWidth()); SInt16 h(rect.GetHeight()); switch (direction) { case SCROLL_UP: result.Set(x + w / 2, y, x, y + h, x + w, y + h); break; case SCROLL_DOWN: result.Set(x, y, x + w, y, x + w / 2, y + h); break; case SCROLL_LEFT: result.Set(x + w, y, x, y + h / 2, x + w, y + h); break; case SCROLL_RIGHT: result.Set(x, y, x, y + h, x + w, y + h / 2); break; } return result; }// SFYScrollBarControl::InscribedTriangle //
SFZScrollBarControl::HandleRenderRequest | SFYScrollBarControl::DrawTrack | SFYScrollBarControl::DrawDecrement | SFYScrollBarControl::DrawThumb
[ protected, const ] Void DrawThumb( SFXGraphicsPtr graphics // graphics object );
This function draws the "thumb" label of this scroll bar control.
In case you want to perform your own processing, override this function.
Tip | |
---|---|
This function will be called in the SFZScrollBarControl::HandleRenderRequest function. |
Internal implementation of the SFYScrollBarControl::DrawThumb function is as follows:
/*protected */Void SFYScrollBarControl::DrawThumb(SFXGraphicsPtr graphics) const { SFXBevelColor bevel(GetBevelColor()); if (IsScrollable()) { if (!GetStateActive(true)) { bevel.SetDark(bevel.GetBase()); bevel.SetLight(bevel.GetBase()); } graphics->FillBevelRectangle(GetThumbRectangle(), bevel); } return; }// SFYScrollBarControl::DrawThumb
SFZScrollBarControl::HandleRenderRequest | SFYScrollBarControl::DrawTrack | SFYScrollBarControl::DrawDecrement | SFYScrollBarControl::DrawIncrement
[ protected, const ] Void DrawTrack( SFXGraphicsPtr graphics // graphics object );
This function draws the track(strictly, all the region of this scroll bar control) of this scroll bar control.
This function is used to fill the background of scroll bar control.
In case you want to perform your own processing, override this function.
Tip | |
---|---|
This function will be called in the SFZScrollBarControl::HandleRenderRequest function. |
Internal implementation of the SFYScrollBarControl::DrawTrack function is as follows:
/*protected */Void SFYScrollBarControl::DrawTrack(SFXGraphicsPtr graphics) const { graphics->FillRectangle(GetTrackRectangle(), GetTrackColor()); return; }// SFYScrollBarControl::DrawTrack //
SFZScrollBarControl::HandleRenderRequest | SFYScrollBarControl::DrawDecrement | SFYScrollBarControl::DrawIncrement | SFYScrollBarControl::DrawThumb
[ public, const ] SFXRGBColorConstRef GetArrowColor(Void);
Color(SFXRGBColor) of the decrement or increment arrow(or triangle) of this scroll bar control.
This function gets the color(SFXRGBColor) of the decrement or increment arrow(or triangle) of this scroll bar control.
[ public, const ] SFXBevelColorConstRef GetBevelColor(Void);
Bevel color(SFXBevelColor) to draw the outer frame of this scroll bar control.
This function gets the bevel color to draw the outer frame of this scroll bar control.
[ protected, const ] SFXRectangleConstRef GetDecrementArrowRectangle(Void);
This function gets the region for the "decrement arrow" label of this scroll bar control.
[ protected, const ] SFXRectangleConstRef GetIncrementArrowRectangle(Void);
This function gets the region for the "increment arrow" label of this scroll bar control.
[ public ] OrientationEnum GetOrientation(Void);
Orientation of this scroll bar control(SFYScrollBarControl::HORIZONTAL or SFYScrollBarControl::VERTICAL).
This function gets the value(horizontal or vertical) of orientation of this scroll bar control.
[ public ] SInt32 GetPageValue(Void);
This function gets the page size of this scroll bar control.
The page size corresponds to the thumb length.
The actual thumb length can be obtained by calling the SFYScrollBarControl::GetThumbLength function.
[ protected ] SInt16 GetScrollRange(Void);
This function gets the scroll range of this scroll bar control, which is the length of the region obtained by excluding the arrow labels and the thumb label from the track.
[ public ] SInt32 GetScrollStepValue(Void);
Value of the scroll step of this scroll bar control.
This function gets the value of scroll step of this scroll bar control.
[ protected ] SInt16 GetThumbLength(Void);
This function gets the length of the "thumb" label of this scroll bar control.
[ protected, const ] SFXRectangle GetThumbRectangle(Void);
This function gets the region for the "thumb" label of this scroll bar control.
[ protected ] SInt16 GetThumbTop(Void);
Position of the thumb top of this scroll bar control. (Value of Y coordinate in case of the vertical orientation. Value of X coordinate in case of the horizontal orientation)
This function gets the position of the thumb top of this scroll bar control.
In this case, the origin is the border between the decrement arrow and the track.
[ public, const ] SFXRGBColorConstRef GetTrackColor(Void);
Color(SFXRGBColor) of track of this scroll bar control, in which color the rectangle for the track will be filled.
This function gets the color(SFXRGBColor) of track of this scroll bar control, in which color the rectangle for the track will be filled.
[ protected, const ] SFXRectangleConstRef GetTrackRectangle(Void);
This function gets the region for the track of this scroll bar control.
[ protected, virtual ] Void HandleBoundVirtual(Void);
This function will be called when the (SFEVT_RESPONDER_BOUND, SFP16_BOUND_VIRTUAL) event is received.
In case you want to perform your own processing when the virtual region is changed, override this virtual function.
The default implementation is to relocate this responder to fit into the new virtual region.
Sending the (SFEVT_RESPONDER_BOUND, SFP16_BOUND_VIRTUAL) event | |
---|---|
The (SFEVT_RESPONDER_BOUND, SFP16_BOUND_VIRTUAL) event will occur when the virtual region is changed by calling the SFYResponder::SetRealBound or SFYResponder::SetVirtualBound function. |
Another method when the virtual region is changed | |
---|---|
Other than overriding this virtual function, it is possible to define and implement the handler for region event[XANDLER_DECLARE_VOIDBOUND], and register it into the responder. In the processing when the virtual region is updated, this virtual function is executed first, and next the handlers for region event are executed in the registered order. In almost all cases, the method to override this virtual function is adopted since defining, implementing and registering the handler for region event can be omitted. |
Internal implementation of the SFYScrollBarControl::HandleBoundVirtual function is as follows:
enum { MINIMUM_THUMB_LENGTH = 2, MINIMUM_MINOR_AXIS_SIZE = 2, INACTIVE_ARROW = 0x66 }; /*protected virtual */Void SFYScrollBarControl::HandleBoundVirtual(Void) { Relocate(); return; }// SFYScrollBarControl::HandleBoundVirtual // /*private */Void SFYScrollBarControl::Relocate(Void) { RelocateTrackAndArrow(); RelocateThumb(); return; }// SFYScrollBarControl::Relocate // /*private */Void SFYScrollBarControl::RelocateThumbLength(Void) { SInt32Const min(GetMinimumValue()); SInt32Const max(GetMaximumValue()); SFXRectangleConst rc(GetLocalBound()); SInt16 track; track = (_scrollbar.orient == VERTICAL) ? _track.GetHeight() : _track.GetWidth(); track = (track > 0) ? track : 0; _scrollbar.thumbLength = static_cast<SInt16>(track * _pagesize / (max - min)); if ((_scrollbar.thumbLength < MINIMUM_THUMB_LENGTH) && (MINIMUM_THUMB_LENGTH < track)) { _scrollbar.thumbLength = MINIMUM_THUMB_LENGTH; } _scrollbar.scrollRange = track - _scrollbar.thumbLength; return; }// SFYScrollBarControl::RelocateThumbLength // /*private */ Void SFYScrollBarControl::RelocateThumbTop(Void) { SInt32Const cur(GetCurrentValue()); SInt32Const min(GetMinimumValue()); SInt32Const max(GetMaximumValue()); if (max - min > _pagesize) { // This is always true. // _scrollbar.thumbTop = static_cast<SInt16>(_scrollbar.scrollRange * (cur - min) / (max - min - _pagesize)); } else { _scrollbar.thumbTop = 0; } return; }// SFYScrollBarControl::RelocateThumbTop //
SFYResponder::SetRealBound | SFYResponder::SetVirtualBound | Region Event[SFEVT_RESPONDER_BOUND] | Handler for the Region Event[XANDLER_DECLARE_VOIDBOUND] | Virtual Region | Real Region | Local Region
[ protected, virtual ] Void HandleScrollable(Void);
This function will be called when the scrollable status is changed.
In case you want to perform your own processing, override this function.
The default implementation is to send the scroll bar event [SFXEvent(SFEVT_RESPONDER_SCROLLBAR, SFP16_SCROLLBAR_ENABLE, 0)].
Internal implementation of the SFYScrollBarControl::HandleScrollable function is as follows:
/*protected virtual */Void SFYScrollBarControl::HandleScrollable(Void) { InvokeBackward(SFXEvent(SFEVT_RESPONDER_SCROLLBAR, SFP16_SCROLLBAR_ENABLE, 0), true); return; }// SFYScrollBarControl::HandleScrollable //
[ public ] Bool Increment(Void);
This function increments the current value of this scroll bar control by the value of scroll step set with the SFYScrollBarControl::SetScrollStepValue function.
[ public, const ] Bool IsScrollable(Void);
This function gets the value of the scrollable flag indicating whether or not the bound responder can be scrolled.
If the responder can be scrolled in the either direction, "true" will be returned. Otherwise "false" will be returned.
[ protected, virtual ] Void RelocateTrackAndArrow(Void);
This function relocates the regions for the track and the increment/decrement arrow of this scroll bar control.
In the default implementation, the regions for the decrement arrow, the track and the increment arrow are relocated in this order based on the local region and the orientation of this scroll bar control.
In the class of the scroll bar control, overriding the SFYScrollBarControl::HandleBoundVirtual function is not recommended. To change the size or position of the arrow label or track, override this function.
Void SFYScrollBarControl::RelocateTrackAndArrow(Void) SFXRectangleConst rc(GetLocalBound()); SInt16 side; if (GetOrientation() == VERTICAL) { side = rc.GetWidth(); SetDecrementArrowRectangle(SFXRectangle(rc).SetHeight(side)); SetTrackRectangle(SFXRectangle(rc).AddY(side).SubHeight(side + side); SetIncrementArrowRectangle(SFXRectangle(GetDecrementArrowRectangle()).AddY(GetTrackRectangle().GetHeight() + side)); } else { side = rc.GetHeight(); SetDecrementArrowRectangle(SFXRectangle(rc).SetWidth(side)); SetTrackRectangle(SFXRectangle(rc).AddX(side).SubWidth(side + side); SetIncrementArrowRectangle(SFXRectangle(GetDecrementArrowRectangle()).AddX(GetTrackRectangle().GetWidth() + side)); } return; }
SFYScrollBarControl::SetOrientation | SFYScrollBarControl::HandleBoundVirtual | Local Region
[ public ] Void SetArrowColor( SFXRGBColorConstRef param // value to set );
This function sets the color of the decrement or increment arrow(or triangle) of this scroll bar control to the specified value(SFXRGBColor).
Default: SFXRGBColor(0x00, 0x00, 0x00, 0x00)[black color]
[ public ] Void SetBevelColor( SFXBevelColorConstRef param // value to set );
This function sets the bevel color to draw the outer frame of this scroll bar control to the specified value(SFXBevelColor).
Default: SFXBevelColor(SFXRGBColor(0xFF, 0xFF, 0xFF, 0x00), SFXRGBColor(0xCC, 0xCC, 0xCC, 0x00), SFXRGBColor(0x88, 0x88, 0x88, 0x00))
SFYScrollBarControl::GetBevelColor | SFXBevelColor | SFXRGBColor
[ protected ] Void SetDecrementArrowRectangle( SFXRectangleConstRef param // value to set );
This function sets the region for the "decrement arrow" label of this scroll bar control to the specified value.
[ protected ] Void SetIncrementArrowRectangle( SFXRectangleConstRef param // value to set );
This function sets the region for the "increment arrow" label of this scroll bar control to the specified value.
[ public ] Void SetOrientation( OrientationEnum param // orientation of this scroll bar );
This function sets the orientation of this scroll bar control to the specified value.
The horizontal(SFYScrollBarControl::HORIZONTAL) or vertical(SFYScrollBarControl::VERTICAL) orientation can be specified in the argument.
Default: SFYScrollBarControl::VERTICAL
This function sets the page size of this scroll bar control to the specified value.
The page size corresponds to the thumb length.
The value less than {(maximum value) - (minimum value) } needs to be specified in the argument.
This function sets the scroll step of this scroll bar control to the specified value.
[ public ] Void SetTrackColor( SFXRGBColorConstRef param // value to set );
This function sets the color of the track of this scroll bar control to the specified value(SFXRGBColor), in which color the rectangle for the track will be filled.
Default: SFXRGBColor(0xF0, 0xF0, 0xF0, 0x00)[light gray color]
[ protected ] Void SetTrackRectangle( SFXRectangleConstRef param // value to set );
This function sets the region for the track of this scroll bar control to the specified value.
enum CodeEnum { CODE_TYPE = four_char_code('.', 's', 'c', 'r') }; SFMTYPEDEFTYPE(CodeEnum)
enum OrientationEnum { HORIZONTAL = 0, // horizontal orientation VERTICAL, // vertical orientation DEFAULT_ORIENTATION = VERTICAL // default(vertical orientation) }; SFMTYPEDEFTYPE(OrientationEnum)
Copyright(c) 2002 - 2024 Sophia Cradle Incorporated All Rights Reserved. |