»
Symbian OS v6.1 Edition for C++ »
API Reference »
Uikon Core Controls »
CEikScrollBarFrame
Location:
eiksbfrm.h
Link against: eikcoctl.lib
CEikScrollBarFrame
Support
Supported from 6.0
Description
The scroll bar frame is a control assemblage manager that relates a
control, or control body, to two scroll bars and a corner window. A corner
window is that part of the screen that is common to both the horizontal, and
the vertical elements of a scroll bar.
This class helps with access to, and set up of, scroll bars and
also with the layout of the scrolled control or control body. A scroll bar
frame is not a control, but it does implement the standard control composite
pattern to manage the assemblage.
Derivation
CBase | Base class for all classes to be instantiated on the heap |
CEikScrollBarFrame | The scroll bar frame is a control assemblage manager that relates a control, or control body, to two scroll bars and a corner window |
|
Defined in CEikScrollBarFrame
:
EApplicationScrollBar
, AddApplicationScrollBarL()
, AdjustsModel()
, ApplicationScrollBar()
, CEikScrollBarFrame()
, ClearFlagsForHScrollBar()
, ClearFlagsForVScrollBar()
, ComponentControl()
, CountComponentControls()
, DrawScrollBarsNow()
, EArrowHead
, EAuto
, EBottomOrRight
, EComponent
, EFloating
, ENormalScrollBar
, EOff
, EOn
, ETopOrLeft
, FlagsForHScrollBar()
, FlagsForVScrollBar()
, GetScrollBarHandle()
, HScrollBarVisibility()
, MoveThumbTo()
, MoveThumbsBy()
, RemoveApplicationScrollBar()
, ScrollBarBreadth()
, ScrollBarControlType()
, ScrollBarExists()
, ScrollBarManagement()
, ScrollBarSide()
, SetAdjustsModel()
, SetFlagsForHScrollBar()
, SetFlagsForVScrollBar()
, SetScrollBarBreadth()
, SetScrollBarControlType()
, SetScrollBarManagement()
, SetScrollBarSide()
, SetScrollBarVisibilityL()
, SetScrollBarsDimmed()
, TScrollBarManagement
, TScrollBarSide
, TScrollBarType
, TScrollBarVisibility
, TileL()
, VScrollBarVisibility()
, ~CEikScrollBarFrame()
Inherited from CBase
:
operator new()
Construction and destruction
CEikScrollBarFrame(CCoeControl* aParentWindow, MEikScrollBarObserver* aObserver, TBool aPreAlloc=EFalse);
Description
Constructs a scroll bar frame object.
If aPreAlloc
is ETrue
, any scroll
bars that the scroll bar frame may need are pre-allocated according to the
current scroll bar visibility flags for both the horizontal and vertical scroll
bars. A scroll bar that is pre-allocated, but which is not specifically
displayed, remains invisible.
The default is for aPreAlloc
to be
EFalse
, in which case no pre-allocation is performed. The default
behaviour is appropriate for scroll bar frames which do not alter dynamically
throughout their lifetime. For example, if a pop-out list from a dialog
displays a set of items that, once the listbox is visible, does not change.
Pre-allocating a scroll bar in this case would simply be a waste of
memory.
Parameters
CCoeControl* aParentWindow |
The scroll bar’s parent control. |
MEikScrollBarObserver* aObserver |
The scroll bar observer. |
TBool aPreAlloc |
ETrue to pre-allocate, otherwise
EFalse .
|
|
~CEikScrollBarFrame();
Description
Destructor that deletes the horizontal and vertical scroll bars
as well as the corner window.
TBool TileL(TEikScrollBarModel* aHModel, TEikScrollBarModel* aVModel, TRect& aClientRect, TRect& aInclusiveRect, const TEikScrollBarFrameLayout& aLayout);
Description
Tiles the client area and the scroll bars managed by the frame. The
scroll bars are set up according to the scroll bar models; aHModel
and aVModel
. Ownership is not transferred as a result of passing
these parameters as pointers. The result of tiling geometry management is
observable through the two rectangles aClientRect
and
aInclusiveRect
. Depending on the tiling layout
aLayout
and the scroll bar visibility settings, either of these
rectangles can be made constant and the other rectangle adjusted
accordingly.
Parameters
TEikScrollBarModel* aHModel |
Horizontal scroll bar model. |
TEikScrollBarModel* aVModel |
Vertical scroll bar model. |
TRect& aClientRect |
Client rectangle. |
TRect& aInclusiveRect |
A rectangle that includes the area to be scrolled and the scroll
bars themselves. |
const TEikScrollBarFrameLayout& aLayout |
Tiling layout. |
|
Return value
TBool |
ETrue if the non-constant rectangle is adjusted,
otherwise EFalse .
|
|
Does the scroll bar exist?
TBool ScrollBarExists(CEikScrollBar::TOrientation aOrientation) const;
Description
Determines whether the scroll bar specified by
aOrientation
exists.
Parameters
CEikScrollBar::TOrientation aOrientation |
The scroll bar’s orientation. |
|
Return value
TBool |
ETrue if the specified scroll bar
exists.EFalse if the specified scroll bar does not exist.
|
|
Drawing, visibility and dimming
void DrawScrollBarsNow() const;
Description
Forces any scroll bars, and the corner window if it is visible, to be
redrawn.
SetScrollBarVisibilityL()
void SetScrollBarVisibilityL (TScrollBarVisibility aHVisibility, TScrollBarVisibility aVVisibility);
Description
Sets the visibility state for both the horizontal and the vertical scroll
bars. This is used when tiling.
Parameters
TScrollBarVisibility aHVisibility |
Horizontal scroll bar visibility. |
TScrollBarVisibility aVVisibility |
Vertical scroll bar visibility. |
|
TScrollBarVisibility HScrollBarVisibility() const;
Description
Determines the horizontal scroll bar’s
visibility.
Return value
TScrollBarVisibility |
Visibility for horizontal scroll bar. |
|
TScrollBarVisibility VScrollBarVisibility() const;
Description
Determines the vertical scroll bar’s
visibility.
Return value
TScrollBarVisibility |
Visibility for vertical scroll bar. |
|
void SetScrollBarsDimmed(TBool aHorizDimmed, TBool aVertDimmed) const;
Description
Dims, or undims, the vertical and horizontal scroll bars. Dimming
prevents acceptance of user input.
Parameters
TBool aHorizDimmed |
ETrue to dim the horizontal scroll bar.EFalse
to undim the horizontal scroll bar.
|
TBool aVertDimmed |
ETrue to dim the vertical scroll bar.EFalse to
undim the vertical scroll bar.
|
|
void MoveThumbsBy(TInt aDeltaX, TInt aDeltaY) const;
Description
Moves the scroll bar thumbs by the specified amounts. This updates the
scroll bars after an external scroll. The values of the parameters should be
supplied in terms of the horizontal and vertical scrolling models respectively.
The scrolling models are presumed not to have changed
spans.
Parameters
TInt aDeltaX |
The amount to move the horizontal scroll bar. |
TInt aDeltaY |
The amount to move the vertical scroll bar. |
|
void MoveThumbTo(CEikScrollBar::TOrientation aOrientation, TInt aThumbPos) const;
Description
Moves the scroll bar thumb identified by the orientation
aOrientation
to the position aThumbPos
. This function
is used to update the scroll bar after an external scroll. The value of
aThumbPos
should be supplied in terms of the scrolling model,
which is presumed not to have changed spans.
Parameters
CEikScrollBar::TOrientation aOrientation |
The orientation of the scroll bar you wish to change. |
TInt aThumbPos |
The required thumb position. |
|
Scroll bar attribute functions
TInt ScrollBarBreadth(CEikScrollBar::TOrientation aOrientation) const;
Description
Returns the breadth of the scroll bar idenitified by
aOrientation
, or zero if none exists.
Parameters
CEikScrollBar::TOrientation aOrientation |
The orientation of the scroll bar for which you wish to obtain the
breadth. |
|
Return value
TInt |
The specified scroll bar's breadth. This is zero if none exists. |
|
void SetScrollBarBreadth(CEikScrollBar::TOrientation aOrientation, TInt aBreadth)
Description
Sets the working breadth of the scroll bar identified by orientation
aOrientation
. This method does not set the breadth of the actual
scroll bar but the breadth to be counted for it when performing scroll bar
frame component geometry management.
Parameters
CEikScrollBar::TOrientation aOrientation |
The orientation of the scroll bar for which you wish to set the
breadth. |
TInt aBreadth |
The breadth of the specified scroll bar. |
|
TScrollBarManagement ScrollBarManagement(CEikScrollBar::TOrientation aOrientation) const;
Description
Returns the management enum of the scroll bar identified by the
orientation aOrientation
. This enum determines how the scroll bar
frame manages scroll bars.
Parameters
CEikScrollBar::TOrientation aOrientation |
The orientation of the scroll bar for which you wish to get the
management enum. |
|
Return value
TScrollBarManagement |
The scroll bar frame’s management type for the specified scroll
bar. |
|
void SetScrollBarManagement(CEikScrollBar::TOrientation aOrientation, TScrollBarManagement aManagement);
Description
Sets management of the scroll bar identified by the orientation
aOrientation
to aManagement
. This determines how the
scroll bar frame manages scroll bars.
Parameters
CEikScrollBar::TOrientation aOrientation |
The orientation of the scroll bar for which you wish to set
management. |
TScrollBarManagement aManagement |
The scroll bar frame’s management type for the specified scroll
bar. |
|
TInt ScrollBarControlType (CEikScrollBar::TOrientation aOrientation) const;
Description
Returns the control type of the scroll bar identified by the orientation
aOrientation
.
Parameters
CEikScrollBar::Torientation aOrientation |
The orientation of the scroll bar you wish to check. |
|
Return value
TInt |
The scroll bar’s control type. |
|
SetScrollBarControlType()
void SetScrollBarControlType(CEikScrollBar::TOrientation aOrientation,TInt aControlType);
Description
Sets the control type of the scroll bar identified by the orientation
aOrientation
to aControlType
.
Parameters
CEikScrollBar::TOrientation aOrientation |
The orientation of the scroll bar for which you wish to specify the
control type. |
TInt aControlType |
The control type for the specified scroll bar. |
|
TScrollBarSide ScrollBarSide(CEikScrollBar::TOrientation aOrientation) const;
Description
Returns the side of the scroll bar frame on which the scroll bar,
identified by the orientation aOrientation
, is
placed.
Parameters
CEikScrollBar::Torientation aOrientation |
The orientation of the scroll bar you wish to check. |
|
Return value
TScrollBarSide |
The side of the frame on which the specified scroll bar is placed. |
|
void SetScrollBarSide(CEikScrollBar::TOrientation aOrientation, TScrollBarSide aSide);
Description
Specify the side of the scroll bar frame on which to place the scroll bar
identified by the orientation aOrientation
.
Parameters
CEikScrollBar::TOrientation aOrientation |
The orientation of the scroll bar you wish to change. |
TScrollBarSide aSide |
The side of the scroll bar frame on which you wish the specified scroll
bar to be placed. |
|
Scroll bar frame behaviour functions
TBool AdjustsModel(CEikScrollBar::TOrientation aOrientation) const;
Description
Returns ETrue
if the scroll bar frame can adjust the
scrolling model for orientation aOrientation
.
Parameters
CEikScrollBar::TOrientation aOrientation |
The orientation of the scroll bar you wish to check. |
|
Return value
TBool |
ETrue if this scroll bar frame can adjust the scrolling
model, EFalse otherwise.
|
|
void SetAdjustsModel(CEikScrollBar::TOrientation aOrientation, TBool aAdjusts);
Description
Sets the scrolling model for the scroll bar identified by the orientation
aOrientation
as being adjustable.
Parameters
CEikScrollBar::TOrientation aOrientation |
The orientation of the scroll bar you wish to change. |
TBool aAdjusts |
ETrue to specify the scrolling model as being adjustable for
the specified scroll bar, EFalse otherwise.
|
|
Scroll bar flags functions
TInt FlagsForHScrollBar() const;
Description
Gets the flags that are specified for the horizontal scroll
bar.
Return value
TInt |
Horizontal scroll bar flags. |
|
TInt FlagsForVScrollBar() const;
Description
Gets the flags that are specified for the vertical scroll
bar.
Return value
TInt |
Vertical scroll bar flags. |
|
void SetFlagsForHScrollBar(TInt aMask);
Description
Specifies flags for the horizontal scroll bar.
Parameters
TInt aMask |
Flags for the horizontal scroll bar. |
|
void SetFlagsForVScrollBar(TInt aMask);
Description
Specifies flags for the vertical scroll bar.
Parameters
TInt aMask |
Flags for the vertical scroll bar. |
|
ClearFlagsForHScrollBar()
void ClearFlagsForHScrollBar(TInt aMask);
Description
Clears horizontal scroll bar flags.
Parameters
TInt aMask |
Horizontal scroll bar flags. |
|
ClearFlagsForVScrollBar()
void ClearFlagsForVScrollBar(TInt aMask);
Description
Clears vertical scroll bar flags.
Parameters
TInt aMask |
Vertical scroll bar flags. |
|
Component control functions
CCoeControl* ComponentControl(TInt aIndex) const;
Description
Gets the component specified by index. Within a compound control, each
component control is identified by an index, where the index depends on the
order the controls were added: the first is given an index of 0, the next an
index of 1, and so on.
Parameters
TInt aIndex |
The index of the control to get. |
|
Return value
CCoeControl* |
The component control with an index of aIndex . |
|
TInt CountComponentControls() const;
Description
Gets the number of controls contained in a compound
control.
Return value
TInt |
The number of component controls contained in this control. |
|
CEikScrollBar* GetScrollBarHandle(CEikScrollBar::TOrientation aOrientation) const;
Description
Returns a pointer to the scroll bar identified by orientation
aOrientation
.
Parameters
CEikScrollBar::TOrientation aOrientation |
The orientation of the scroll bar for which you wish to obtain a
pointer. |
|
Return value
CEikScrollBar* |
A pointer to the scroll bar with orientation
aOrientation . |
|
Application scroll bar utilities
CEikScrollBar* ApplicationScrollBar(CEikScrollBar::TOrientation aOrientation);
Description
Returns the central application scroll bar for orientation
aOrientation
. This does not transfer ownership. The central
application scroll bar is a scrolling indicator supplied in the user interface
that can be used by any control to indicate scrolling. It removes the need for
a control to create a scroll bar of its own. Returns NULL if no central
application scroll bar is available. This can only be used in a thread with an
active CEikon
environment.
Parameters
CEikScrollBar::TOrientation aOrientation |
The orientation for which you wish to obtain the central application
scroll bar. |
|
Return value
CEikScrollBar* |
The central application scroll bar for the specified orientation. |
|
AddApplicationScrollBarL()
void AddApplicationScrollBarL(CEikScrollBar::TOrientation aOrientation, CEikScrollBar& aScrollBar);
Description
Adds the scroll bar aScrollBar
to the stack of central
application scroll bars for scrolling orientation aOrientation
.
The central application scroll bar is a scrolling indicator supplied in the
user interface that can be used by any control to indicate scrolling. This
removes the need for a control to create a scroll bar of its own. This can only
be used in a thread with an active environment.
Parameters
CEikScrollBar::TOrientation aOrientation |
The orientation of the scroll bar you wish to add. |
CEikScrollBar& aScrollBar |
The scroll bar to add. |
|
RemoveApplicationScrollBar()
void RemoveApplicationScrollBar(CEikScrollBar::TOrientation aOrientation, CEikScrollBar& aScrollBar);
Description
Removes the scroll bar aScrollBar
from the stack of central
application scroll bars for scrolling orientation aOrientation
.
The central application scroll bar is a scrolling indicator supplied in the UI
that can be used by any control to indicate scrolling. It removes the need for
a control to create a scroll bar of its own. This can only be used in a thread
with an active environment.
Parameters
CEikScrollBar::TOrientation aOrientation |
The orientation of the scroll bar you wish to remove. |
CEikScrollBar& aScrollBar |
The scroll bar to remove. |
|
Enum TScrollBarVisibility
enum TScrollBarVisibility;
Description
Defines the scroll bar’s visibility.
EOff |
Scroll bar not visible. |
EOn |
Scroll bar visible. |
EAuto |
Scroll bar visible if required. |
|
enum TScrollBarType;
Description
Defines the type of scroll bar.
enum TScrollBarSide;
Description
Defines where the scroll bar is located.
EBottomOrRight |
Scroll bar located at the bottom, or to the right of the scroll bar
frame. |
ETopOrLeft |
Scroll bar located at the top, or to the left of the scroll bar
frame. |
|
Enum TScrollBarManagement
enum TScrollBarManagement;
Description
Determines how the scroll bar frame manages scroll
bars.
EComponent |
The scroll bar frame creates, destroys and recreates, scroll bars
according to the visibility mode. The scroll bar frame also acts as an
intermediary with its owning control so that the scroll bars can be treated as
component controls. |
EFloating |
The scroll bar frame creates, destroys and recreates, scroll bars
according to the visibility mode. In this case, the scroll bars are not treated
as component controls. Instead, the scroll bars are geometry managed in windows
floating above the control window and their position is determined in relation
to the frame’s position on the screen. |
EApplicationScrollBar |
The scroll bar frame uses the central application scroll bar as held in
the environment. This scroll bar is neither owned by the frame nor treated as a
component control of the frame’s owner. |
|