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
src/dlangui/widgets

View File

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