SPAS 3.0 Issue Key: SB-18

Posted date: 2012-05-01 by pozirk


DropButton dispatch CLICK issues


Type Severity Reproducibility Found in Version Affected OS Res
Bug Some progress is possible without resolving this bug. Always SPAS 3.0 alpha 6.2.1 All Systems solved

Expected behavior

UIMouseEvent.CLICK event fires ONCE, when click left button.
UIMouseEvent.CLICK event doesn't fire, when click right button.

Steps to reproduce

var btn : DropButton = new DropButton("text" );
btn.addItem("Label 1", myData1);
btn.addItem("Label 2", myData2);

btn.eventCollector.addEvent(btn, UIMouseEvent.CLICK, onBtnClick);

When I try to choose something from the list by clicking right button, UIMouseEvent.CLICK fires once.
When I click left button, UIMouseEvent.CLICK fires twice.


Resolved in release: SPAS 3.0 alpha 6.2.6


By Pascal2012-05-02 17:12:23
Because DropButtons are UIObjects, and UIObjects already implement UIMouseEvent.CLICK events, we must replace the click event of DropButtons by another different type (DropButtonEvent.CHOICE) to get the expected behavior.
To say it differently, UIMouseEvent.CLICK is a UIObject general event and DropButtonEvent.CHOICE will be a specific DropButton event, only fired by a DropButton's left button click.
By pozirk2012-05-02 16:57:06
Hello Pascal!
As I can understand, there are two events associated with DropButton:
I would say, this is pretty much enough, and there is no need for any other events.
The only problem is that it works not like it is supposed to work. smileAnyway, thank you very much for great framework! It really cool.
By Pascal2012-05-01 23:39:30
Thanks Pozirk,The UIMouseEvent.CLICK event will be replaced by a brand new DropButtonEvent.CHOICE event in the next release.
Post a comment about this issue.