Microsoft KB Archive/61677

From BetaArchive Wiki
Knowledge Base


Scroll Bar Toolbox Routines for Use Only with ScrollText

Article ID: 61677

Article Last Modified on 10/20/2003



APPLIES TO

  • Microsoft QuickBasic Compiler for Macintosh 1.0
  • Microsoft QuickBasic Compiler for Macintosh 1.0
  • Microsoft QuickBasic Compiler for Macintosh 1.0



This article was previously published under Q61677

SUMMARY

The scroll bar Toolbox Library statements included with Macintosh QuickBasic are designed to be used with the ScrollText routine and are not designed as general purpose scroll bar routines.

This information applies to Microsoft QuickBasic versions 1.0, 1.0a, and 1.0b for the Apple Macintosh.

MORE INFORMATION

The scroll bar routines ActiveScroll, DisposeScroll, GetScrollValue, HideScroll, MoveScroll, NewScroll, SetScrollValue, and ShowScroll are all designed to be used with ScrollText.

When you drag the scroll button in a scroll bar, the Macintosh can automatically return a value for the scroll bar based on the minimum and maximum values for the scroll bar.

When a mouse click is detected on either the scroll button, or in the scroll bar, the distance to scroll needs to be defined by the program. This is accomplished in other languages by defining special scroll bar handling routines that are called when a mouse click is detected in either of these areas. However, as stated on page 492 of the "Microsoft QuickBASIC for the Apple Macintosh: Language Reference":

A click anywhere in the scroll bar (the bar, the arrows, or the scroll box) is not detected by QuickBASIC as a mouse or dialog event.


This means that in QuickBasic, no processing can be done for a click in any of these areas. QuickBasic is able to update the scroll value only by moving the scroll bar button. To work around this limitation, ScrollText has special handling routines to trap and process mouse clicks on the scroll arrows and in the scroll box.

In place of these routines, a scroll box can be created by dynamically drawing each piece of the scroll bar. Mouse clicks can then be trapped and processed in these areas. In effect, a routine is created that simulates creating a scroll bar and doing what the toolbox routines would do.


Additional query words: MQuickB 1.00 1.00a 1.00b

Keywords: KB61677