source: EDIS/tags/ed/tracking-ui-core/src/main/flex/gov/va/med/edp/widget/OpenAlwaysPopUpMenuButton.as@ 1240

Last change on this file since 1240 was 1240, checked in by George Lilly, 13 years ago

new version from the VA

File size: 1.0 KB
Line 
1package gov.va.med.edp.widget {
2import mx.controls.PopUpButton;
3import flash.events.MouseEvent;
4import mx.controls.PopUpMenuButton;
5import mx.core.mx_internal;
6
7use 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 */
15public 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.