Solved

Inhertied an event

Posted on 2000-04-08
7
395 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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
TVirtualStringTree  search using TEdit 7 106
Simple Delphi Question 9 83
delphi parse string to params 3 100
How to build JSON File in Delphi 6 3 17
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…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
As a trusted technology advisor to your customers you are likely getting the daily question of, ‘should I put this in the cloud?’ As customer demands for cloud services increases, companies will see a shift from traditional buying patterns to new…

867 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

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now