Solved

Inhertied an event

Posted on 2000-04-08
7
396 Views
Last Modified: 2010-04-04
Hi

I have made a component with TStringGrid as anchestor. In my component I want to get an event to the OnSelectCell event, but I can't override it, because there is another function called SelectCell in TStringGrid. What is the trick here.
0
Comment
Question by:koger
  • 4
  • 3
7 Comments
 
LVL 9

Expert Comment

by:ITugay
ID: 2695920
TYourGrid = class(TStringGrid)
.......
function SelectCell(ACol, ARow: Longint): Boolean; override;
......
end;

function TYourGrid.SelectCell(ACol, ARow: Longint): Boolean;
begin
    // do what you need here  
    //.......
    innerited;
end;


-----
Igor
0
 
LVL 9

Expert Comment

by:ITugay
ID: 2695922
sorry typo...
.....

    //.......
    inherited;
end;
----
Igor.
0
 

Author Comment

by:koger
ID: 2695948
No I wanted to override the event not the function, sorry
0
Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

 
LVL 9

Expert Comment

by:ITugay
ID: 2695962
Then override it. Just declare it in published part and write your own methods to write and read its handleaddress.

property OnSelectCell : TYourEvent read YourGetProc write  YourSetProc;

-----
Igor.
0
 

Author Comment

by:koger
ID: 2696032
Then I wouldn't give me any event in the derived class
0
 
LVL 9

Accepted Solution

by:
ITugay earned 50 total points
ID: 2696069
Of course, you need to do it manually, for example by overriding method in ancestor:

function TYourGrid.SelectCell(ACol, ARow: Longint): Boolean;
begin
   if Assigned(OnSelectCell)
     then OnSelectCell(YourParameters);
   result:=innerited(aCol,aRow);
end;

-----
Igor.
0
 

Author Comment

by:koger
ID: 2696101
:-)
0

Featured Post

VMware Disaster Recovery and Data Protection

In this expert guide, you’ll learn about the components of a Modern Data Center. You will use cases for the value-added capabilities of Veeam®, including combining backup and replication for VMware disaster recovery and using replication for data center migration.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.

803 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question