Title: Lost Inherited functionality - forms:
Thanks. I think thats part of the solution, and I think the other part lies in Virtual methods and one of the Descendant forms destroying an action, or method or something used by another descendant form. Thats my take ... alls well now, a bit more fiddling and making the construction and destruction of the forms virtual seems to have saved the day...
-----Original Message-----
From: Todd Martin [mailto:[EMAIL PROTECTED]
Sent: Wednesday, 28 May 2003 1:47 p.m.
To: Multiple recipients of list delphi
Subject: Re: [DUG]: Lost Inherited functionality - forms:

Hi James
 
It sounds like double clicking the OK button reassigns the OnClick event for the button and removes a reference to the action. After fiddling with the button, check the object inspector to make sure its OnClick event is empty.
 
Todd.
 
----- Original Message -----
From: James Low
Sent: Wednesday, May 28, 2003 9:50 AM
Subject: [DUG]: Lost Inherited functionality - forms:

This has bugged me for ages, the list is quiet, so maybe someone can help.

I have a Base form with Buttons attached to an actionlist. In the base class I have a protected declaration as follows:

procedure TFrmEditorAbs.aOKExecute(Sender: TObject);
begin
    Assert(FData <> nil, 'FData not assigned');
    Assert(FDataBuffer <> nil, 'FDataBuffer not assigned');
    FData.Assign(FDataBuffer);
    FData.Dirty := true;
    ModalResult := mrOK;
end;

On the Base forms create I build the actions and link them to the OK button:

    FaOK := TAction.Create(FAL);
    FaOK.ActionList := FAL;
    FaOK.Caption := '&OK';
    FaOK.OnExecute := aOKExecute;
    btnOK.Action := FaOK;

This works fine. If I use Delphis IDE and inherit from this form all goes well and I can override aOKExecute in my descendent forms as required. BUT, it seems (D5) is if double click on the OK button in the descendant form, or generally fiddle around and then try to override the AOKExecute I am stuffed. AOkExecute is lost. The code never gets called. All because at some point I have double clicked said OK button and then removed the references from the code (to restore the code window to its prior pristine state). There must be an easy fix, but I usually revert to copying all my code to a new form ... tedious at best.

Any ideas about how this is fixed?

Thanks ...

Notice of Legal Status and Confidential Information: This electronic mail message and any accompanying attachments may contain information that is privileged and CONFIDENTIAL.  If you are not the intended recipient you are advised that any use, review, dissemination, distribution or reproduction of the information is strictly prohibited and may be unlawful.  If you have received this document in error, please notify the sender immediately and destroy the message.

Notice of Legal Status and Confidential Information: This electronic mail message and any accompanying attachments may contain information that is privileged and CONFIDENTIAL. If you are not the intended recipient you are advised that any use, review, dissemination, distribution or reproduction of the information is strictly prohibited and may be unlawful. If you have received this document in error, please notify the sender immediately and destroy the message.

Reply via email to