Hi all,
I have created a class which contains many TShapes, TLabels and
TPanels. What I want to be able to do is when creating this class, is
passing in a pointer to OnMouseDown and OnMouseUp events. Thereby, the
user of the class can create their own event handlers for those events.
The idea is that by passing in the event handlers, these event
handlers are assigned to the appropriate events for each of the objects
in the class. However, I am having trouble declaring the constructor:
eg.
class SpecialButton : public TObject {
__published:
TShape *TLCorner;
TShape *TRCorner; // ...etc....
__public:
__fastcall SpecialButton(T MouseEvent mouseDown, TMouseEvent
mouseUp); // ??????
};
Your suggestions on this would be greatly appreciated.
Thanks,
Kyzer 2 2913
> Hi all, I have created a class which contains many TShapes, TLabels and TPanels. What I want to be able to do is when creating this class,
is passing in a pointer to OnMouseDown and OnMouseUp events. Thereby,
the user of the class can create their own event handlers for those
events. The idea is that by passing in the event handlers, these event handlers are assigned to the appropriate events for each of the
objects in the class. However, I am having trouble declaring the
constructor: eg. class SpecialButton : public TObject { __published:
What's __published?
TShape *TLCorner; TShape *TRCorner; // ...etc....
__public:
What's __public?
__fastcall SpecialButton(T MouseEvent mouseDown, TMouseEvent mouseUp); // ??????
What's __fastcall? };
Your suggestions on this would be greatly appreciated.
What's the problem?
Jonathan
"Kyzer" <ky******@hotma il.com> wrote in message news:11******** **************@ g14g2000cwa.goo glegroups.com.. . Hi all,
I have created a class which contains many TShapes, TLabels and TPanels. What I want to be able to do is when creating this class, is passing in a pointer to OnMouseDown and OnMouseUp events. Thereby, the user of the class can create their own event handlers for those events. The idea is that by passing in the event handlers, these event handlers are assigned to the appropriate events for each of the objects in the class. However, I am having trouble declaring the constructor:
eg. class SpecialButton : public TObject { __published: TShape *TLCorner; TShape *TRCorner; // ...etc....
__public: __fastcall SpecialButton(T MouseEvent mouseDown, TMouseEvent mouseUp); // ?????? };
Your suggestions on this would be greatly appreciated.
Try newsgroups.borl and.com and look for a discussion with
VCL in the title. You'll get better help there. What you probably
want to do is to define a virtual function called by the event and allow
a derived class to override it.
BTW, even Borland doesn't support __public: AFAIK. This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: Pavils Jurjans |
last post by:
Hallo,
I have been programming for restricted environments where Internet Explorer
is a standard, so I haven't stumbled upon this problem until now, when I
need to write a DOM-compatible code.
The question is about best practices for passing parameters to an event
function.
I have, say, the following HTML:
|
by: Bender |
last post by:
Hi,
I am wanting to capture an onmousedown event without firing the body tags
onload event.
Also, if anyone could explain why this happens that would be excellent. I
can't see how an onmousedown event could bubble up to an onload event.
NOTE: If you put an alert() statement in the onmousedown event handler the
body onload event doesn't get fired.
|
by: coolsti |
last post by:
I am trying to let the user drag a rectangle over an image, which will
then let the user zoom in on the dragged area. However, I am doing
something wrong in implementing the onmousedown and onmouseup events.
Everything is very simple so far. I just defined an onMouseDown event to
record the event's x and y locations as the starting point, and an
onMouseUp event to record the x and y of the end point, and this function
gives me the...
|
by: sameth |
last post by:
I wrote a script that uses onmousedown and onmouseup in javascript that
works great in ie and firefox on windows2000. It looks as if the
pocketpc 2003 ie browser dosn't support onmousedown or onmouseup and
only such as onclick.
I need to be able to submit a form when the mouse is held down on a
button and submit a different form when the mouse is lifted up from the
button. could anyone tell me of anything I could substitute onmousedown...
|
by: RC |
last post by:
<a href="#" onmousedown="callMyFunction()">Press the mouse button</a>
What I expect is when I or an user move mouse pointer over that link,
and press the mouse button. Then will "callMyFunction()" over and
over again until I release the mouse button (mouseup).
But what I found out the onmousedown is just acts the same as onclick.
It only "callMyFunction" once. If I want to call again, I need to
keep repeat mousedown, mouseup like...
| |
by: jon |
last post by:
Hello,
I'm trying to experiment with some javascript to do some custom
dragdrop handling. I wish to use the onMouseDown event to trigger the
start of my drag, and onMouseup for a potentential drop. I hope to
turn on the onmouseup only in onmousedown. And eventually go one step
further and incorporate onmousemove for a true drag workflow.
I'm running into a problem however, where after mousedown, mouseup will
not fire when I release...
|
by: simon |
last post by:
hi,
I would like to separate my javascript completely from my xhtml. in the
end there should be only
<script type="text/javascript" src="javalib.js"></script>
in the head-tag to my javascript.
Because I want to use some ajax-requests and other javascript-functions
on my xhtml, I need to dynamically add event handlers to any possible
dom-elements. All solutions I found so fare are for specific, pre-known
|
by: NeilCarmichael |
last post by:
I am flummoxed, I'm relatively new to javascript and I can't get my
onmousedown onmouseup script to work.
simply, I want to fire one function when I click down on a graphic and
a second when I release.
I tried different combinations of onmousedown onmouseup and onclick
and putting them in div's img's and anchor's but I can't get it to
work, any ideas?
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
| |
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
|
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |