13.07.2015 Views

REFERENCE GUIDE

REFERENCE GUIDE

REFERENCE GUIDE

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

(For more information, seethe GetSystemMetricsfunction in Chapter 4,"Functions directory. ")window has standard scroll bars if it is created with theWS_ VSCROLL or WS_HSCROLL style. A standard scroll bar iseither vertical or horizontal. A vertical bar always appears at theright of the client area; a horizontal bar always appears at thebottom. A standard scroll bar always has the standard scroll-barheight and width as defined by the SM_ CXVSCROLL andSM_ CYHSCROLL system metric values.A scroll-bar control is a control window that looks and acts like astandard scroll bar. But unlike a standard scroll bar, a scroll-barcontrol is not part of any window. As a separate window, ascroll-bar control can receive the input focus, and indicates this bydisplaying a flashing caret in the thumb. When a scroll-bar controlhas the input focus, the user can use the keyboard to direct thescrolling. Unlike standard scroll bars, a scroll-bar control providesa built-in keyboard interface. Scroll-bar controls also can be usedfor other purposes. For example, a scroll-bar control can be usedto select values from a range of values, such as a color from arainbow of colors.Scroll-bar thumbThe scroll-bar thumb is the small rectangle in a scroll bar. It showsthe approximate location within the current document or file ofthe data currently displayed in the client area. For example, thethumb is in the middle of the scroll bar when page three of a fivepagedocument is in the client area.The SetScroliPos function sets the thumb position in a scroll bar.Since Windows does not automatically update the thumb positionwhen an application scrolls, SetScroliPos must be used to updatethe thumb position. The GetScroliPos function retrieves thecurrent position.A thumb position is an integer. The position is relative to the leftor upper end of the scroll bar, depending on whether the scrollbar is horizontal or vertical. The position must be within thescroll-bar range, which is defined by minimum and maximumvalues. The positions are distributed equally along the scroll bar.For example, if the range is a to lOa, there are 100 positions alongthe scroll bar, each equally spaced so that position 50 is in themiddle of the scroll bar. The initial range depends on the scrollbar. Standard scroll bars have an initial range of a to 100; scrollbarcontrols have an empty range (both minimum and maximumChapter 7, Window manager interface functions 69

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!