Scroll Bar Item

The scroll bar item can be used to show the state of a variable that ranges between a set of values.

MDL_Programmer's_Guide-14-30-29.jpg

Item List Specification

The DialogItemRsc field extent specifies the location of the scroll bar. The x position specifies the left edge and the y position specifies the top edge of the scroll bar. The orientation of the scroll bar depends on the width and height fields. If width is 0, the scroll bar handler will make a vertical scroll bar. If height is 0, a horizontal scroll bar will be created. Both the width and height cannot be 0.

The type field should be ScrollBar.

The ID determines the DItem_ScrollBarRsc instance to load.

The attributes field can be ON or OFF and optionally combined with HIDDEN. It will usually be ON.

The itemArg field is unused and should usually be set to 0.

The label field is ignored for scroll bar items.

The auxInfo field can currently override only the access string contained in the DItem_ScrollBarRsc instance.

The following is an example of a scroll bar item list specification:

{{XC, YC, 10*XC, 0}, ScrollBar, SCROLLBARID_ColorPal_Hue, ON, 0, "", ""}

Item Resource Specification

The scroll bar item is defined in a resource file with the following structure:

typedef struct ditem_scrollbarrsc
{
long itemHookId;
long itemHookArg;
int minValue;
int maxValue;
int incAmount;
int pageIncAmount;
double sliderSize;
#if defined (resource)
char accessStr[];
#else
long accessStrLength;
char accessStr[1];
#endif
} DItem_ScrollBarRsc;

The DItem_ScrollBarRsc structure has the following unique fields. (See "Common item resource fields" for a description of any field not in this table.)

Field Description
minValue Specifies the value associated with the minimum position of the scroll bar slider.
maxValue Specifies the value associated with the maximum position of the scroll bar slider.
incAmount Specifies the amount the current value of the scroll bar is changed when the user clicks on the scroll bar arrows.
pageIncAmount Specifies the amount the current value of the scroll bar is changed when the user clicks in the page area of the scroll bar. The page areas are the areas between the slider and the scroll bar arrows.
sliderSize Specifies the size of the slider relative to the entire size of the scroll bar. sliderSize must be between 0.0 and 1.0. The slider's size will never be less than the width of vertically oriented scroll bars or the height of horizontally oriented scroll bars.

The following is an example of a scroll bar item resource:

DItem_ScrollBarRsc SCROLLBARID_ColorPal_Hue=
{
NOHOOK, NOARG, 0, 359, 1, 10, 0.10, ""
};

Item Hook Function Messages

The following messages are sent to item hook functions attached to scroll bar items:

          DITEM_MESSAGE_CREATE 
          DITEM_MESSAGE_INIT 
          DITEM_MESSAGE_DESTROY 
          DITEM_MESSAGE_BUTTON 
          DITEM_MESSAGE_GETSTATE 
          DITEM_MESSAGE_SETSTATE 
          DITEM_MESSAGE_STATECHANGED 
          DITEM_MESSAGE_QUEUECOMMAND 

Scroll bar item functions

Field Description
mdlDialog_scrollBarSetRange sets the minimum and maximum limits of a scroll bar item.
mdlDialog_scrollArrowDraw draws a scroll-bar-item-like arrow in a dialog box.
mdlDialog_scrollBarGetInfo retrieves detailed information about a scroll bar.
mdlDialog_scrollBarSetInfo sets various aspects of a scroll bar.

View window icons and scroll bars

MicroStation has added optimized viewing commands and scroll bars to the view window borders. The user will have the option of removing these icons and scroll bars if screen real estate is the primary concern. This new feature means that the content rectangle of the view window is not necessarily the same as the usable view area. A new MDL routine mdlView_getViewRectangle should be used instead of mdlWindow_contentRectGetLocal or mdlWindow_contentRectGetGlobal if the dimensions of the usable view rectangle are desired.


Copyright © 2017 Bentley Systems, Incorporated. All rights reserved.