mirror of
https://gitee.com/zlgopen/awtk.git
synced 2024-12-03 04:27:44 +08:00
improve combobox
This commit is contained in:
parent
06d03cf9bf
commit
7b2eea9cbd
@ -289,11 +289,31 @@ static ret_t combo_box_on_event(widget_t* widget, event_t* e) {
|
||||
}
|
||||
break;
|
||||
}
|
||||
case EVT_POINTER_DOWN: {
|
||||
combo_box->pressed = TRUE;
|
||||
break;
|
||||
}
|
||||
case EVT_POINTER_DOWN_ABORT: {
|
||||
combo_box->pressed = FALSE;
|
||||
break;
|
||||
}
|
||||
case EVT_POINTER_UP: {
|
||||
if (widget->target == NULL && edit->readonly && combo_box->pressed) {
|
||||
combo_box_active(widget);
|
||||
return RET_STOP;
|
||||
}
|
||||
combo_box->pressed = FALSE;
|
||||
}
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
ret = edit_on_event(widget, e);
|
||||
edit_set_cursor(WIDGET(edit), 0);
|
||||
if(edit->readonly) {
|
||||
edit_set_cursor(WIDGET(edit), 0);
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
@ -197,6 +197,7 @@ typedef struct _combo_box_t {
|
||||
|
||||
/*private*/
|
||||
str_t text;
|
||||
bool_t pressed;
|
||||
combo_box_option_t* option_items;
|
||||
combo_box_custom_open_popup_t open_popup;
|
||||
} combo_box_t;
|
||||
|
Loading…
Reference in New Issue
Block a user