From b29773aad834f3a197ae94981d80725b2e92fcc3 Mon Sep 17 00:00:00 2001 From: xianjimli Date: Sun, 8 Apr 2018 07:32:48 +0800 Subject: [PATCH] add edit --- SConstruct | 2 +- demos/demo1_app.c | 2 +- demos/res/raw/theme/theme.xml | 10 + demos/res/src/images/unchecked.data | 2 +- demos/res/src/theme/default.data | 194 +++++++++--------- demos/res/src/ui/dialog1.data | 4 +- demos/xml/edit.xml | 6 + lua/demo2.lua | 4 +- lua/lftk_lua.c | 209 +++++++++++++++++++ src/base/edit.c | 303 ++++++++++++++++++++++++++++ src/base/edit.h | 189 +++++++++++++++++ src/base/enums.c | 20 +- src/base/enums.h | 1 + src/base/events.h | 40 +++- src/base/theme.h | 5 + src/base/types_def.h | 1 + src/base/value.c | 46 ++++- src/base/widget.c | 42 ++-- src/base/widget.h | 19 +- src/base/wstr.c | 8 +- src/base/wstr.h | 1 - src/ui_loader/ui_builder_default.c | 13 +- tests/edit_test.cc | 110 ++++++++++ tests/wstr_test.cc | 6 +- tools/idl_gen/idl.json | 201 +++++++++++++++++- 25 files changed, 1298 insertions(+), 140 deletions(-) create mode 100644 demos/xml/edit.xml create mode 100644 src/base/edit.c create mode 100644 src/base/edit.h create mode 100644 tests/edit_test.cc diff --git a/SConstruct b/SConstruct index f7dce4df4..2f7cbf227 100644 --- a/SConstruct +++ b/SConstruct @@ -31,7 +31,7 @@ os.environ['LIB_DIR'] = LIB_DIR; os.environ['LFTK_ROOT'] = LFTK_ROOT; os.environ['GTEST_ROOT'] = GTEST_ROOT; -CCFLAGS=OS_FLAGS + ' -DLFTK_ROOT=\\\"'+LFTK_ROOT+'\\\" -DWITH_STB_IMAGE -DWITH_STB_FONT' +CCFLAGS=OS_FLAGS + ' -DLFTK_ROOT=\\\"'+LFTK_ROOT+'\\\" -DWITH_STB_IMAGE -DWITH_STB_FONT -DSDL2' DefaultEnvironment(CCFLAGS = CCFLAGS, CPPPATH = [LFTK_ROOT, LFTK_SRC, LFTK_3RD_ROOT, os.path.join(LFTK_3RD_ROOT, 'agg-2.5/include'), LFTK_TOOLS_ROOT] + OS_CPPPATH, LIBS=['lftk', 'agg', 'SDL2'] + OS_LIBS, diff --git a/demos/demo1_app.c b/demos/demo1_app.c index bc6528cdd..fba93d39f 100644 --- a/demos/demo1_app.c +++ b/demos/demo1_app.c @@ -118,7 +118,7 @@ ret_t application_init() { progress_bar = progress_bar_create(win, 10, 80, 168, 20); widget_set_value(progress_bar, 40); - // timer_add(on_timer, progress_bar, 200); + timer_add(on_timer, progress_bar, 200); #ifndef WITH_STM32F103ZE_RAW progress_bar_set_show_text(progress_bar, TRUE); diff --git a/demos/res/raw/theme/theme.xml b/demos/res/raw/theme/theme.xml index b1552f753..f9137a721 100644 --- a/demos/res/raw/theme/theme.xml +++ b/demos/res/raw/theme/theme.xml @@ -31,6 +31,16 @@ + + + +