Re: Current canvas
Date: Thu, 18 Mar 1999 13:32:59 +0100
Message-ID: <36F0F27B.44DAE0E8_at_sansol.com>
Hi Milos,
You can get the canvas of an item with GET_ITEM_PROPERTY(item_name,
ITEM_CANVAS)
You can get the window of a canvas with GET_VIEW_PROPERTY(canvas_name,
WINDOW_NAME)
This is a simple sample, note that if a canvas is a staked-canvas and
x_pos or y_pos is not 0 it doesn't work fine. Note also that if the
window size is bigger than FORMS_MDI_WINDOW size the window doesn't
center properly. Modify the code to fit your needs.
Aaaaaaaadios,
Javier.
PROCEDURE fix_window_to_canvas(can_name IN VARCHAR2) IS
win_name VARCHAR2(30); can_width NUMBER; can_height NUMBER;
BEGIN
can_width := GET_CANVAS_PROPERTY(can_name, WIDTH); can_height := GET_CANVAS_PROPERTY(can_name, HEIGHT); win_name := GET_VIEW_PROPERTY(can_name, WINDOW_NAME);
SET_WINDOW_PROPERTY(win_name, WINDOW_SIZE, can_width, can_height); END; PROCEDURE center_window(win_name IN VARCHAR2) IS
mdi_width NUMBER; mdi_height NUMBER; win_width NUMBER; win_height NUMBER; x_position NUMBER; y_position NUMBER;
BEGIN
mdi_width := GET_WINDOW_PROPERTY(FORMS_MDI_WINDOW, WIDTH); mdi_height := GET_WINDOW_PROPERTY(FORMS_MDI_WINDOW, HEIGHT); win_width := GET_WINDOW_PROPERTY(win_name, WIDTH); win_height := GET_WINDOW_PROPERTY(win_name, HEIGHT);x_position := (mdi_width - win_width) / 2; y_position := (mdi_height - win_height) / 2;
SET_WINDOW_PROPERTY(win_name, POSITION, x_position, y_position);
END;
Milos Sladic wrote:
>
> I would like to enable my window (in Dev/2000 application) to resize
> automaticaly to the size of current canvas. Also to place it in the
> center of the screen. How to do it? I tried to find something as
> :SYSTEM.CURRENT_CANVAS, but couldn't. Any help appreciated.
Received on Thu Mar 18 1999 - 13:32:59 CET