Pass clicking actions for a StingList

This commit is contained in:
Grim Maple 2022-11-18 20:39:20 +03:00
parent 3195cc703f
commit 5994fe89bb
1 changed files with 5 additions and 0 deletions

View File

@ -1315,6 +1315,7 @@ class ListWidget : WidgetGroup, OnScrollHandler, OnAdapterChangeHandler {
/// process mouse event; return true if event is processed by widget. /// process mouse event; return true if event is processed by widget.
override bool onMouseEvent(MouseEvent event) { override bool onMouseEvent(MouseEvent event) {
//Log.d("onMouseEvent ", id, " ", event.action, " (", event.x, ",", event.y, ")"); //Log.d("onMouseEvent ", id, " ", event.action, " (", event.x, ",", event.y, ")");
super.onMouseEvent(event);
if (event.action == MouseAction.Leave || event.action == MouseAction.Cancel) { if (event.action == MouseAction.Leave || event.action == MouseAction.Cancel) {
setHoverItem(-1); setHoverItem(-1);
return true; return true;
@ -1410,24 +1411,28 @@ class StringListWidget : ListWidget {
this(string ID = null) { this(string ID = null) {
super(ID); super(ID);
styleId = STYLE_EDIT_BOX; styleId = STYLE_EDIT_BOX;
clickable = true;
} }
this(string ID, string[] items) { this(string ID, string[] items) {
super(ID); super(ID);
styleId = STYLE_EDIT_BOX; styleId = STYLE_EDIT_BOX;
ownAdapter = new StringListAdapter(items); ownAdapter = new StringListAdapter(items);
clickable = true;
} }
this(string ID, dstring[] items) { this(string ID, dstring[] items) {
super(ID); super(ID);
styleId = STYLE_EDIT_BOX; styleId = STYLE_EDIT_BOX;
ownAdapter = new StringListAdapter(items); ownAdapter = new StringListAdapter(items);
clickable = true;
} }
this(string ID, StringListValue[] items) { this(string ID, StringListValue[] items) {
super(ID); super(ID);
styleId = STYLE_EDIT_BOX; styleId = STYLE_EDIT_BOX;
ownAdapter = new StringListAdapter(items); ownAdapter = new StringListAdapter(items);
clickable = true;
} }
@property void items(string[] itemResourceIds) { @property void items(string[] itemResourceIds) {