On Friday 01 June 2007 07:06, Carl Karsten wrote:
> johnf wrote:
> > On Thursday 31 May 2007 20:48, Paul McNett wrote:
> >> 2) If you have a generic event handler that could receive events from
> >> several objects, you may well need to know what object emitted the
> >> event, so you'd get that reference using evt.EventObject.
>
> I get the concept, but can't see how it would be implemented. what does
> the code look like that uses evt to identify which object the raised the
> event?
>
> > Larry and I use evt.EventObject in our Classes all over the place.
>
> For what?
def OnFindBtn(self,evt):
callFrom = evt.EventObject
self.LookupVal=self.callLookup(callFrom,self.Form)
In this case the evt.EventObject is telling us what control has caused the
event and we can then do something like:
lookUpRegID=callFrom.RegID
We then use the lookUpRegID to determine what we are looking up from a table.
For example:
If the lookUpRegID=='btnVendorCodeID'. In the table I would
lookup 'btnVendorCodeID'. I know this a button because it starts with 'btn',
I know that it is looking for data from the vendor table and I know I'm
looking up the 'CodeID' . After finding the row with the lookUpRegID the
rest of the fields will determine what my search grid will look like (ie the
headers, column data fields, the table to get the data from).
--
John Fabiani
_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-users
Searchable Archives: http://leafe.com/archives/search/dabo-users
This message: http://leafe.com/archives/byMID/dabo-users/[EMAIL PROTECTED]