|
Hi all,
in the 7.5 base image, there seems to be a well hidden bug with the
SpinButtonController. When a notification message was specified in the
UIBuilder, the notification gets sent twice, one for the input field and
one for the controller itself (seems to be intented, although I not
fully understand why).
The first notification is sent *before* the spin up/down change happens
while the second is sent *after* the change, hence both notifications
broadcast a different value. From the code I guess the first one was not
intended to be a validation event (there's no checking), so I assume
this is a bug. The default notification message as specified in the
UIPainter should trigger after a change, as is the case with all other
widgets.
I was wondering why, in my Mac application, the visual changes always
came 1 click late when using the spin button ;-) It is even more
confusing that I didn't yet notice this effect on the Windows platform
(?). Anyway, after examaning the code, it clearly looked like a bug to
me (see below).
Possibly I missed something here, but moving the 2nd trigger 2 lines
down fixed the problem.
Cheers,
Andre
--
SpinButtonController>>pressAction
"Do the action associated with pressing the spin button."
| compositeView |
view isEnabled ifFalse: [^self].
self requestValueChange ifFalse: [^self].
view triggerEvent: #clicked.
compositeView := view container container.
view isUp ifTrue: [view spinUp] ifFalse: [view spinDown].
compositeView controller deactivate valueChange. "## This was 2
lines above"
self valueChange.
compositeView controller activate.
compositeView container container takeKeyboardFocus
|