11.01.2013 Views

Oracle Forms Developer – Form Builder Reference, Volume 1

Oracle Forms Developer – Form Builder Reference, Volume 1

Oracle Forms Developer – Form Builder Reference, Volume 1

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

354<br />

ten_percent NUMBER;<br />

new_x NUMBER;<br />

old_y NUMBER;<br />

BEGIN<br />

/*<br />

** Get the id’s for the View and its corresponding canvas<br />

*/<br />

vw_id := Find_View( viewname );<br />

cn_id := Find_Canvas( viewname );<br />

/*<br />

** Determine the view width and corresponding canvas<br />

** width.<br />

*/<br />

vw_wid := Get_View_Property(vw_id,WIDTH);<br />

cn_wid := Get_Canvas_Property(cn_id,WIDTH);<br />

/*<br />

** Calculate how many units of canvas width are outside of<br />

** view, and determine 10% of that.<br />

*/<br />

ten_percent := 0.10 * (cn_wid - vw_wid);<br />

/*<br />

** Determine at what horizontal position the view<br />

** currently is on the corresponding canvas<br />

*/<br />

vw_x:= Get_View_Property(vw_id,VIEWPORT_X_POS_ON_CANVAS);<br />

/*<br />

** Calculate the new x position of the view on its canvas<br />

** to effect the 10% scroll in the proper direction.<br />

** Closer than ten percent of the distance to the edge<br />

** towards which we are moving, then position the view<br />

** against that edge.<br />

*/<br />

IF direction=’LEFT’ THEN<br />

IF vw_x > ten_percent THEN<br />

new_x := vw_x - ten_percent;<br />

ELSE<br />

new_x := 0;<br />

END IF;<br />

ELSIF direction=’RIGHT’ THEN<br />

IF vw_x < cn_wid - vw_wid - ten_percent THEN<br />

new_x := vw_x + ten_percent;<br />

ELSE<br />

new_x := cn_wid - vw_wid;<br />

END IF;<br />

END IF;<br />

/*<br />

** Scroll the view that much horizontally<br />

*/<br />

old_y := Get_View_Property(vw_id,VIEWPORT_Y_POS_ON_CANVAS);<br />

Scroll_View( vw_id, new_x , old_y );<br />

END;

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

Saved successfully!

Ooh no, something went wrong!