3D PLM Enterprise Architecture |
User Interface - Dialogs |
CATDlgScrollBarScrolls windows and boxes |
Quick Reference |
CATDialog | +---CATDlgControl | +---CATDlgScrollbar
The scroll bar allows to set scrolling facilities to a scrollable dialog object. A scroll bar consists in a field (a shaft) ended on both sides by a scroll arrow between which an indicator (a scroll box, or thumb) shows the location of the data displayed with respect to the whole data. A scroll bar can be horizontal or vertical. |
Use scroll bar whenever you display areas that don't fit in the available space.
Name | Description |
---|---|
CATDlgCtrHorizontal | The scrollbar is horizontal. This is the default. |
CATDlgCtrVertical | The scrollbar is vertical. |
[Top]
[Top]
The scroll bar is assigned to a scrollable area.
[Top]
Construct scroll bars as follows:
Horizontal |
_pHScrollBar = new CATDlgScrollBar (iParent, "HScrollBarId") |
Vertical |
_pVScrollBar = new CATDlgScrollBar (iParent, "VScrollBarId", CATDlgCtrVertical); |
[Top]
The scroll bar range is managed using two parameters: a minimum value and a
maximum value. The GetScrollRange
and SetScrollRange
methods enable their management:
int Min, Max; _pScrollBar->GetScrollRange(Min, Max); ... Min = 0; Max = 100; _pScrollBar->SetScrollRange(Min, Max); |
[Top]
The scroll box position is managed using the two methods GetScrollPos
and SetScrollPos
:
int ScrollBoxPosition = _pScrollBar->GetScrollPos(); ... ScrollBoxPosition = 25; int Notify = 0; _pScrollBar->SetScrollPos(ScrollBoxPosition, Notify); |
Set the first parameter to the scroll box position you require, and the
parameter Notify
to a non null value if you want the corresponding
notification to be sent. Otherwise set to 0, no notification is sent. The scroll
box position must be set in the range defined by the minimum and maximum values.
[Top]
The scroll box size is managed using the two methods GetScrollBoxSize
and SetScrollBoxSize
:
int ScrollBoxSize = _pScrollBar->GetScrollBoxSize(); ... ScrollBoxSize = 5; int Notify = 0; _pScrollBar->SetScrollBoxSize(ScrollBoxSize); |
[Top]
Set a callback on a scroll bar, for example, for scroll box drag, as follows:
AddAnalyseNotificationCB(
_pScrollBar, // scroll bar
_pScrollBar->
|
[Top]
The scroll bar title should be set by the resource file using a key built with the identifier you declare as the second parameter of the scroll bar constructor. It is never displayed.
[Top]
Version: 1 [Jan 2000] | Document created |
[Top] |
Copyright © 2000, Dassault Systèmes. All rights reserved.