Size and position of console window

From: Jeremy Russell <jeremyr_at_no-spam-today-thanks.dircon.co.uk>
Date: Wed, 30 Sep 1998 16:37:18 GMT
Message-ID: <36125dbe.30876970_at_news.dircon.co.uk>



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	
[Quoted] /*	w_screen_width  := GET_APPLICATION_PROPERTY('Display_Width');
*/
[Quoted] /*	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 Received on Wed Sep 30 1998 - 18:37:18 CEST

Original text of this message