Jump to content

Question regarding frames


Rav

Recommended Posts

Hello,

I need that all my Frames have the same virtual method RefreshData.

I created a common ancestor for the frames:

  TCommonFrame = class(TUniFrame)
     procedure RefreshData; virtual;abstract;
  end;

and placed it into MainModule. For my actual Frames I changed manually their ancestor from TUniFrame to TCommonFrame:

  TUniFrame1 = class(TCommonFrame)    
    procedure RefreshData;override;
  end;

where I overrided the RefreshData method.

Everything looks nice and works fine until the moment when I decides to "View as Text" any Frame or merely restart Delphi.

After that any my Frame immediately starts looking as a Form (border view is changed), a lot of errors appear and nothing works.

Where did I make a mistake? Ho to do it properly?

 

I also tried using Class Helper for TUniFrame with a single RefreshData method, compilation was successful, but running caused access violation.

 

Another question, the Forms OnDestroy handler is called earlier than OnDestroy of the Frames it owns. Is it normal?

 

I have made workarounds so the questions above are just theoretical

Link to comment
Share on other sites

  • 3 years later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...