|
@@ -120,6 +120,13 @@ class Dropdown extends Flow {
|
|
p.horizontalAlign = Right;
|
|
p.horizontalAlign = Right;
|
|
p.verticalAlign = Top;
|
|
p.verticalAlign = Top;
|
|
|
|
|
|
|
|
+ inline function setItem(i) {
|
|
|
|
+ if( selectedItem != i ) {
|
|
|
|
+ selectedItem = i;
|
|
|
|
+ onChange(getItem(i));
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
//
|
|
//
|
|
fake = new Fake(this);
|
|
fake = new Fake(this);
|
|
enableInteractive = true;
|
|
enableInteractive = true;
|
|
@@ -141,14 +148,14 @@ class Dropdown extends Flow {
|
|
|
|
|
|
interactive.onFocusLost = function(e) {
|
|
interactive.onFocusLost = function(e) {
|
|
if (highlightedItem >= 0 && canEdit) {
|
|
if (highlightedItem >= 0 && canEdit) {
|
|
- selectedItem = highlightedItem;
|
|
|
|
|
|
+ setItem(highlightedItem);
|
|
}
|
|
}
|
|
close();
|
|
close();
|
|
}
|
|
}
|
|
|
|
|
|
dropdownList.enableInteractive = true;
|
|
dropdownList.enableInteractive = true;
|
|
dropdownList.interactive.onClick = function(e) {
|
|
dropdownList.interactive.onClick = function(e) {
|
|
- if( canEdit ) selectedItem = highlightedItem;
|
|
|
|
|
|
+ if( canEdit ) setItem(highlightedItem);
|
|
close();
|
|
close();
|
|
}
|
|
}
|
|
dropdownList.interactive.onMove = function(e : hxd.Event) {
|
|
dropdownList.interactive.onMove = function(e : hxd.Event) {
|
|
@@ -279,6 +286,13 @@ class Dropdown extends Flow {
|
|
public dynamic function onClose() {
|
|
public dynamic function onClose() {
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
+ Sent when user change the item in the list.
|
|
|
|
+ @param item An object that was hovered.
|
|
|
|
+ **/
|
|
|
|
+ public dynamic function onChange(item : Object) {
|
|
|
|
+ }
|
|
|
|
+
|
|
/**
|
|
/**
|
|
Sent when user hovers over an item in the dropdown list.
|
|
Sent when user hovers over an item in the dropdown list.
|
|
@param item An object that was hovered.
|
|
@param item An object that was hovered.
|