On Sep 21, 2006, at 7:59 AM, Bart Pietercil wrote:
Hi,
fairly new to RB so please stay with me.
Is it possible to add an event to a subclassed editfield an then
generate (call ?) the event so that all the subclassed editfield
start executing the code in this event.
How would I go about that?
The mechanism I'm thinking off is the one I used to work with in
Macromedia Director, called sendAllSprites(#Eventname), or
sendSprite(SpriteName,#Eventname). This generates the event and
triggers all sprites available at that moment that have this event
defined.
This permits to keep the intelligence as closed as needed to an
object.
Want I want to do is subclass an Editfield adding the properties
columname , tablename and isDirty. On textchange IsDirty is set to
true. I want to add an "Update" event that is triggered when the
"Update" button is clicked.
The more I think about it the more it seems like I will be needing
an Interface to do this. Just the part I'm not comfortable with. Oh
well..
If somebody feels inclined to shed some light on this....
If your subclass implements an interface (lets call it Updatable)
which defines the method "Update"
then your code in the update button can do something like
for i = 0 to controlCount - 1
if control(i) isA Updatable then
Updatable(control(i)).Update
end if
next
the only down side to an interface is that the interface cannot
create a default implementation nor can it require properties
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>
Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>