Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Size and position of console window

582 views
Skip to first unread message

Jeremy Russell

unread,
Sep 30, 1998, 3:00:00 AM9/30/98
to
I'm trying to center a form in the middle of the current display,
using the trigger text below. This trigger also sizes the MDI window
to match the main/first window in the form - that part works fine.

If I "uncomment" either of the GET_APPLICATION_PROPERTY function calls
immediately following the "BEGIN", I get an exception condition with
no error information displayed. The problem seems to be in the call
to GET_APPLICATION_PROPERTY - commented out, the trigger runs fine but
I'm not getting the effect I want. Does GET_APPLICATION_PROPERTY
function under Windows 9x?

I am using Personal Oracle 8.0.4 on Windows '98, with Forms version
4.5.8.1.2.

The trigger text for the WHEN_NEW_FORMS_INSTANCE trigger is:

----

DECLARE
alert_id ALERT := Find_Alert('General_Alert');
alert_button NUMBER;
c_main_window_name CONSTANT CHAR(20) := 'MAIN_WINDOW';

w_width NUMBER; /* Window width */
w_height NUMBER; /* Window height */
w_x_pos NUMBER(3); /* Window left position */
w_y_pos NUMBER(3); /* Window down position */
w_screen_width VARCHAR2; /* Screen width */
w_screen_height VARCHAR2; /* Screen height */

BEGIN
/* w_screen_width := GET_APPLICATION_PROPERTY('Display_Width');
*/
/* w_screen_height := GET_APPLICATION_PROPERTY('Display_Height');
*/

/* Return main form window properties as below */
w_width := GET_WINDOW_PROPERTY (c_main_window_name ,width);
w_height := GET_WINDOW_PROPERTY (c_main_window_name ,height);
w_x_pos := GET_WINDOW_PROPERTY (c_main_window_name ,x_pos);
w_y_pos := GET_WINDOW_PROPERTY (c_main_window_name ,y_pos);

/*
Set the MDI window properties to match
the form's main window
*/

Set_Window_Property(FORMS_MDI_WINDOW, WIDTH, w_width + 6);
Set_Window_Property(FORMS_MDI_WINDOW, HEIGHT, w_height + 20 );

/*
Position the MDI window in the
center of the screen display - this
ought to be functional in whatever
resolution is in use right now
*/

/*
Set_Window_Property(FORMS_MDI_WINDOW, X_POS,
(w_screen_width - to_number(w_width) )/2);
Set_Window_Property(FORMS_MDI_WINDOW, Y_POS,
(w_screen_height - to_number(w_height))/2);
*/
/* Finally, set the MDI window title bar caption */
Set_Window_Property(FORMS_MDI_WINDOW, TITLE,
'Main Window Title');

EXCEPTION
WHEN OTHERS THEN
display_alert('Error: ' ||
error_type || ' Number: ' ||
to_char(error_code) || ' : ' ||
error_text);
END;
----

Any suggestions that you have would be gratefully accepted.

Thanks!

Regards

Jeremy Russell

Joe Brown

unread,
Sep 30, 1998, 3:00:00 AM9/30/98
to
> /* w_screen_width := GET_APPLICATION_PROPERTY('Display_Width');
> */
> /* w_screen_height := GET_APPLICATION_PROPERTY('Display_Height');
Remove the single quotes (') from around
DISPLAY_WIDTH & DISPLAY_HEIGHT

so it's like:
w_screen_width := GET_APPLICATION_PROPERTY( DISPLAY_WIDTH );

I'd also declare w_screen_width & height as number... But that's my
preference.
--
joebrown
@leading.net

Jeremy Russell

unread,
Oct 1, 1998, 3:00:00 AM10/1/98
to
Yeah, well duh me - I suspect that a) I was having an off day and b)
fourteen hours playing with the keyboard is a little too long.

Basically, thanks - it worked fine.

JR

0 new messages