A script-enabled browser is required for this page to function properly.

GET_VIEW_PROPERTY Built-in

Description

Returns the indicated property setting for the indicated canvas.

Syntax

FUNCTION GET_VIEW_PROPERTY
(view_id ViewPort,
property
NUMBER);

FUNCTION GET_VIEW_PROPERTY
(view_name VARCHAR2,
property
NUMBER);

Built-in Type unrestricted function

Returns VARCHAR2

Enter Query Mode yes

Parameters

view_id 
 
Specifies the unique ID that Oracle Forms assigns the canvas when it creates the object. Use the FIND_VIEW Built-in to return the ID to an appropriately typed variable. The data type of the ID is ViewPort.
 
view_name 
 
Specifies the name that you gave the object when defining it.
 
property 
 
Specifies the property whose state you want to get for the given canvas. You must make a separate call to GET_VIEW_PROPERTY for each property you need, as shown in the example. You can enter one of the following constants to obtain return values:

DIRECTION Returns the layout direction for bidirectional objects. Valid return values are RIGHT_TO_LEFT, LEFT_TO_RIGHT.

HEIGHT Returns the height of the view. For a content view, the height of the view is actually the height of the window in which the view is currently displayed. The size of each unit depends on how you defined the Coordinate System property for the form module.

VIEWPORT_X_POS For a stacked canvas, returns the x coordinate that reflects the current placement of the view's upper left corner relative to the upper left corner of the window's current content canvas. For a content view, returns 0. The value is returned as a VARCHAR2 and is expressed in the units defined by the form module Coordinate System property.

VIEWPORT_Y_POS For a stacked canvas, returns the y coordinate that reflects the current placement of the view's upper left corner relative to the upper left corner of the window's current content canvas. For a content view, returns 0. The value is returned as a VARCHAR2 and is expressed in the units defined by the form module Coordinate System property.

VIEWPORT_X_POS_ON_CANVAS Returns the x coordinate that reflects the current placement of the view's upper left corner relative to the upper left corner of its canvas. The value is returned as a VARCHAR2 and is expressed in the units defined by the form module Coordinate System property.

VIEWPORT_Y_POS_ON_CANVAS Returns the y coordinate that reflects the current placement of the view's upper left corner relative to the upper left corner of its canvas. The value is returned as a VARCHAR2 and is expressed in the units defined by the form module Coordinate System property.

VISIBLE Returns the VARCHAR2 value TRUE if the view is visible, FALSE if it is not. A view is reported visible when it is a) in front of all other views in the window or b) only partially obscured by another view. A view is reported not visible when it is a) a stacked view that is behind the content view or b) completely obscured by a single stacked view. Note that this property is independent of the current window display state. Thus a view can be reported visible even when its window is currently hidden or iconified.

WIDTH Returns the width of the view. For a content view, the width of the view is actually the width of the window in which the view is currently displayed. The size of each unit depends on how you defined the Coordinate System property for the form module.

WINDOW_NAME Returns the name of the window where this canvas is displayed.

GET_VIEW_PROPERTY Examples

/*

** Built-in: GET_VIEW_PROPERTY
** Example: Use the Width, and display position of one
** stacked view (View1) to determine where to
** position another one (View2) immediately to its
** right.
*/
PROCEDURE Anchor_To_Right( View2 VARCHAR2, View1 VARCHAR2) IS
vw_id1 ViewPort;
vw_id2 ViewPort;
x NUMBER;
y NUMBER;
w NUMBER;
BEGIN
/*
** Find View1 and get its (x,y) position, width
*/
vw_id1 := Find_View(View1);
x := Get_View_Property(vw_id1,VIEWPORT_X_POS);
y := Get_View_Property(vw_id1,VIEWPORT_Y_POS);
w := Get_View_Property(vw_id1,WIDTH);
/*
** Anchor View2 at (x+w,y+h)
*/
vw_id2 := Find_View(View2);
Set_View_Property(vw_id2,VIEWPORT_X_POS, x+w );
Set_View_Property(vw_id2,VIEWPORT_Y_POS, y );
END;