model_server/driver_aset/src/dialog_scroll.cxx
//------------------------------------------
// set_vert_scrollbar_value
//
// Set the position of the bottommost edge of the vertical thumb.
//------------------------------------------
set_vert_scrollbar_value
Set the position of the bottommost edge of the vertical thumb.
set_vert_scrollbar_value Set the position of the bottommost edge of the vertical thumb .
void dialog::set_vert_scrollbar_value(int view_num, int val)
{
    Initialize(dialog::set_vert_scrollbar_value);
    if((view_num >= 0) && (view_num < max_view_num()))
    {
	Widget vscroll = Widget(get_vert_scroll(view_num));
	if (!vscroll) Return;
	ui_set_scroll_value(vscroll, val);
	Widget panner = Widget(get_panner(view_num));
	if(panner)
	{
	    int min = 0, max = 100;
	    ui_get_scroll_range (vscroll, &min, &max);
	    float factor = 100.0 / (max > min ? max - min : 1);
	    int x0, y0, w, h, cx, cy, cw, ch;
	    Panner_values(panner, &x0, &y0, &w, &h, &cx, &cy, &cw, &ch);
	    Panner_perspective(panner, 0, 0, 100, 100,
			       cx, (int) ((max - val) * factor), cw, ch);
	}
    }
    Return
}
void dialog :: set_vert_scrollbar_value ( int view_num , int val ) { Initialize ( dialog :: set_vert_scrollbar_value ) ; if ( ( view_num >= 0 ) && ( view_num < max_view_num ( ) ) ) { Widget vscroll = Widget ( get_vert_scroll ( view_num ) ) ; if ( ! vscroll ) Return ; ui_set_scroll_value ( vscroll , val ) ; Widget panner = Widget ( get_panner ( view_num ) ) ; if ( panner ) { int min = 0 , max = 100 ; ui_get_scroll_range ( vscroll , & min , & max ) ; float factor = 100.0 / ( max > min ? max - min : 1 ) ; int x0 , y0 , w , h , cx , cy , cw , ch ; Panner_values ( panner , & x0 , & y0 , & w , & h , & cx , & cy , & cw , & ch ) ; Panner_perspective ( panner , 0 , 0 , 100 , 100 , cx , ( int ) ( ( max - val ) * factor ) , cw , ch ) ; } } Return }
set_vert_scrollbar_value
Set the position of the bottommost edge of the vertical thumb.
set_vert_scrollbar_value Set the position of the bottommost edge of the vertical thumb .