Bisma Jayadi wrote:
Hi all...

I used to use this trick to get a panel as container for a form on Delphi (7). This trick works very well on Delphi. The trick is about displaying a form (TForm) inside a panel (TPanel) as the form container. It's like TFrame but we can attach any regular forms instead of a frame and we can attach any forms on runtime.

As you said yourself, it is a trick. The support for tricks is very low.
On win32 this works since all window widgets can have a window widget as parent. This means that you can put a form on a form (including borders) On GTK this won't work. There is a far more strickt checking on what parent you set. The only thing I can think of is that we're going to support borderless forms to be placed on a form. In that case the form can be a gtklayout or so.
I wonder if this isn't already supported.

Marc




The code is like this...

procedure TParentForm.AttachForm(AChildFormClass: TCustomFormClass);
begin
  // FChildForm is a private TCustomForm of TParentForm
  FreeAndNil(FChildForm);

  // assign other form to FChildForm and attach it to a panel
  FChildForm := AChildFormClass.Create(nil);
  FChildForm.Top := 1;
  FChildForm.Left := 1;
  FChildForm.BorderStyle := bsNone;
  FChildForm.Parent := PanelContainer;
  FChildForm.Show;
end;

But the code seems not work on Lazarus (I use 0.9.14.1). No errors is raised, but the panel is empty (the child form failed to attach).

Is there any explanation about this? Thanks.

Regards,

-Bee-

has Bee.ography at
http://beeography.wordpress.com

_________________________________________________________________
    To unsubscribe: mail [EMAIL PROTECTED] with
               "unsubscribe" as the Subject
  archives at http://www.lazarus.freepascal.org/mailarchives


_________________________________________________________________
    To unsubscribe: mail [EMAIL PROTECTED] with
               "unsubscribe" as the Subject
  archives at http://www.lazarus.freepascal.org/mailarchives

Reply via email to