Thread View: borland.public.cppbuilder.oodesign
4 messages
4 total messages
Started by fwang11
Mon, 18 Oct 2004 08:05
event and OOP
Author: fwang11
Date: Mon, 18 Oct 2004 08:05
Date: Mon, 18 Oct 2004 08:05
11 lines
1007 bytes
1007 bytes
How could a Button object send ButtonClick() event message to a Form object? It is not an OOP concept. The Form object "has a" Button object. So, a button can not send message to a form object. The ButtonClick event handler is IDE-managed, it is not OOP.
Re: event and OOP
Author: Stuart Borden
Date: Tue, 19 Oct 2004 06:34
Date: Tue, 19 Oct 2004 06:34
21 lines
1611 bytes
1611 bytes
On 18 Oct 2004 01:05:53 -0700, "fwang11" <fwang11@pub3.fz.fj> wrote: > > >How could a Button object send ButtonClick() event message to >a Form object? It is not an OOP concept. >The Form object "has a" Button object. >So, a button can not send message to a form object. > It does not. The form actually sends the message to the "button" that the button has been clicked, then the button acts upon that information. >The ButtonClick event handler is IDE-managed, it is not OOP. Don't confuse OOP with how a program actually functions. They are not always related. But in this case, they are. Advice: Look into message handling by Windows and VCL. You will begin to see the burdensome reality of OOP. Stuart B.
Re: event and OOP
Author: fwang11
Date: Wed, 20 Oct 2004 08:08
Date: Wed, 20 Oct 2004 08:08
13 lines
1484 bytes
1484 bytes
Stuart Borden <sborden@spectrontech.com> wrote: >On 18 Oct 2004 01:05:53 -0700, "fwang11" <fwang11@pub3.fz.fj> wrote: >>How could a Button object send ButtonClick() event message to >>a Form object? It is not an OOP concept. >>The Form object "has a" Button object. >>So, a button can not send message to a form object. >> > >It does not. The form actually sends the message to the "button" that the button has been clicked, then the button acts >upon that information. It does. The ButtonClick() event handler is called from Button object to Form object.
Re: event and OOP
Author: Alisdair Meredith [TeamB]
Date: Wed, 27 Oct 2004 14:00
Date: Wed, 27 Oct 2004 14:00
19 lines
1701 bytes
1701 bytes
fwang11 wrote: > It does. The ButtonClick() event handler is called from Button object > to Form object. No, the button objects stores a callback object, of a special BCB type called a __closure. If such an object is stored in its OnClick property, it asks it to perform its action. When the form loads, it sets various properties of the Button object it owns, such as Caption, Top and Left. It may also set a value for the OnClick property, by making the appropriate callback object. So the button knows nothing about the form, all it knows is the callback. The callback is created by the form, and typically points to a bound member function in itself. That is OK though, as the form has the info to do this, not the button. AlisdairM(TeamB)
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads