moosetechnology / Moose

MOOSE - Platform for software and data analysis.
https://moosetechnology.github.io/moose-wiki
MIT License
136 stars 34 forks source link

Mondrian - broken popupText: #792

Closed seandenigris closed 9 years ago

seandenigris commented 9 years ago

Originally reported on Google Code with ID 792


I have isolated what I assume is an issue introduced in ConfigurationOfMondrian-AlexandreBergel.332
with #popupText: 

Test Case to execute in Mondrian Easel...
    view interaction popupText: [ :es | 'popupText works'].
    view shape label.
    view node: 'node value'.

With a freshly unzipped Moose_Suite_4_6, 
hovering over the node displays a blue box that says 'popupText works'

Using Monticello Browser to load ConfigurationOfMondrian-AlexandreBergel.331 then doing
'(Smalltalk at: #ConfigurationOfMondrian) project lastVersion load'
has the same behaviour.

With Monticello Browser, loading ConfigurationOfMondrian-AlexandreBergel.332 then doing
'(Smalltalk at: #ConfigurationOfMondrian) project lastVersion load'
hovering over the node displays a white box that says 'node value'

This behaviour persists through to current 
ConfigurationOfMondrian-AlexandreBergel.348

The comment on 332 is: 2.147 : Pharo ground is seriously shaking those days... popupText:
does not use the Pharo popup, it instead uses popupView:

Platform: Windows 7

Reported by benjamin.t.coman on 2012-04-26 14:07:22

seandenigris commented 9 years ago
MOAnnouncer>>popupView: aBlock delay: ms zoomedInBy: aSymbolOrABlock

aBlock is never used.

Reported by benjamin.t.coman on 2012-04-26 14:54:25

seandenigris commented 9 years ago
This fixes it for me

MOAnnouncer>>popupText: aBlock delay: ms
    "open a popup text when the mouse enter a node"
    self popupView: 
        [ :el :myView |
            myView shape rectangle.
            myView node: 'popup' forIt: 
            [   | popupText |
                popupText := [aBlock value: el ] on: Error do: [ el asString ].
                myView shape label.
                myView node: popupText 
            ].
        ] delay: ms

but I think there is more to it than that. The equivalent from version "VeronicaUquillas
7/20/2011 11:07" had the following, but I can't get that to work myself...

ifTrue:[ MOPopup show: ([aBlock value: ann element source model value: ann element
target model ] on: Error do: [ [ (aBlock moValue: ann modelElement) asString ] on:
Error do: [ 'Error when printing' ] ])      

ifFalse:[ MOPopup show: ([ (aBlock moValue: ann modelElement) asString ] on: Error
do: [ 'Error when printing' ]) asString  ] 

Reported by benjamin.t.coman on 2012-04-26 15:23:43

seandenigris commented 9 years ago
I have uploaded... Mondrian-Pharo-Morphic-BenComan.34 "Partial fix of MOAnnouncer>>popupText:
aBlock delay: ms for Issue 792.  "

The use of the temporary variable was for clarity, and might be removed upon review
- but shouldn't add much delay in terms of human reaction time :)

This works as expected displaying for 'node value' for the following...
    view interaction popupText: [ :es | |x| 1/0 ].
    view shape label.
    view node: 'node value'.

Reported by benjamin.t.coman on 2012-04-26 15:41:08

seandenigris commented 9 years ago
Thanks. I will close the issue.

Reported by tudor@tudorgirba.com on 2012-09-10 06:12:41