Home » Developer & Programmer » Forms » forms_mdi_window problem
forms_mdi_window problem [message #421383] Tue, 08 September 2009 01:28 Go to next message
nasir_mughal
Messages: 121
Registered: April 2007
Location: Karachi
Senior Member
Hi

I want to position all my forms in the center of forms_mdi_window.
For this i am using this code to get height and width of forms_mdi_window, but when i run form it returns (0,0) as height and width

WHEN-NEW-FORM-INSTANCE


SET_WINDOW_PROPERTY(FORMS_MDI_WINDOW,TITLE,'Gemini Softs');

DECLARE
	wmdi_height NUMBER;
	wmdi_width NUMBER;
BEGIN
	
	wmdi_height:=GET_WINDOW_PROPERTY(FORMS_MDI_WINDOW,WIDTH);
	wmdi_width:=GET_WINDOW_PROPERTY(FORMS_MDI_WINDOW,HEIGHT);

	message(wmdi_width||'        '||wmdi_height);
	message(wmdi_width||'        '||wmdi_height);
	
END;	


f:\form.bmp

what could be the reason, kindly help me.

[Updated on: Tue, 08 September 2009 03:52]

Report message to a moderator

Re: forms_mdi_window problem [message #421972 is a reply to message #421383] Sat, 12 September 2009 10:52 Go to previous messageGo to next message
Kevin Meade
Messages: 2101
Registered: December 1999
Location: Connecticut USA
Senior Member
You need to do a little testing here.

The most obvious reason for this error is that you are getting 0,0 because the forms system does not know the name of the window you are looking for. FORMS_MDI_WINDOW is I believe a Microsoft Windows invention and may not work on other OSes?

Substitute the actual name of the window as a hard coded text string and see if you are getting the same 0,0.

Put in an invalid hard coded window name (a window name known not to exist in the form) and see if you get back 0,0 or an error.

Bottom line is you will have to test to generate more information for yourself so you can diagnose the problem.

Good luck, Kevin
Re: forms_mdi_window problem [message #422081 is a reply to message #421972] Mon, 14 September 2009 04:24 Go to previous messageGo to next message
nasir_mughal
Messages: 121
Registered: April 2007
Location: Karachi
Senior Member
When i tried to use a window name which does't exist in forms.The following error displayed.

Quote:


FRM-41052: Cannot find Window: invalid ID.



DECLARE
	wmdi_height NUMBER;
	wmdi_width NUMBER;
BEGIN
	
	wmdi_height:=GET_WINDOW_PROPERTY('WINDOW3',WIDTH);
	wmdi_width:=GET_WINDOW_PROPERTY('WINDOW3',HEIGHT);

	message(wmdi_width||'        '||wmdi_height);
	message(wmdi_width||'        '||wmdi_height);
	

END;



Kindly help me.

Thanks.

[Updated on: Mon, 14 September 2009 04:38]

Report message to a moderator

Re: forms_mdi_window problem [message #422113 is a reply to message #422081] Mon, 14 September 2009 08:33 Go to previous messageGo to next message
Kevin Meade
Messages: 2101
Registered: December 1999
Location: Connecticut USA
Senior Member
OK, so that suggests that the when you use the variable MDI_WINDOW... the name of the window is valid.

Did you hard code the valid window name as well. You need to do two other test:

1) hard code a the MDI_WINDOW_NAME instead of using the variable to see if you still get 0,0

2) hard code some other valid window name to see what comes back.

The purpose of these tests is to try and find something that is not working right or to understand the behavior of the forms fuction calls.

If after these calls you are still getting 0,0 then I would suggest to you nothing is wrong and the position of the upper left corner of the window is 0,0.

Kevin
Re: forms_mdi_window problem [message #422204 is a reply to message #422113] Tue, 15 September 2009 01:50 Go to previous messageGo to next message
kamran.it
Messages: 265
Registered: September 2005
Location: Karachi
Senior Member
Nasir

this will help you

Declare
 MDI_Win_Width  Number;
 MDI_Win_Height Number;
 Canvas_width Number;
 Canvas_Height Number;

Begin
/*  This module is to maximize window1 and displays the data canvas in the *\
\*  center of MDI window.                                                  */

     Set_Window_Property(Forms_MDI_Window,Window_State,Maximize);
     Set_Window_Property(Forms_MDI_window,Title,'Crescent Greenwood Ltd.');
    
     MDI_Win_width         := Get_Window_Property(Forms_MDI_Window,Width);
     MDI_Win_Height        := Get_Window_Property(Forms_MDI_Window,Height);
     Canvas_Width  := Get_Canvas_Property('CANVAS2',Width);
     Canvas_Height := Get_Canvas_Property('CANVAS2',Height);
     Set_Window_Property('Window1',Width,Canvas_Width);
     Set_Window_Property('Window1',Height,Canvas_Height);
     
--     Set_Window_Property(FORMS_MDI_WINDOW, WINDOW_STATE, MINIMIZE);
     
     Move_Window('Window1',(MDI_Win_width-Canvas_width)/2,
                           (MDI_Win_Height-Canvas_Height)/2);

       :System.Message_Level := '25';

End;
Re: forms_mdi_window problem [message #422231 is a reply to message #422204] Tue, 15 September 2009 03:32 Go to previous messageGo to next message
nasir_mughal
Messages: 121
Registered: April 2007
Location: Karachi
Senior Member
1) First i tried to use FORMS_MDI_WINDOW as hard coded name instead of variable. like this
DECLARE
	wmdi_height NUMBER;
	wmdi_width NUMBER;
BEGIN

	wmdi_height:=GET_WINDOW_PROPERTY('FORMS_MDI_WINDOW',WIDTH);
	wmdi_width:=GET_WINDOW_PROPERTY('FORMS_MDI_WINDOW',HEIGHT);

	message(wmdi_width||'        '||wmdi_height);
	message(wmdi_width||'        '||wmdi_height);

END;


the same error displayed
Quote:

FRM-41052: Cannot find Window: invalid ID.


2) Then i used valid window name 'WINDOW1' which exist in forms.
a valid width and height (324,540) returned in the message, there was no problem.
DECLARE
	w1_height NUMBER;
	w1_width NUMBER;
BEGIN

	w1_height:=GET_WINDOW_PROPERTY('WINDOW1',WIDTH);
	w1_width:=GET_WINDOW_PROPERTY('WINDOW1',HEIGHT);

	message(w1_width||'        '||w1_height);
	message(w1_width||'        '||w1_height);

END;


It seems that forms recognizes FORMS_MDI_WINDOW but there is some configuration problem or windows setting needs to be changed.

I also searched online help. Following text has been taken from Forms online help.
Quote:


You can set the system of window management to SDI by specifying the USESDI command line option. When SDI is enabled, calls to the FORMS_MDI_WINDOW constant returns NULL for the MDI window handle. There is no multiple interface root window, MDI toolbars exist in parent windows, and MDI menus are attached to each window.



Kindly help me.

Thanks
Re: forms_mdi_window problem [message #422324 is a reply to message #422231] Tue, 15 September 2009 08:50 Go to previous messageGo to next message
Kevin Meade
Messages: 2101
Registered: December 1999
Location: Connecticut USA
Senior Member
At this point, if the window name you are supplying is valid, and it returns 0,0 then I would say your windows position is 0,0.

Kevin
Re: forms_mdi_window problem [message #422409 is a reply to message #422324] Wed, 16 September 2009 04:03 Go to previous messageGo to next message
nasir_mughal
Messages: 121
Registered: April 2007
Location: Karachi
Senior Member
Ok window position is 0,0. but the question is how can i get width and height of forms_mdi_window?
Re: forms_mdi_window problem [message #422411 is a reply to message #421383] Wed, 16 September 2009 04:11 Go to previous messageGo to next message
Kevin Meade
Messages: 2101
Registered: December 1999
Location: Connecticut USA
Senior Member
OK, that was my stupidity. Try this:

FORMS_MDI_WINDOW problem
Kevin
Re: forms_mdi_window problem [message #422417 is a reply to message #422411] Wed, 16 September 2009 04:45 Go to previous messageGo to next message
nasir_mughal
Messages: 121
Registered: April 2007
Location: Karachi
Senior Member
above thread tells

Quote:


Maybe you have SDI window management. When SDI is enabled, calls to the FORMS_MDI_WINDOW constant returns NULL for the MDI window handle.



I don't know if i am using SDI or MDI window management.If SDI then do you have any idea how convert it into MDI.

Re: forms_mdi_window problem [message #423078 is a reply to message #422417] Tue, 22 September 2009 01:05 Go to previous messageGo to next message
djmartin
Messages: 10180
Registered: March 2005
Location: Canberra ACT Australia
Senior Member
Account Moderator
Have you solved your problem?

David
Re: forms_mdi_window problem [message #423445 is a reply to message #423078] Thu, 24 September 2009 04:07 Go to previous messageGo to next message
nasir_mughal
Messages: 121
Registered: April 2007
Location: Karachi
Senior Member
not yet. Please help me.


Thanks.
Re: forms_mdi_window problem [message #425728 is a reply to message #423445] Mon, 12 October 2009 00:55 Go to previous message
djmartin
Messages: 10180
Registered: March 2005
Location: Canberra ACT Australia
Senior Member
Account Moderator
Please post your code (use 'code' tags).

David
Previous Topic: Re: formsweb.cfg configuration
Next Topic: Javamail form - java.security.AccessControlException: access denied-java.net.SocketPermission
Goto Forum:
  


Current Time: Sat Dec 03 01:16:41 CST 2016

Total time taken to generate the page: 0.14161 seconds