Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Adding OnClick Event to TGraphicControl descendent

Posted on 1998-07-15
3
Medium Priority
?
908 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 200 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

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

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

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
Video by: ITPro.TV
In this episode Don builds upon the troubleshooting techniques by demonstrating how to properly monitor a vSphere deployment to detect problems before they occur. He begins the show using tools found within the vSphere suite as ends the show demonst…
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …
Suggested Courses

610 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