diff --git a/README.md b/README.md index 23de31d..cf221fb 100644 --- a/README.md +++ b/README.md @@ -1,16 +1,28 @@ # GuiLite - 简洁出奇迹 +- [功能介绍](#功能介绍) +- [实例程序](#实例程序) +- [开发文档](#开发文档) +- [致谢](#致谢) +*** +## GuiLite是什么鬼? - GuiLite(超轻量UI框架)是5千行代码的**全平台UI框架**,可以完美运行在iOS,Android,Windows(包含VR),Mac,单片机和**市面所有的 ARM Linux物联网终端设备**上。 - GuiLite可以嵌入在iOS、Android、MFC、QT等其他UI系统中,让你的界面集百家之长,又不失个性。 -- GuiLite鼓励混合编程,开发者可以用GuiLite接管UI部分,用Swift,Java,Go,C#,Python发开业务部分。 +- GuiLite鼓励混合编程,开发者可以用GuiLite接管UI部分,用Swift,Java,Go,C#,Python开发业务部分。 相比QT、MFC,GuiLite不预设开发者的使用场景,不在具体功能上,大包大揽;用框架的简洁,换取开发的自由;GuiLite在图形绘制上面,力图一步到位,运行效率感人。 -## 新功能:多语言demo -- HelloFont -![HelloFont](doc/HelloFont.gif) +## 为什么开发GuiLite?如何使用? +- 任何UI框架都不是为你我而生的,只有掌握核心原理,对其深度定制,才能真正掌握自己的命运!因此,我们开发了GuiLite,希望用这5千行代码揭示UI的核心原理和定制方法。 +- 我们不推荐开发者全盘使用GuiLite;鼓励开发者在吃透代码后,根据自身业务特点,修改出更加丰富、个性的界面;或者发展出适合自己的UI框架。 +- 为了聚焦UI核心原理,GuiLite会一直保持单片机的代码体量。 -**信不信由你,代码只有100+行!**[查阅代码](https://gitee.com/idea4good/GuiLiteSamples/blob/master/HelloFont/UIcode/UIcode.cpp) +## 新功能:滑屏demo -- HelloSlide +![HelloSlide](doc/HelloSlide.gif) -## 卓越的跨平台能力 +**信不信由你,代码只有100+行!**[查阅代码](https://gitee.com/idea4good/GuiLiteSamples/blob/master/HelloSlide/UIcode/UIcode.cpp) + +## 功能介绍 +### 卓越的跨平台能力 在Mac, iOS下的运行效果: ![Mac](doc/Mac.gif) ![iOS](doc/Ios.landscape.gif) @@ -23,7 +35,7 @@ ![Win MR](doc/WinMR.gif) -## 万国语和墙纸 +### 万国语和墙纸 墙纸: ![unicode](doc/wallpaper.jpg) @@ -32,12 +44,12 @@ [如何制作多种文字/位图资源?](https://github.com/idea4good/GuiLiteToolkit) -## “换肤”功能 +### “换肤”功能 ![multi-theme](doc/multi-theme.png) -[如何“换肤”?](https://github.com/idea4good/GuiLiteSamples/blob/master/HostMonitor/SampleCode/source/resource/resource.cpp) +[如何“换肤”?](https://gitee.com/idea4good/GuiLiteSamples/blob/master/HostMonitor/SampleCode/source/resource/resource.cpp) -## 自我监控 +### 自我监控 **上报“编译/运行”情况至“云端”:** ![BuildInfo](doc/BuildInfo.png) @@ -46,34 +58,27 @@ ![DataOnCloud](doc/data_on_cloud.png) -## 为什么开发GuiLite?如何使用? -任何UI框架都不是为你我而生的,只有掌握核心原理,对其深度定制,才能真正掌握自己的命运!因此,我们开发了GuiLite,希望用这5千行代码揭示UI的核心原理和定制方法。 - -我们不推荐开发者全盘使用GuiLite;鼓励开发者在吃透代码后,根据自身业务特点,修改出更加丰富、个性的界面;或者发展出适合自己的UI框架。 - -为了聚焦UI核心原理,GuiLite会一直保持单片机的代码体量。 - -## 快速上手 -- 下载实例代码: `git clone https://gitee.com/idea4good/GuiLiteSamples` -- `cd GuiLiteSamples\HostMonitor` -- [编译/运行在任意平台上](https://gitee.com/idea4good/GuiLiteSamples/tree/master/HostMonitor/README.md) +## 实例程序 +GuiLite只是一个框架,本身并不能生成UI。为了能够展示如何用GuiLite开发App,我们提供了一些实例程序给大家参考。 +- 点击[这里](https://gitee.com/idea4good/GuiLiteSamples)预览UI效果。 +- 实例程序的功能说明: +| 实例名称 | 支持的平台 | 功能简介 | 编译方法 | 难度 | +| --- | --- | --- | --- | --- | +| HelloGuiLite | Windows, Linux | 初始化GuiLite,加载资源,布局界面元素,按钮响应 | [编译/运行](https://gitee.com/idea4good/GuiLiteSamples/blob/master/HelloGuiLite/README.md) | 初级 | +| HelloFont | Windows, Linux | 显示多种语言(不限:中、英文) | [编译/运行](https://gitee.com/idea4good/GuiLiteSamples/blob/master/HelloFont/README.md) | 初级 | +| HelloSlide | Windows, Linux | 滑屏界面的应用 | [编译/运行](https://gitee.com/idea4good/GuiLiteSamples/blob/master/HelloSlide/README.md) | 中级 | +| HostMonitor | iOS, Mac, Android, Windows, Linux | 创建复杂界面,扩展自定义控件,适配全平台 | [编译/运行](https://gitee.com/idea4good/GuiLiteSamples/blob/master/HostMonitor/README.md) | 高级 | ## 开发文档 -[代码结构及注释](doc/CodeWalkthrough-cn.md) - -[如何编译?](doc/HowToBuild.md) - -[如何布局UI?](doc/HowLayoutWork.md) - -[如何传递消息?](doc/HowMessageWork.md) +- [如何编译?](doc/HowToBuild.md) +- [设计原理](doc/CodeWalkthrough-cn.md) +- [UML示意图](doc/UML.md) +- [如何布局UI?](doc/HowLayoutWork.md) +- [如何传递消息?](doc/HowMessageWork.md) ## 视频链接: -[GuiLite简介](https://v.youku.com/v_show/id_XMzA5NTMzMTYyOA) - -[3D GuiLite](https://v.youku.com/v_show/id_XMzYxNTE3MTI0MA) - -## 实例代码链接 -[GuiLiteSamples](https://gitee.com/idea4good/GuiLiteSamples) +- [GuiLite简介](https://v.youku.com/v_show/id_XMzA5NTMzMTYyOA) +- [3D GuiLite](https://v.youku.com/v_show/id_XMzYxNTE3MTI0MA) ## GitHub链接 [GitHub链接](https://github.com/idea4good/GuiLite) diff --git a/core/core_include/display.h b/core/core_include/display.h index b5dedb7..2f8e108 100644 --- a/core/core_include/display.h +++ b/core/core_include/display.h @@ -7,6 +7,7 @@ class c_hid_pipe; class c_surface; class c_display { + friend class c_surface; public: c_display(void* phy_fb, unsigned int display_width, unsigned int display_height, unsigned int surface_width, unsigned int surface_height, @@ -16,13 +17,15 @@ public: unsigned int get_width() { return m_width; } unsigned int get_height() { return m_height; } - void* get_frame_buffer(int* width, int* height); + void* get_updated_fb(int* width, int* height, bool force_update = false); int snap_shot(const char* file_name); private: unsigned int m_width; //in pixels unsigned int m_height; //in pixels unsigned int m_color_bytes; //16 bits, 32 bits only void* m_phy_fb; + int m_phy_read_index; + int m_phy_write_index; c_surface* m_surface_group[SURFACE_CNT_MAX]; unsigned int m_surface_cnt; }; diff --git a/core/core_include/surface.h b/core/core_include/surface.h index fb59975..2453554 100644 --- a/core/core_include/surface.h +++ b/core/core_include/surface.h @@ -46,7 +46,7 @@ protected: void set_surface(void* wnd_root, Z_ORDER_LEVEL max_z_order); int copy_layer_pixel_2_fb(int x, int y, unsigned int z_order); - c_surface(c_display* display, void* phy_fb, unsigned int width, unsigned int height, unsigned int color_bytes); + c_surface(c_display* display, unsigned int width, unsigned int height, unsigned int color_bytes); int m_width; //in pixels int m_height; //in pixels int m_color_bytes; //16 bits, 32 bits only @@ -57,13 +57,14 @@ protected: Z_ORDER_LEVEL m_max_zorder; Z_ORDER_LEVEL m_top_zorder; void* m_phy_fb; + int* m_phy_write_index; c_display* m_display; }; class c_surface_16bits : public c_surface { friend class c_display; - c_surface_16bits(c_display* display, void* phy_fb, unsigned int width, unsigned int height, unsigned int color_bytes) : - c_surface(display, phy_fb, width, height, color_bytes) {}; + c_surface_16bits(c_display* display, unsigned int width, unsigned int height, unsigned int color_bytes) : + c_surface(display, width, height, color_bytes) {}; virtual void draw_pixel(int x, int y, unsigned int rgb, unsigned int z_order); virtual void fill_rect(int x0, int y0, int x1, int y1, unsigned int rgb, unsigned int z_order); virtual void fill_rect_on_fb(int x0, int y0, int x1, int y1, unsigned int rgb); diff --git a/core/src/display.cpp b/core/src/display.cpp index cc9f0e3..311cab0 100644 --- a/core/src/display.cpp +++ b/core/src/display.cpp @@ -22,6 +22,7 @@ c_display::c_display(void* phy_fb, unsigned int display_width, unsigned int disp m_height = display_height; m_color_bytes = color_bytes; m_phy_fb = phy_fb; + m_phy_read_index = m_phy_write_index = 0; m_surface_cnt = surface_cnt; if (m_surface_cnt > SURFACE_CNT_MAX) @@ -31,8 +32,8 @@ c_display::c_display(void* phy_fb, unsigned int display_width, unsigned int disp memset(m_surface_group, 0, sizeof(m_surface_group)); for (int i = 0; i < m_surface_cnt; i++) { - m_surface_group[i] = (color_bytes == 4) ? new c_surface(this, m_phy_fb, surface_width, surface_height, color_bytes) : - new c_surface_16bits(this, m_phy_fb, surface_width, surface_height, color_bytes); + m_surface_group[i] = (color_bytes == 4) ? new c_surface(this, surface_width, surface_height, color_bytes) : + new c_surface_16bits(this, surface_width, surface_height, color_bytes); } } @@ -75,7 +76,7 @@ int c_display::merge_surface(c_surface* s0, c_surface* s1, int x0, int x1, int y int surface_width = s0->get_width(); int surface_height = s0->get_height(); - if (offset < 0 || offset >= surface_width || y0 < 0 || y0 >= surface_height || + if (offset < 0 || offset > surface_width || y0 < 0 || y0 >= surface_height || y1 < 0 || y1 >= surface_height || x0 < 0 || x0 >= surface_width || x1 < 0 || x1 >= surface_width) { ASSERT(FALSE); @@ -83,7 +84,7 @@ int c_display::merge_surface(c_surface* s0, c_surface* s1, int x0, int x1, int y } int width = (x1 - x0 + 1); - if (width < 0 || width >= surface_width || width < offset) + if (width < 0 || width > surface_width || width < offset) { ASSERT(FALSE); return -1; @@ -104,16 +105,26 @@ int c_display::merge_surface(c_surface* s0, c_surface* s1, int x0, int x1, int y addr_d = ((char*)(m_phy_fb) + (y * m_width + x0 + (width - offset)) * m_color_bytes); memcpy(addr_d, addr_s, offset * m_color_bytes); } + m_phy_write_index++; return 0; } -void* c_display::get_frame_buffer(int* width, int* height) +void* c_display::get_updated_fb(int* width, int* height, bool force_update) { if (width && height) { *width = get_width(); *height = get_height(); } + if (force_update) + { + return m_phy_fb; + } + if (m_phy_read_index == m_phy_write_index) + {//No update + return NULL; + } + m_phy_read_index = m_phy_write_index; return m_phy_fb; } diff --git a/core/src/surface.cpp b/core/src/surface.cpp index ff4d21b..aea40e1 100644 --- a/core/src/surface.cpp +++ b/core/src/surface.cpp @@ -8,13 +8,14 @@ #include #include -c_surface::c_surface(c_display* display, void* phy_fb, unsigned int width, unsigned int height, unsigned int color_bytes) +c_surface::c_surface(c_display* display, unsigned int width, unsigned int height, unsigned int color_bytes) { m_width = width; m_height = height; m_color_bytes = color_bytes; m_display = display; - m_phy_fb = phy_fb; + m_phy_fb = display->m_phy_fb; + m_phy_write_index = &display->m_phy_write_index; m_fb = m_usr = NULL; m_top_zorder = m_max_zorder = Z_ORDER_LEVEL_0; m_is_active = false; @@ -94,6 +95,7 @@ void c_surface::set_pixel(int x, int y, unsigned int rgb) if (m_is_active && (x < display_width) && (y < display_height)) { ((unsigned int*)m_phy_fb)[y * (m_display->get_width()) + x] = rgb; + *m_phy_write_index = *m_phy_write_index + 1; } } @@ -143,6 +145,7 @@ void c_surface::fill_rect_on_fb(int x0, int y0, int x1, int y1, unsigned int rgb x = x0; fb = &((unsigned int*)m_fb)[y0 * m_width + x]; phy_fb = &((unsigned int*)m_phy_fb)[y0 * display_width + x]; + *m_phy_write_index = *m_phy_write_index + 1; for (; x <= x1; x++) { *fb++ = rgb; @@ -361,6 +364,7 @@ int c_surface::copy_layer_pixel_2_fb(int x, int y, unsigned int z_order) if (m_is_active && (x < display_width) && (y < display_height)) { ((unsigned int*)m_phy_fb)[y * display_width + x] = rgb; + *m_phy_write_index = *m_phy_write_index + 1; } } else//16 bits @@ -370,6 +374,7 @@ int c_surface::copy_layer_pixel_2_fb(int x, int y, unsigned int z_order) if (m_is_active && (x < display_width) && (y < display_height)) { ((short*)m_phy_fb)[y * display_width + x] = rgb; + *m_phy_write_index = *m_phy_write_index + 1; } } return 0; @@ -435,6 +440,7 @@ int c_surface::flush_scrren(int left, int top, int right, int bottom) void* d_addr = (char*)m_phy_fb + ((y * display_width + left) * m_color_bytes); memcpy(d_addr, s_addr, (right - left) * m_color_bytes); } + *m_phy_write_index = *m_phy_write_index + 1; return 0; } @@ -514,6 +520,7 @@ void c_surface_16bits::set_pixel(int x, int y, unsigned int rgb) if (m_is_active && (x < display_width) && (y < display_height)) { ((unsigned short*)m_phy_fb)[y * (m_display->get_width()) + x] = rgb; + *m_phy_write_index = *m_phy_write_index + 1; } } @@ -562,6 +569,7 @@ void c_surface_16bits::fill_rect_on_fb(int x0, int y0, int x1, int y1, unsigned x = x0; fb = &((unsigned short*)m_fb)[y0 * m_width + x]; phy_fb = &((unsigned short*)m_phy_fb)[y0 * display_width + x]; + *m_phy_write_index = *m_phy_write_index + 1; for (; x <= x1; x++) { *fb++ = rgb; diff --git a/doc/HelloSlide.gif b/doc/HelloSlide.gif new file mode 100644 index 0000000..d92f2b0 Binary files /dev/null and b/doc/HelloSlide.gif differ diff --git a/doc/UML.md b/doc/UML.md new file mode 100644 index 0000000..804dd70 --- /dev/null +++ b/doc/UML.md @@ -0,0 +1,4 @@ +## Class structure +![class-structure](uml-class.png) +## UI process +![ui-process](uml-ui-process.png) \ No newline at end of file diff --git a/doc/uml-class.png b/doc/uml-class.png new file mode 100644 index 0000000..4da9a95 Binary files /dev/null and b/doc/uml-class.png differ diff --git a/doc/uml-ui-process.png b/doc/uml-ui-process.png new file mode 100644 index 0000000..187a7a9 Binary files /dev/null and b/doc/uml-ui-process.png differ diff --git a/gui/gui_include/my_resource.h b/gui/gui_include/my_resource.h index cc995bb..dacdd3e 100644 --- a/gui/gui_include/my_resource.h +++ b/gui/gui_include/my_resource.h @@ -5,12 +5,7 @@ typedef struct struct_font_info FONT_INFO; typedef struct struct_color_rect COLOR_RECT; typedef struct struct_bitmap_info BITMAP_INFO; -//Redefine them to meet your need. -#define DEFAULT_NORMAL_COLOR GL_RGB(211, 211, 211) -#define DEFAULT_FOCUS_COLOR GL_RGB(188, 185, 182) -#define DEFAULT_PUSH_COLOR GL_RGB(165, 162, 159) -#define DEFAULT_FONT_COLOR GL_RGB(0, 0, 0) - +//Rebuild gui library once you change this file enum FONT_TYPE { FONT_NULL, @@ -26,14 +21,17 @@ enum FONT_TYPE enum BITMAP_TYPE { - BITMAP_UP_BT_NORMAL, - BITMAP_UP_BT_FOCUS, - BITMAP_DOWN_BT_NORMAL, - BITMAP_DOWN_BT_FOCUS, + BITMAP_UP_ARROW1, + BITMAP_UP_ARROW2, + BITMAP_DOWN_ARROW1, + BITMAP_DOWN_ARROW2, BITMAP_CUSTOM1, BITMAP_CUSTOM2, BITMAP_CUSTOM3, + BITMAP_CUSTOM4, + BITMAP_CUSTOM5, + BITMAP_CUSTOM6, BITMAP_MAX }; @@ -59,8 +57,8 @@ enum SHAPE_TYPE enum COLOR_TYPE { - CTRL_BACK_GROUND, - CTRL_FORE_GROUND, + WND_BACKCOLOR, + WND_FORECOLOR, COLOR_MAX }; diff --git a/gui/src/button.cpp b/gui/src/button.cpp index ead300f..84b4317 100644 --- a/gui/src/button.cpp +++ b/gui/src/button.cpp @@ -13,8 +13,8 @@ void c_button::pre_create_wnd() { m_style = GL_ATTR_VISIBLE | GL_ATTR_FOCUS | ALIGN_HCENTER | ALIGN_VCENTER; m_font_type = c_my_resource::get_font(FONT_DEFAULT); - m_font_color = c_my_resource::get_color(CTRL_FORE_GROUND); - m_bg_color = c_my_resource::get_color(CTRL_BACK_GROUND); + m_font_color = c_my_resource::get_color(WND_FORECOLOR); + m_bg_color = c_my_resource::get_color(WND_BACKCOLOR); } void c_button::on_focus() diff --git a/gui/src/edit.cpp b/gui/src/edit.cpp index c6f8ad1..e8f1929 100644 --- a/gui/src/edit.cpp +++ b/gui/src/edit.cpp @@ -26,8 +26,8 @@ void c_edit::pre_create_wnd() { m_style = GL_ATTR_VISIBLE | GL_ATTR_FOCUS | ALIGN_HCENTER | ALIGN_VCENTER | KEY_BOARD_STYLE; m_font_type = c_my_resource::get_font(FONT_DEFAULT); - m_font_color = c_my_resource::get_color(CTRL_FORE_GROUND); - m_bg_color = c_my_resource::get_color(CTRL_BACK_GROUND); + m_font_color = c_my_resource::get_color(WND_FORECOLOR); + m_bg_color = c_my_resource::get_color(WND_BACKCOLOR); memset(m_str_input, 0, sizeof(m_str_input)); memset(m_str, 0, sizeof(m_str)); diff --git a/gui/src/gesture.cpp b/gui/src/gesture.cpp index d80b6f5..f4ca341 100644 --- a/gui/src/gesture.cpp +++ b/gui/src/gesture.cpp @@ -153,7 +153,7 @@ int c_gesture::flip_left() int step = m_down_x - m_move_x; c_rect rc; m_slide_group->get_screen_rect(rc); - while(step <= rc.Width()) + while(step < rc.Width()) { s1->get_display()->merge_surface(s2, s1, rc.m_left, rc.m_right, rc.m_top, rc.m_bottom, step); step += FLIP_STEP; @@ -188,7 +188,7 @@ int c_gesture::flip_right() c_rect rc; m_slide_group->get_screen_rect(rc); int step = rc.Width() - (m_move_x - m_down_x); - while(step >= 0) + while(step > 0) { s1->get_display()->merge_surface(s1, s2, rc.m_left, rc.m_right, rc.m_top, rc.m_bottom, step); step -= FLIP_STEP; diff --git a/gui/src/list_box.cpp b/gui/src/list_box.cpp index 272c1ca..05c8910 100644 --- a/gui/src/list_box.cpp +++ b/gui/src/list_box.cpp @@ -19,7 +19,7 @@ void c_list_box::pre_create_wnd() m_style = GL_ATTR_VISIBLE | GL_ATTR_FOCUS | ALIGN_HCENTER | ALIGN_VCENTER; memset(m_item_array, 0, sizeof(m_item_array)); m_item_total = 0; - m_font_color = c_my_resource::get_color(CTRL_FORE_GROUND); + m_font_color = c_my_resource::get_color(WND_FORECOLOR); } void c_list_box::on_init_children() @@ -27,8 +27,8 @@ void c_list_box::on_init_children() m_item_total = 0; m_selected_item = 0; m_font_type = c_my_resource::get_font(FONT_DEFAULT); - m_font_color = c_my_resource::get_color(CTRL_FORE_GROUND); - m_bg_color = c_my_resource::get_color(CTRL_BACK_GROUND); + m_font_color = c_my_resource::get_color(WND_FORECOLOR); + m_bg_color = c_my_resource::get_color(WND_BACKCOLOR); } void c_list_box::on_focus() diff --git a/gui/src/slide_group.cpp b/gui/src/slide_group.cpp index fdc5d21..d4d0073 100644 --- a/gui/src/slide_group.cpp +++ b/gui/src/slide_group.cpp @@ -67,16 +67,6 @@ int c_slide_group::add_slide(c_wnd* slide, unsigned short resource_id, short x, new_surface->set_active(false); set_surface(new_surface); slide->connect(this, resource_id ,0 , x, y, width, height, p_child_tree); - - c_rect rect_this, rect_page; - get_screen_rect(rect_this); - slide->get_screen_rect(rect_page); - if (!(rect_page == rect_this)) - { - ASSERT(FALSE); - return -2; - } - set_surface(old_surface); int i = 0; @@ -85,7 +75,7 @@ int c_slide_group::add_slide(c_wnd* slide, unsigned short resource_id, short x, if(m_slides[i] == slide) {//slide has lived ASSERT(FALSE); - return -3; + return -2; } i++; } @@ -105,7 +95,7 @@ int c_slide_group::add_slide(c_wnd* slide, unsigned short resource_id, short x, //no more slide can be add ASSERT(FALSE); - return -4; + return -3; } int c_slide_group::add_clone_silde(c_wnd* slide, unsigned short resource_id, short x, short y, @@ -121,16 +111,6 @@ int c_slide_group::add_clone_silde(c_wnd* slide, unsigned short resource_id, sho new_surface->set_active(false); set_surface(new_surface); c_wnd* page_tmp = slide->connect_clone(this,resource_id,0,x,y,width,height,p_child_tree); - - c_rect rect_this, rect_page; - get_screen_rect(rect_this); - page_tmp->get_screen_rect(rect_page); - if (!(rect_page == rect_this)) - { - ASSERT(FALSE); - return -2; - } - set_surface(old_surface); int i = 0; @@ -139,7 +119,7 @@ int c_slide_group::add_clone_silde(c_wnd* slide, unsigned short resource_id, sho if(m_slides[i] == page_tmp) {//slide has lived ASSERT(FALSE); - return -3; + return -2; } i++; } @@ -159,7 +139,7 @@ int c_slide_group::add_clone_silde(c_wnd* slide, unsigned short resource_id, sho //no more slide can be add ASSERT(FALSE); - return -4; + return -3; } void c_slide_group::disabel_all_slide() diff --git a/gui/src/spinbox.cpp b/gui/src/spinbox.cpp index 5997eb9..38f344f 100644 --- a/gui/src/spinbox.cpp +++ b/gui/src/spinbox.cpp @@ -22,8 +22,8 @@ void c_spin_box::pre_create_wnd() { m_style = GL_ATTR_VISIBLE | GL_ATTR_FOCUS | ALIGN_HCENTER | ALIGN_VCENTER; m_font_type = c_my_resource::get_font(FONT_DEFAULT); - m_bg_color = c_my_resource::get_color(CTRL_BACK_GROUND); - m_font_color = c_my_resource::get_color(CTRL_FORE_GROUND); + m_bg_color = c_my_resource::get_color(WND_BACKCOLOR); + m_font_color = c_my_resource::get_color(WND_FORECOLOR); m_max = 6; m_min = 1; @@ -122,15 +122,15 @@ void c_spin_box::show_arrow_button() fill_rect(m_bt_up_rect.m_left, m_bt_up_rect.m_top, m_bt_down_rect.m_right, m_bt_down_rect.m_bottom, GL_RGB(99,108,124)); m_bt_up.connect(this, ID_BT_ARROW_UP, 0, 0, m_wnd_rect.Height(), m_bt_up_rect.Width(),m_bt_up_rect.Height()); - m_bt_up.set_bitmap(c_my_resource::get_bmp(BITMAP_UP_BT_NORMAL)); - m_bt_up.set_focus_bitmap(c_my_resource::get_bmp(BITMAP_UP_BT_FOCUS)); - m_bt_up.set_pushed_bitmap(c_my_resource::get_bmp(BITMAP_UP_BT_FOCUS)); + m_bt_up.set_bitmap(c_my_resource::get_bmp(BITMAP_UP_ARROW1)); + m_bt_up.set_focus_bitmap(c_my_resource::get_bmp(BITMAP_UP_ARROW2)); + m_bt_up.set_pushed_bitmap(c_my_resource::get_bmp(BITMAP_UP_ARROW2)); m_bt_up.show_window(); m_bt_down.connect(this, ID_BT_ARROW_DOWN, 0, m_bt_up_rect.Width(), m_wnd_rect.Height(), m_bt_down_rect.Width(),m_bt_down_rect.Height()); - m_bt_down.set_bitmap(c_my_resource::get_bmp(BITMAP_DOWN_BT_NORMAL)); - m_bt_down.set_focus_bitmap(c_my_resource::get_bmp(BITMAP_DOWN_BT_FOCUS)); - m_bt_down.set_pushed_bitmap(c_my_resource::get_bmp(BITMAP_DOWN_BT_FOCUS)); + m_bt_down.set_bitmap(c_my_resource::get_bmp(BITMAP_DOWN_ARROW1)); + m_bt_down.set_focus_bitmap(c_my_resource::get_bmp(BITMAP_DOWN_ARROW2)); + m_bt_down.set_pushed_bitmap(c_my_resource::get_bmp(BITMAP_DOWN_ARROW2)); m_bt_down.show_window(); } diff --git a/sync_build.bat b/sync_build.bat index 49f056d..4f0cc52 100644 --- a/sync_build.bat +++ b/sync_build.bat @@ -24,3 +24,5 @@ set raw_data=[{^ curl.exe --include --request POST --header "Content-Type: application/json" --data-binary^ "%raw_data%" "%url%" + +exit /B 0 \ No newline at end of file