•  Back 
  •  graf_slidebox 
  •  Index 
  •  Tree View 
  •  Cross references 
  •  Help page 
  •  Show info about hypertext 
  •  View a new file 
Topic       : TOS - das Betriebssystem
Author      : 
Version     : tos.hyp (5. März 2013)
Subject     : Programmieren/Atari
Nodes       : 3001
Index Size  : 93602
HCP-Version : 5
Compiled on : Atari
@charset    : atarist
@lang       : 
@default    : Titel
@help       : 
@options    : +g -i -s +x +zz -t4
@width      : 70
View Ref-File8.12.10.1  graf_slidebox von Geneva                                TOS

The meaning of the gr_slvh parameter has changed slightly, to provide 
for real-time updating of sliders:

 LSB  0  for horizontal slider, 1 for vertical 
 MSB  0  for old-style, dotted outline drag box 
      1  to describe the area to be scrolled in real-time 
      2  to initialize real-time scrolling 
      3  to process the scroll bar in real time 

To use real-time scroll bars, a program does the following:

  1. Call graf_slidebox with gr_slvh mode 0x1XX (where "XX" is 00 for 
     a horizontal slider, and 01 for vertical). In this mode, the 
     gr_slparent parameter describes the size of the entire area to be 
     scrolled, and gr_slobject describes the size of the area which is 
     visible at one time. Both of these values can be in any units the 
     programmer chooses.

  2. Call graf_slidebox with gr_slvh mode 0x2XX. In this mode, 
     gr_slparent and gr_slobject have the same meaning they normally 
     do. The return value will either be -1, if the user has released 
     the slider, or it will be a number >= 0 which represents the new 
     position of the slider. This number is based on the numbers 
     passed in Step 1. The call does not return until the slider has 
     either moved enough to change the position within the list, or 
     the mouse button has been released.

  3. If the result of the last graf_slidebox call was -1, then 
     continue on with the rest of the program. Otherwise, perform 
     whatever action is necessary to redraw the list of items, 
     starting at the returned index. The slider position is updated 
     automatically by Geneva; the program must not alter it.

  4. Call graf_slidebox with gr_slvh mode 0x3XX. In this mode, 
     gr_slparent and gr_slobject have the same meaning they normally 
     do. Go to Step 3.

Example: Process a list of 100 items, 10 of which are visible at once

if( graf_slidebox( 0L, 100, 10, 0x101 ) >= 0 )
{
  i = graf_slidebox( object_tree, parent_obj, slider_obj, 0x201 );
  while( i>=0 )
  {
     redraw_list_starting_at(i);
     i = graf_slidebox( object_tree, parent_obj, slider_obj, 0x301 );
  }
}