Results 1 to 2 of 2

Thread: TCustomFrame IDE probleempje + oplossing...

  1. #1
    Senior Member PsychoMark's Avatar
    Join Date
    Nov 2001
    Location
    Raamsdonksveer
    Posts
    10,269

    TCustomFrame IDE probleempje + oplossing...

    Ik ondervond vandaag ineens een aantal problemen bij het maken van een frame descendant, opeens ging de IDE properties schrijven die helemaal niet bij een frame hoorde, maar bij een TCustomForm, waardoor bij elke wijziging in het frame ik handmatig moest gaan rotzooien in de DFM om ze te verwijderen. Na lang zoeken heb ik 1 post gevonden van iemand die hetzelfde probleem had, en om het makkelijker te maken deze oplossing te vinden voor mensen met dit probleem wou ik die hier even quoten:



    Inheriting a Custom TFrame
    Antoine Borg - Lasercomb Malta Ltd borg@melita.net
    Wed, 17 May 2000 13:54:33 +0200

    --------------------------------------------------------------------------------

    Hi all ...

    I'm not sure if anyone has seen this before but I thought I'd post it for
    your information:

    I have a custom frame (derived from TFrame) which I am using as a base class
    for several other frames in my project. When I wanted to create a new frame
    from my TBaseFrame, I created a new frame through the IDE and then changed
    the interface section from:

    TFrame1 = class (TFrame)

    to

    TFrame1 = class (TBaseFrame)

    This caused me several problems because the IDE decided that it should write
    out some properties to the dfm file which don't exist for a frame. The
    properties it wrote in were OldCreateOrder, PixelsPerInch and TextHeight.
    This caused a problem when I ran my program; a TReader class raised an
    exception claiming that these properties do not exist in frames. I traced
    it back to the dfm file and could not figure out why the IDE was insisting
    on writing these properties out.
    Then I created a second frame from TBaseFrame but using the New dialog box
    instead - I selected the project tab, chose "Inherit" and selected the
    TBaseFrame which was in my project. This did not cause any problems and so
    I compared the dfm files.

    It turns out that the dfm files for frames are slightly different: they
    start off

    inherited GroupFrame: TGroupFrame

    instead of

    object GroupFrame: TGroupFrame

    I changed "object" to "inherited" and had no more problems.


    I thought you might like to know - just in case you ever get a similar
    problem. I would be interested in knowing what the IDE thought it was doing
    though - did it think it had a form instead of a frame? If so, does this
    mean that the IDE writes properties to the dfm file even if they are not in
    the Object Inspector? I thought that it only wrote properties that the
    developer modified through the OI ... any thoughts?

    Regards
    Antoine


    Helaas zit ik nu met het probleem dat ie aangeeft dat m'n TFrame descendant niet herkend wordt, dus misschien stap ik toch over op interfaces in dit geval, maar goed, misschien heeft iemand er wel wat aan
    Qui custodiet ipsos custodes

  2. #2

    Thumbs up

    Ter aanvulling: hetzelfde geldt voor forms en datamodules. Als je een form eerst erft van TForm en dat handmatig aanpast moet je inderdaad ook even je DFM aanpassen.
    Marcel

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Duurt lang voordat controle terugkeert naar IDE
    By abirdonawire in forum Algemeen
    Replies: 6
    Last Post: 09-Mar-04, 18:28
  2. Meerdere monitoren in de Delphi IDE
    By WMeints in forum Algemeen
    Replies: 9
    Last Post: 13-Oct-03, 08:53
  3. verdwijnen van componenten uit ide
    By Neocobe in forum Koffiehoek
    Replies: 2
    Last Post: 20-Jun-03, 14:15
  4. Big IDE Hack
    By GolezTrol in forum Algemeen
    Replies: 1
    Last Post: 08-Nov-02, 12:35

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •