Solved

Adding OnClick Event to TGraphicControl descendent

Posted on 1998-07-15
3
882 Views
Last Modified: 2013-11-23
I am using a colored bevel which is a descendent of TGraphicControl. How can I add a OnClick event to this component ?
0
Comment
Question by:moonrise
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 10

Expert Comment

by:viktornet
ID: 1357953
When you create your graphic set it's OnClick event to some of you functions that you've created...

type TGraph = class
x,y:integer;
procedures.......
procedure YourCreatedProcedureForOnClick;
OnCreate()...
begin
    yourtype.OnClick := YourCreatedProcedureForOnClick;
Inherited......
end;
procedure YourCreatedProcedureForOnClick;
begin
..your code goes here
end;
Viktor Ivanov
0
 

Accepted Solution

by:
nileq earned 50 total points
ID: 1357954
The most basic events are defined in the objekt type TControl. All Controls inherit these events. Among these basic events are OnClick. So your component allready has this event defined, it's just not visible.
The declarations of standardevents are PROTECTED, as are the methods that corresponds to them. To make a standardevet accessible you need to redeclare the event property as either PUBLIC or PUBLISHED.

To do this you simply add the following code:

TMyControl = Class(TGraphicControl)



PUBLISHED
  property OnClick; //Makes it visible in the objekt inspector
end;

Let me know if it works.
0
 

Author Comment

by:moonrise
ID: 1357955
Thank you, it works great.
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
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…
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.

690 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