From bd01bf3845fd67dc4e03f56d044b3bc53245eeed Mon Sep 17 00:00:00 2001 From: jacqueline Date: Wed, 12 Jun 2024 16:29:31 +1000 Subject: WIP bump luavgl to latest --- lib/luavgl/src/widgets/dropdown.c | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) (limited to 'lib/luavgl/src/widgets/dropdown.c') diff --git a/lib/luavgl/src/widgets/dropdown.c b/lib/luavgl/src/widgets/dropdown.c index a211c10b..d2bcfc0b 100644 --- a/lib/luavgl/src/widgets/dropdown.c +++ b/lib/luavgl/src/widgets/dropdown.c @@ -36,7 +36,7 @@ LUALIB_API int luavgl_dropdown_set_property_kv(lua_State *L, void *data) /* a base obj property? */ ret = luavgl_obj_set_property_kv(L, obj); if (ret != 0) { - debug("unkown property for dropdown.\n"); + LV_LOG_ERROR("unkown property for dropdown"); } return ret; @@ -72,7 +72,7 @@ static int luavgl_dropdown_get(lua_State *L) } const char *key = lua_tostring(L, 2); - if (strcmp(key, "list") == 0) { + if (lv_strcmp(key, "list") == 0) { lv_obj_t *list = lv_dropdown_get_list(obj); lua_pushlightuserdata(L, list); lua_rawget(L, LUA_REGISTRYINDEX); @@ -83,45 +83,47 @@ static int luavgl_dropdown_get(lua_State *L) return 1; } - if (strcmp(key, "text") == 0) { + if (lv_strcmp(key, "text") == 0) { lua_pushstring(L, lv_dropdown_get_text(obj)); return 1; } - if (strcmp(key, "options") == 0) { + if (lv_strcmp(key, "options") == 0) { lua_pushstring(L, lv_dropdown_get_options(obj)); return 1; } - if (strcmp(key, "selected") == 0) { + if (lv_strcmp(key, "selected") == 0) { lua_pushinteger(L, lv_dropdown_get_selected(obj)); return 1; } - if (strcmp(key, "option_cnt") == 0) { + if (lv_strcmp(key, "option_cnt") == 0) { lua_pushinteger(L, lv_dropdown_get_option_cnt(obj)); return 1; } - if (strcmp(key, "selected_str") == 0) { + if (lv_strcmp(key, "selected_str") == 0) { char buf[64]; lv_dropdown_get_selected_str(obj, buf, sizeof(buf)); lua_pushstring(L, buf); return 1; } - if (strcmp(key, "option_index") == 0) { +#if LV_VERSION_CHECK(8, 3, 0) + if (lv_strcmp(key, "option_index") == 0) { const char *option = lua_tostring(L, 3); lua_pushinteger(L, lv_dropdown_get_option_index(obj, option)); return 1; } +#endif - if (strcmp(key, "symbol") == 0) { + if (lv_strcmp(key, "symbol") == 0) { lua_pushlightuserdata(L, (void *)lv_dropdown_get_symbol(obj)); return 1; } - if (strcmp(key, "dir") == 0) { + if (lv_strcmp(key, "dir") == 0) { lua_pushinteger(L, lv_dropdown_get_dir(obj)); return 1; } -- cgit v1.2.3