ActiveX events 
Author Message
 ActiveX events

I noticed some odd behavior with #focusGained and #focusLost while trying to
subclass a third-party control under AXControlSite (actually,
AXValueConvertingControlSite).  It seems that when you tab from control to
control, #focusLost is triggered before #focusGained when entering a hosted
control and #focusLost is not triggered at all when leaving a control site.
Regular (i.e., non-hosted) controls seem to work fine.  I wasn't able to
find any code in Dolphin to account for this anomaly.

Below is some workspace code that illustrates the problem (you'll need to
fileIn the method at the bottom).  It creates a shell with two vanilla
controls (TextEdit and DateTimePicker) and two hosted controls (MaskedEdit
and MonthView).  Tab through the controls and see what's printed in the
Transcript.

-- Louis

shell := Shell show.
sv := shell view.

text := sv addSubView: TextEdit new.

textP := TextPresenter new view: text.
textP when: #focusGained send: #displayWithCR: to: Transcript with: 'focus
gained: textP'.
textP when: #focusLost send: #displayWithCR: to: Transcript with: 'focus
lost: textP'.

mask := sv addSubView: (MaskedEdit new model: String new asValue).

maskP := TextPresenter new view: mask.
maskP when: #focusGained send: #displayWithCR: to: Transcript with: 'focus
gained: maskP'.
maskP when: #focusLost send: #displayWithCR: to: Transcript with: 'focus
lost: maskP'.

month := sv addSubView: (MonthView new model: Date today asValue).

monthP := DatePresenter new view: month.
monthP when: #focusGained send: #displayWithCR: to: Transcript with: 'focus
gained: monthP'.
monthP when: #focusLost send: #displayWithCR: to: Transcript with: 'focus
lost: monthP'.

date := sv addSubView: (DateTimePicker new model: Date today asValue).

dateP := DatePresenter new view: date.
dateP when: #focusGained send: #displayWithCR: to: Transcript with: 'focus
gained: dateP'.
dateP when: #focusLost send: #displayWithCR: to: Transcript with: 'focus
lost: dateP'.

!TranscriptShell methodsFor!

displayWithCR: anObject
 "Ask anObject to append its end-user textual description to the receiver,
and add a cr."

 self
  display: anObject;
  cr! !
!TranscriptShell categoriesFor: #displayWithCR:!printing!public! !



Thu, 26 May 2005 06:55:33 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. APL+Win ActiveX event handling

2. Activex events for InternetExplorer.Application

3. How to handle ActiveX events?

4. ErrorHandling in ActiveX events

5. ActiveX events don't fire with 6i ?

6. ActiveX Events in Labview are not working

7. ActiveX Events in Labview are not working

8. ActiveX event missing

9. Eksampels of ActiveX Events

10. ActiveX Events from ATL Automation Server?

11. activex events

12. ActiveX Events

 

 
Powered by phpBB® Forum Software