Board index » delphi » Hiding the flicker a change to mdi child makes

Hiding the flicker a change to mdi child makes

I have a MDI application where I have drawn a picture on the background.

I have a MDI child that starts out as a normal form (formstate=fsNormal).
Then I change formstyle to fsMDIChild.
Now the form is visible, but it doesn't have the properties I wished for,
eg. left, top, width, height etc.
Then set these properties from the forms ini file. The form jumps about.
Finally it is correctly placed, but damn did I see some flickering. Sure did
:(

How can I hide all this jumping around stuff and just have windows paint the
final sized form in the right location.

I have tried locking the controls, but eventhough the form isn't painted it
still messes up the picture below.

This is my lock control routine:

procedure LockControlPaint(Cntrl : TWincontrol; BlnLockStatus : boolean);
begin
  if Assigned (Cntrl) and (Cntrl.Handle > 0) then
  begin
    if BlnLockStatus then
      SendMessage(Cntrl.Handle,WM_SETREDRAW,0,0)
    else
    begin
      SendMessage(Cntrl.Handle,WM_SETREDRAW,1,0);
      RedrawWindow(Cntrl.Handle,nil,0,RDW_ERASE or RDW_FRAME or
RDW_INVALIDATE or RDW_ALLCHILDREN);
    end;
  end;
end;

I call it with the following parameters from the main form:

  frmProject := TfrmProject.Create (Self);

  LockControlPaint (Self, True);
  LockControlPaint (frmProject, True);

  frmProject.FormStyle := fsMDIChild;
  frmProject.LoadProjectFromFile (ProjectFileName);

  LockControlPaint (frmProject, False);
  LockControlPaint (Self, False);

Doesn't work :(

HELP! :)

Hans

 

Re:Hiding the flicker a change to mdi child makes


Quote
In article <3a69f0fe$1_1@dnews>, Hans Fandsen wrote:
> I have a MDI child that starts out as a normal form (formstate=fsNormal).
> Then I change formstyle to fsMDIChild.
> Now the form is visible, but it doesn't have the properties I wished for,
> eg. left, top, width, height etc.
> Then set these properties from the forms ini file. The form jumps about.
> Finally it is correctly placed, but damn did I see some flickering. Sure did
> :(
> How can I hide all this jumping around stuff and just have windows paint the
> final sized form in the right location.

Set the forms dimensions before you change the style to fsMDIChild, and set
the Position property to poDefaultPosOnly. That should work better. The
problem is that Windows insists on creating MDI children visible and at a
default position. One of the many niceties of the MDI subsystem...

Peter Below (TeamB)  100113.1...@compuserve.com)
No e-mail responses, please, unless explicitly requested!
Note: Till Feb.2001 i will only visit the groups on weekends, so  be patient
if i don't reply immediately.

Re:Hiding the flicker a change to mdi child makes


Seems to work better. Not jumping around and gets the right size.
poDefaultPosOnly seems to lock the position which I don't wait as I save
this for my form. But this might be the compromise I must take.

MDI sure is a pain. Maybe one should code something from the bottom up
to replace it.

Hans

"Peter Below (TeamB)" <100113.1...@compuXXserve.com> wrote in message
news:VA.0000676c.015752d5@antispam.compuserve.com...

Quote
> In article <3a69f0fe$1_1@dnews>, Hans Fandsen wrote:
> > I have a MDI child that starts out as a normal form

(formstate=fsNormal).
Quote
> > Then I change formstyle to fsMDIChild.
> > Now the form is visible, but it doesn't have the properties I wished
for,
> > eg. left, top, width, height etc.
> > Then set these properties from the forms ini file. The form jumps about.
> > Finally it is correctly placed, but damn did I see some flickering. Sure
did
> > :(
> > How can I hide all this jumping around stuff and just have windows paint
the
> > final sized form in the right location.

> Set the forms dimensions before you change the style to fsMDIChild, and
set
> the Position property to poDefaultPosOnly. That should work better. The
> problem is that Windows insists on creating MDI children visible and at a
> default position. One of the many niceties of the MDI subsystem...

> Peter Below (TeamB)  100113.1...@compuserve.com)
> No e-mail responses, please, unless explicitly requested!
> Note: Till Feb.2001 i will only visit the groups on weekends, so  be
patient
> if i don't reply immediately.

Re:Hiding the flicker a change to mdi child makes


Quote
In article <3a6f5695_1@dnews>, Hans Fandsen wrote:
> MDI sure is a pain. Maybe one should code something from the bottom up
> to replace it.

MDI alternatives/ SDI workspace apps
http://www.zdjournals.com/ddj/9704/ddj9741.htm
http://www.elementkjournals.com/ddj/9704/ddj9741.htm

Peter Below (TeamB)  100113.1...@compuserve.com)
No e-mail responses, please, unless explicitly requested!
Note: Till Feb.2001 i will only visit the groups on weekends, so  be
patient if i don't reply immediately.

Other Threads