views:

391

answers:

2

Ever since I upgraded to Delphi 2009, I am having terrible experience with TFrame descendants. Basically, the child components of the frame spills into the host form as object and that causes name crash, class not found etc.. In the dfm, the older Delphi used have have the frame as inline and the child components as inherited. Delphi 2009 IDE now expands the children as object.

Edit: I've seen it happen to multiple forms, but I can't reproduce it with small-scale demo application.

+1  A: 

I don't know what happened to your project, but I just created a brand new D2009 application with:
- a main Form,
- an Ancestor Frame holding an Edit1 and a Label1,
- a Child Frame descending from the Ancestor where I added a Label2 and an Edit2
- an instance of the ChildFrame placed onto the Main Form where I moved slightly the Label2.

Here's the very normal-looking resulting dfm:

object MyForm: TMyForm
  Left = 0
  Top = 0
  Caption = 'MyForm'
  ClientHeight = 286
  ClientWidth = 412
  Color = clBtnFace
  Font.Charset = DEFAULT_CHARSET
  Font.Color = clWindowText
  Font.Height = -11
  Font.Name = 'Tahoma'
  Font.Style = []
  OldCreateOrder = False
  PixelsPerInch = 96
  TextHeight = 13
  inline ChildFrame1: TChildFrame
    Left = 8
    Top = 8
    Width = 313
    Height = 240
    TabOrder = 0
    ExplicitLeft = 8
    ExplicitTop = 8
    ExplicitWidth = 313
    inherited Label2: TLabel
      Left = 162
      ExplicitLeft = 162
    end
  end
end
François
A: 

Are the parent forms properly added to the .dpr?

Marco van de Voort
@Marco, yes they are added to dpr.
eed3si9n