Rev | Line | |
---|
[1240] | 1 | package gov.va.med.edp.widget {
|
---|
| 2 | import mx.controls.PopUpButton;
|
---|
| 3 | import flash.events.MouseEvent;
|
---|
| 4 | import mx.controls.PopUpMenuButton;
|
---|
| 5 | import mx.core.mx_internal;
|
---|
| 6 |
|
---|
| 7 | use namespace mx_internal;
|
---|
| 8 |
|
---|
| 9 | /**
|
---|
| 10 | * This class contains a workaround for the default behavior of PopUpMenuButton which is to fire an itemClick event
|
---|
| 11 | * when a click event occurs on the main button. PopUpMenuButton doesn't respect preventDefault on the click event
|
---|
| 12 | * object, so we override default behavior by setting openAlways to true and only firing itemClicks on normal menu
|
---|
| 13 | * selections by making parent class think that all clicks are above the arrow button.
|
---|
| 14 | */
|
---|
| 15 | public class OpenAlwaysPopUpMenuButton extends PopUpMenuButton {
|
---|
| 16 | public function OpenAlwaysPopUpMenuButton() {
|
---|
| 17 | super();
|
---|
| 18 | super.openAlways = true;
|
---|
| 19 |
|
---|
| 20 | }
|
---|
| 21 |
|
---|
| 22 | public override function set openAlways(b:Boolean):void {
|
---|
| 23 | // NOOP
|
---|
| 24 | }
|
---|
| 25 |
|
---|
| 26 | mx_internal override function overArrowButton(event:MouseEvent):Boolean
|
---|
| 27 | {
|
---|
| 28 | return true;
|
---|
| 29 | }
|
---|
| 30 | }
|
---|
| 31 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.