1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40
| PROCEDURE WIN_CENTER(winname in varchar2) IS
xmax NUMBER ; --Maximum horizontal window size
ymax NUMBER ; --Maximum verticle window size
w NUMBER := get_window_property(winname, width);--Width of window being positioned
h NUMBER := get_window_property(winname, height);--Height of window being positioned
x NUMBER; -- X position of window being positioned.
y NUMBER; -- Y position of window being positioned.
y_offset_ln NUMBER := 0; --Verticle offset to take into account toolbar on client server.
x_offset_ln NUMBER := 0; --Horizontal offset to take into account toolbar on client server.
BEGIN
IF get_application_property(USER_INTERFACE) = 'WEB' THEN
--Hard coded values for running on the web because the mdi window size is not known.
xmax := 752;
ymax := 461;
-- No offeset because ymax and xmax are hard coded on Web.
x_offset_ln := 0;
y_offset_ln := 0;
ELSE
xmax := get_window_property(FORMS_MDI_WINDOW, width);
ymax :=get_window_property(FORMS_MDI_WINDOW, height);
y_offset_ln := 20;
x_offset_ln := 4;
END IF;
ymax := ymax - y_offset_ln;
xmax := xmax - x_offset_ln;
IF w > xmax THEN
x := 0;
ELSE
x := (xmax - w)/2;
END IF;
IF h > ymax THEN
y := 0;
ELSE
y := (ymax - h)/2;
END IF;
set_window_property(winname,x_pos, x); --set_window_property(winname,x_pos, x - 75);
set_window_property(winname,y_pos, y);
END WIN_CENTER; ---------------------------- |
Partager