VA8: Hover Help broken for Sliders - fixed in V8.0.1

VA Smalltalk is a "100% VisualAge compatible" IDE that includes the original VisualAge technology and the popular VA Assist and WidgetKit add-ons.

Moderators: Eric Clayberg, wembley, tc, Diane Engles, solveig

VA8: Hover Help broken for Sliders - fixed in V8.0.1

Postby cknittel » Mon Jun 22, 2009 11:49 pm

Hi,

Hover Help was changed between VA 7.5 and VA 8.0. As a consequence, hover help for sliders is now broken (Exception: "EwSlider does not understand parentView").

If I add EwSlider to the special cases handled in the new method CwDrawingArea>>#associatedPart, hover help for sliders works fine again:

Code: Select all
associatedPart
   "Private - Answer the part associated with the receiver.
   
   This is a slight hack to get around the fact that the internal structure of some parts is more complicated
   than a single common widget pointing back to the part to which it belongs."

   | w |
   ((w := self userData) isKindOf: EwNotebook)   
      ifTrue: [^w associatedPart ].
   ((w isKindOf: EwIconTree) or: [w isKindOf: EwIconList])
      ifTrue: [^w associatedPart].
   (w isKindOf: EwIconArea)
      ifTrue: [^w associatedPart].
   (w isKindOf: EwTableList)
      ifTrue: [^w associatedPart].

   "=== added by Christoph ==="
   (w isKindOf: EwSlider)
      ifTrue: [^w associatedPart].
   "=== added by Christoph ==="

   ^super associatedPart

Please include this fix in the next VA version.

BTW, couldn't this be done in a slightly less ugly way? ;-) Maybe something like

Code: Select all
associatedPart
   | w |
   w := self userData.

   ^w class needsDrawingAreaHoverHelpHack
      ifTrue: [ w associatedPart ]
      ifFalse: [ super associatedPart ].

?

Thanks and best regards,
Christoph
cknittel
 
Posts: 27
Joined: Tue Nov 28, 2006 6:10 am
Location: Vienna - Austria

Re: VA8: Hover Help broken for Sliders

Postby wembley » Tue Jun 23, 2009 6:22 am

Christoph -

You are correct, the code is very ugly. What this code is attempting to do is determine the actual part associated with a widget. I think there is a much simpler way to do that:

Code: Select all
CwWidget>>#associatedPart
   "Answer the part associated with the receiver.  Most parts wrap a single
    widget that points directly back to the part, but some parts wrap nested
    widgets and recursive dereferencing is needed to find the part from the widget."

   | part |

   part := self userData.
   ^ (part isNil or: [ part isBasicView ])
      ifTrue: [ part ]   
      ifFalse: [ part associatedPart ]

Object>>#isBasicView
   "Answer true if this is a basic view part."

   ^false


All the other implementations of #associatedPart can be removed. Please try this out and let me know if it works for you. Case 41884 opened.
John O'Keefe [|], Principal Smalltalk Architect, Instantiations Inc.
wembley
Moderator
 
Posts: 405
Joined: Mon Oct 16, 2006 3:01 am
Location: Durham, NC

Re: VA8: Hover Help broken for Sliders

Postby cknittel » Tue Jun 23, 2009 7:18 am

Hi John,

This works fine for me, thanks a lot! Great solution!

Best regards,
Christoph
cknittel
 
Posts: 27
Joined: Tue Nov 28, 2006 6:10 am
Location: Vienna - Austria


Return to VA Smalltalk 7.0, 7.5 & 8.0

Who is online

Users browsing this forum: Yahoo [Bot] and 1 guest