PlanetSquires Forums

Support Forums => Other Software and Code => Topic started by: Wilko Verweij on January 27, 2012, 07:06:14 PM

Title: MDI background
Post by: Wilko Verweij on January 27, 2012, 07:06:14 PM
Hi,
I recently switched to PB10 and FF3.5. When I opened an existing project, everything worked fine except that the MDI background is not displayed correctly while it was OK for PB9 and FF 3.1 (see Figure 1 for how it looks now). The problem is that part of the MDI background has the right color while the other part has not. If a user manually resize the window, the background is drawn correctly (see Fig 2). I tried to find a workaround to change the size in code and then trigger an event but I could not figure out how. Does anybody have a suggestion?

Wilko
Title: Re: MDI background
Post by: Eddy Van Esch on January 27, 2012, 07:38:30 PM
Wilko,

From the looks of it, I would say this is somehow related to something I saw. Please follow up on:
http://www.planetsquires.com/protect/forum/index.php?topic=3039.0

Kind regards
Eddy
Title: Re: MDI background
Post by: Wilko Verweij on January 27, 2012, 07:46:09 PM
Hi Eddy,
That's what I thought too, except that I do not change DPI-settings, just go fro PB9 to PB10. So therefore I created this new topic. But maybe it has to do with your point...

Wilko
Title: Re: MDI background
Post by: Eddy Van Esch on January 27, 2012, 08:05:06 PM
Wilko,

Is your desktop DPI set to the default 96 DPI ?

Eddy
Title: Re: MDI background
Post by: Wilko Verweij on January 27, 2012, 08:18:58 PM
yes
Title: Re: MDI background
Post by: Rolf Brandt on January 28, 2012, 05:10:00 AM
I am using XPPro SP3, but I cannot reproduce the problem.
Do you use the lates version of Josè's files?

Rolf
Title: Re: MDI background
Post by: Wilko Verweij on January 28, 2012, 06:04:08 AM
Yes, I downloaded PB 10, FF 3.51 and the latest JR-includes in one time. I will try to reproduce it with only MDI, later today.
Wilko
Title: Re: MDI background
Post by: Paul Squires on January 28, 2012, 10:59:51 AM
Do you have the "AutoSizeClient" property set to "True"? I guess you must otherwise the client would not resize when you manually size the window with the mouse.

Try adding the following at the end of your WM_CREATE:

FF_Control_Redraw HWND_MDIFORM1_MDICLIENT

I am thinking that maybe the background for the MDIClient is not repainting by the time your Form loads.

Title: Re: MDI background
Post by: Wilko Verweij on January 28, 2012, 04:41:54 PM
When I set autosize to False, the problem indeed disappears, but the correct color is displayed only after the initialisation is complete. What I wanted is to display the window ASAP (and with correct color), then display a (modeless) message box saying 'wait. i'm initialising', for reading data etc.
This worked fine with pb9 and ff 3.1 but now not anymore. No real problem, just annoying me...

Thanks for your help, anyway,
Wilko
Title: Re: MDI background
Post by: Wilko Verweij on February 07, 2012, 08:04:17 PM
Hi,
I took some time to dug into the FF/generated code. FF3.5 uses the CreateMDIWindow Method in Jose's CWindow.inc. FF3.0 (or 3.1) uses a CreateWindowEx-call directly. I do not oversee how this can be solved, but apparently the consequence is that the MDI-client gets the correct color later than it did under FF3.1.