轉(zhuǎn)自 | 嵌入式大雜燴
GT-HMI
GT-HMI(Human Machine Interface) 國(guó)產(chǎn)開(kāi)源 GUI 框架及永久免費(fèi)設(shè)計(jì)軟件。
開(kāi)源許可協(xié)議:MIT
它提供創(chuàng)建具有易于使用的圖形元素,精美的視覺(jué)效果和低內(nèi)存占用的嵌入式 GUI 所需的一切。針對(duì)國(guó)內(nèi)市場(chǎng)及用戶(hù)需求,使用習(xí)慣進(jìn)行了優(yōu)化設(shè)計(jì),為國(guó)內(nèi)工程師量身打造!
產(chǎn)品由中國(guó)高通 GENITOP 傾心打造,繼承了中國(guó)高通 30 年的漢顯技術(shù)及漢字技術(shù)積累。產(chǎn)品分為上位機(jī) GT-HMI Designer 和下位機(jī) GT-HMI Engine。
GT HMI Designer是一款功能強(qiáng)大的嵌入式人機(jī)界面設(shè)計(jì)軟件。它提供直觀的可視化設(shè)計(jì)界面,支持多種常用控件和豐富的交互功能。此外,它還支持多國(guó)語(yǔ)言界面設(shè)計(jì)和強(qiáng)大的仿真功能。通過(guò)GT HMI Designer,可以輕松設(shè)計(jì)出美觀、交互性強(qiáng)的界面,滿(mǎn)足各種應(yīng)用場(chǎng)景的需求。
GT HMI Engine是一款功能強(qiáng)大、高性能、多平臺(tái)、多語(yǔ)言、穩(wěn)定可靠的嵌入式人機(jī)界面引擎,提供豐富的控件和強(qiáng)大的交互功能。
特性
上位機(jī)設(shè)計(jì)軟件 GT-HMI Designer 永久免費(fèi),下位機(jī)技術(shù)框架 GT-HMI Engine 開(kāi)源,使用無(wú)拘束;
GT-HMI Designer 內(nèi)嵌下位機(jī)技術(shù)框架編譯器,可自動(dòng)生成下位機(jī)代碼;
提供 GT-HMI 模塊,已適配 GT-HMI 上下位機(jī)軟件及驅(qū)動(dòng),可以用于前期開(kāi)發(fā)調(diào)試,也可以直接作為顯示模塊使用;
多平臺(tái)兼容,移植便捷;
上位機(jī)設(shè)計(jì)軟件 GT-HMI Designer;
可直接生成交互代碼,免去寫(xiě)代碼的繁瑣工作;
模擬器仿真即見(jiàn)即所得;
內(nèi)置了大量常用的組件,如按鈕、文本框、進(jìn)度條、單選框等;
支持高通全系列點(diǎn)陣/矢量字庫(kù),支持中外文及小語(yǔ)種,多種字號(hào)及字體;
內(nèi)置中英文及數(shù)字輸入法;
持續(xù)更新的 GUI 示例庫(kù)和 UI 資源庫(kù);
下位機(jī)技術(shù)框架 GT-HMI Engine;
純 C 語(yǔ)言編寫(xiě),使用無(wú)門(mén)檻;
小巧高效,不限平臺(tái),最小僅需 24K RAM+32K FLASH,可運(yùn)行在 Cortex-ARM M0M3 等小資源平臺(tái);
移植便捷,切換平臺(tái)只需移植定時(shí)器、TP 和 LCD 接口,并提供移植教程及示例;
豐富詳實(shí)的例程,配套的開(kāi)發(fā)套件易于上手;
支持自定義功能開(kāi)發(fā),可用 GT-HMI Engine 自定義控件和功能,組合進(jìn) GT-HMI Designer 生成的標(biāo)準(zhǔn)代碼;
帶系統(tǒng)(如 RTOS、Linux 等)和裸機(jī)均可使用。
軟件架構(gòu)
軟件架構(gòu)說(shuō)明
目錄 | 說(shuō)明 |
---|---|
doc/ | 相關(guān)文檔說(shuō)明資料 |
driver/ | 底層驅(qū)動(dòng)相關(guān)的移植代碼 |
examples/ | 控件調(diào)用示例 |
sources/ | gui 內(nèi)部使用的 images 素材 |
test/ | 單元測(cè)試代碼 |
src/ | gui 框架代碼 |
|-gt_conf.h | 配置 |
|-core/ | gui 核心代碼 |
|-extra/ | 拓展控件 |
|-font/ | 字體 |
|-hal/ | 中間件,中間層 |
|-others/ | 不好分類(lèi)的代碼 |
|-utils/ | 工具類(lèi) |
|-widgets/ | 控件 |
|-|-gt_conf_widgets.h | 控件開(kāi)關(guān)宏 |
演示示例
多國(guó)語(yǔ)言示例
#include"gt_ui.h" //screen_home gt_obj_st*screen_home=NULL; staticgt_obj_st*lab1=NULL; staticgt_obj_st*rect1=NULL; staticgt_obj_st*btn1=NULL; staticgt_obj_st*btn2=NULL; staticgt_obj_st*btn3=NULL; staticgt_obj_st*btn4=NULL; staticgt_obj_st*btn5=NULL; staticgt_obj_st*btn7=NULL; staticgt_obj_st*btn8=NULL; staticgt_obj_st*btn9=NULL; staticgt_obj_st*btn10=NULL; staticvoidbtn1_0_cb(gt_event_st*e){ gt_init_screen_1(); } staticvoidbtn2_0_cb(gt_event_st*e){ gt_init_screen_2(); } staticvoidbtn3_0_cb(gt_event_st*e){ gt_init_screen_3(); } staticvoidbtn4_0_cb(gt_event_st*e){ gt_init_screen_4(); } staticvoidbtn5_0_cb(gt_event_st*e){ gt_init_screen_5(); } staticvoidbtn7_0_cb(gt_event_st*e){ gt_init_screen_7(); } staticvoidbtn8_0_cb(gt_event_st*e){ gt_init_screen_8(); } staticvoidbtn9_0_cb(gt_event_st*e){ gt_init_screen_9(); } staticvoidbtn10_0_cb(gt_event_st*e){ gt_init_screen_10(); } voidgt_init_screen_home(void) { screen_home=gt_obj_create(NULL); gt_screen_set_bgcolor(screen_home,gt_color_hex(0xFFFFFF)); //lab1 lab1=gt_label_create(screen_home); gt_obj_set_pos(lab1,295,16); gt_obj_set_size(lab1,118,40); gt_label_set_font_color(lab1,gt_color_hex(0x000000)); gt_label_set_font_size(lab1,24); gt_label_set_font_family_cn(lab1,16); gt_label_set_font_align(lab1,GT_ALIGN_LEFT); gt_label_set_text(lab1,"語(yǔ)言設(shè)置"); //rect1 rect1=gt_rect_create(screen_home); gt_obj_set_pos(rect1,8,55); gt_obj_set_size(rect1,660,1); gt_rect_set_radius(rect1,0); gt_rect_set_bg_color(rect1,gt_color_hex(0xdbdbdb)); gt_rect_set_color_border(rect1,gt_color_hex(0xdbdbdb)); gt_rect_set_fill(rect1,1); gt_rect_set_border(rect1,0); //btn1 btn1=gt_btn_create(screen_home); gt_obj_set_pos(btn1,29,76); gt_obj_set_size(btn1,160,43); gt_btn_set_font_color(btn1,gt_color_hex(0x000000)); gt_btn_set_font_size(btn1,24); gt_btn_set_font_family_cn(btn1,16); gt_btn_set_font_family_en(btn1,84); gt_btn_set_font_align(btn1,GT_ALIGN_CENTER_MID); gt_btn_set_space(btn1,5,0); gt_btn_set_font_thick_en(btn1,30); gt_btn_set_font_thick_cn(btn1,30); gt_btn_set_font_gray(btn1,1); gt_btn_set_text(btn1,"中文"); gt_btn_set_color_background(btn1,gt_color_hex(0xddeeff)); gt_btn_set_radius(btn1,8); gt_obj_add_event_cb(btn1,btn1_0_cb,GT_EVENT_TYPE_INPUT_RELEASED,NULL); //btn2 btn2=gt_btn_create(screen_home); gt_obj_set_pos(btn2,264,76); gt_obj_set_size(btn2,160,43); gt_btn_set_font_color(btn2,gt_color_hex(0x000000)); gt_btn_set_font_size(btn2,24); gt_btn_set_font_family_cn(btn2,16); gt_btn_set_font_family_en(btn2,84); gt_btn_set_font_align(btn2,GT_ALIGN_CENTER_MID); gt_btn_set_space(btn2,5,0); gt_btn_set_font_thick_en(btn2,30); gt_btn_set_font_thick_cn(btn2,30); gt_btn_set_font_gray(btn2,1); gt_btn_set_text(btn2,"日語(yǔ)"); gt_btn_set_color_background(btn2,gt_color_hex(0xddeeff)); gt_btn_set_radius(btn2,8); gt_obj_add_event_cb(btn2,btn2_0_cb,GT_EVENT_TYPE_INPUT_RELEASED,NULL); //btn3 btn3=gt_btn_create(screen_home); gt_obj_set_pos(btn3,489,76); gt_obj_set_size(btn3,160,41); gt_btn_set_font_color(btn3,gt_color_hex(0x000000)); gt_btn_set_font_size(btn3,24); gt_btn_set_font_family_cn(btn3,16); gt_btn_set_font_family_en(btn3,84); gt_btn_set_font_align(btn3,GT_ALIGN_CENTER_MID); gt_btn_set_space(btn3,5,0); gt_btn_set_font_thick_en(btn3,30); gt_btn_set_font_thick_cn(btn3,30); gt_btn_set_font_gray(btn3,1); gt_btn_set_text(btn3,"韓語(yǔ)"); gt_btn_set_color_background(btn3,gt_color_hex(0xddeeff)); gt_btn_set_radius(btn3,8); gt_obj_add_event_cb(btn3,btn3_0_cb,GT_EVENT_TYPE_INPUT_RELEASED,NULL); //btn4 btn4=gt_btn_create(screen_home); gt_obj_set_pos(btn4,29,158); gt_obj_set_size(btn4,160,43); gt_btn_set_font_color(btn4,gt_color_hex(0x000000)); gt_btn_set_font_size(btn4,24); gt_btn_set_font_family_cn(btn4,16); gt_btn_set_font_family_en(btn4,41); gt_btn_set_font_align(btn4,GT_ALIGN_CENTER_MID); gt_btn_set_space(btn4,5,0); gt_btn_set_text(btn4,"英語(yǔ)"); gt_btn_set_color_background(btn4,gt_color_hex(0xddeeff)); gt_btn_set_radius(btn4,8); gt_obj_add_event_cb(btn4,btn4_0_cb,GT_EVENT_TYPE_INPUT_RELEASED,NULL); //btn5 btn5=gt_btn_create(screen_home); gt_obj_set_pos(btn5,263,158); gt_obj_set_size(btn5,160,43); gt_btn_set_font_color(btn5,gt_color_hex(0x000000)); gt_btn_set_font_size(btn5,24); gt_btn_set_font_family_cn(btn5,16); gt_btn_set_font_family_en(btn5,53); gt_btn_set_font_align(btn5,GT_ALIGN_CENTER_MID); gt_btn_set_space(btn5,5,0); gt_btn_set_text(btn5,"法語(yǔ)"); gt_btn_set_color_background(btn5,gt_color_hex(0xddeeff)); gt_btn_set_radius(btn5,8); gt_obj_add_event_cb(btn5,btn5_0_cb,GT_EVENT_TYPE_INPUT_RELEASED,NULL); //btn7 btn7=gt_btn_create(screen_home); gt_obj_set_pos(btn7,30,238); gt_obj_set_size(btn7,160,43); gt_btn_set_font_color(btn7,gt_color_hex(0x000000)); gt_btn_set_font_size(btn7,24); gt_btn_set_font_family_cn(btn7,16); gt_btn_set_font_family_en(btn7,53); gt_btn_set_font_align(btn7,GT_ALIGN_CENTER_MID); gt_btn_set_space(btn7,5,0); gt_btn_set_text(btn7,"西班牙語(yǔ)"); gt_btn_set_color_background(btn7,gt_color_hex(0xddeeff)); gt_btn_set_radius(btn7,8); gt_obj_add_event_cb(btn7,btn7_0_cb,GT_EVENT_TYPE_INPUT_RELEASED,NULL); //btn8 btn8=gt_btn_create(screen_home); gt_obj_set_pos(btn8,263,238); gt_obj_set_size(btn8,160,43); gt_btn_set_font_color(btn8,gt_color_hex(0x000000)); gt_btn_set_font_size(btn8,24); gt_btn_set_font_family_cn(btn8,16); gt_btn_set_font_family_en(btn8,41); gt_btn_set_font_align(btn8,GT_ALIGN_CENTER_MID); gt_btn_set_space(btn8,5,0); gt_btn_set_text(btn8,"泰語(yǔ)"); gt_btn_set_color_background(btn8,gt_color_hex(0xddeeff)); gt_btn_set_radius(btn8,8); gt_obj_add_event_cb(btn8,btn8_0_cb,GT_EVENT_TYPE_INPUT_RELEASED,NULL); //btn9 btn9=gt_btn_create(screen_home); gt_obj_set_pos(btn9,490,238); gt_obj_set_size(btn9,160,43); gt_btn_set_font_color(btn9,gt_color_hex(0x000000)); gt_btn_set_font_size(btn9,24); gt_btn_set_font_family_cn(btn9,16); gt_btn_set_font_family_en(btn9,75); gt_btn_set_font_align(btn9,GT_ALIGN_CENTER_MID); gt_btn_set_space(btn9,5,0); gt_btn_set_text(btn9,"阿拉伯語(yǔ)"); gt_btn_set_color_background(btn9,gt_color_hex(0xddeeff)); gt_btn_set_radius(btn9,8); gt_obj_add_event_cb(btn9,btn9_0_cb,GT_EVENT_TYPE_INPUT_RELEASED,NULL); //btn10 btn10=gt_btn_create(screen_home); gt_obj_set_pos(btn10,489,158); gt_obj_set_size(btn10,160,43); gt_btn_set_font_color(btn10,gt_color_hex(0x000000)); gt_btn_set_font_size(btn10,24); gt_btn_set_font_family_cn(btn10,16); gt_btn_set_font_family_en(btn10,60); gt_btn_set_font_align(btn10,GT_ALIGN_CENTER_MID); gt_btn_set_space(btn10,5,0); gt_btn_set_text(btn10,"俄語(yǔ)"); gt_btn_set_color_background(btn10,gt_color_hex(0xddeeff)); gt_btn_set_radius(btn10,8); gt_obj_add_event_cb(btn10,btn10_0_cb,GT_EVENT_TYPE_INPUT_RELEASED,NULL); gt_disp_load_scr_anim(screen_home,GT_SCR_ANIM_TYPE_NONE,500,0,true); }
矢量字庫(kù)示例
#include"gt_ui.h" //screen_home gt_obj_st*screen_home=NULL; staticgt_obj_st*lab1=NULL; staticgt_obj_st*rect1=NULL; staticgt_obj_st*btn1=NULL; staticgt_obj_st*btn2=NULL; staticgt_obj_st*btn3=NULL; staticgt_obj_st*btn4=NULL; staticgt_obj_st*btn5=NULL; staticgt_obj_st*btn7=NULL; staticgt_obj_st*btn8=NULL; staticgt_obj_st*btn9=NULL; staticgt_obj_st*btn10=NULL; staticvoidbtn1_0_cb(gt_event_st*e){ gt_init_screen_1(); } staticvoidbtn2_0_cb(gt_event_st*e){ gt_init_screen_2(); } staticvoidbtn3_0_cb(gt_event_st*e){ gt_init_screen_3(); } staticvoidbtn4_0_cb(gt_event_st*e){ gt_init_screen_4(); } staticvoidbtn5_0_cb(gt_event_st*e){ gt_init_screen_5(); } staticvoidbtn7_0_cb(gt_event_st*e){ gt_init_screen_7(); } staticvoidbtn8_0_cb(gt_event_st*e){ gt_init_screen_8(); } staticvoidbtn9_0_cb(gt_event_st*e){ gt_init_screen_9(); } staticvoidbtn10_0_cb(gt_event_st*e){ gt_init_screen_6(); } voidgt_init_screen_home(void) { screen_home=gt_obj_create(NULL); gt_screen_set_bgcolor(screen_home,gt_color_hex(0xFFFFFF)); //lab1 lab1=gt_label_create(screen_home); gt_obj_set_pos(lab1,207,10); gt_obj_set_size(lab1,309,40); gt_label_set_font_color(lab1,gt_color_hex(0x000000)); gt_label_set_font_size(lab1,24); gt_label_set_font_family_cn(lab1,80); gt_label_set_font_align(lab1,GT_ALIGN_LEFT); gt_label_set_font_thick_en(lab1,30); gt_label_set_font_thick_cn(lab1,30); gt_label_set_font_gray(lab1,4); gt_label_set_text(lab1,"矢量字庫(kù),灰度與多字形"); //rect1 rect1=gt_rect_create(screen_home); gt_obj_set_pos(rect1,8,55); gt_obj_set_size(rect1,660,1); gt_rect_set_radius(rect1,0); gt_rect_set_bg_color(rect1,gt_color_hex(0xdbdbdb)); gt_rect_set_color_border(rect1,gt_color_hex(0xdbdbdb)); gt_rect_set_fill(rect1,1); gt_rect_set_border(rect1,0); //btn1 btn1=gt_btn_create(screen_home); gt_obj_set_pos(btn1,33,78); gt_obj_set_size(btn1,160,43); gt_btn_set_font_color(btn1,gt_color_hex(0x000000)); gt_btn_set_font_size(btn1,24); gt_btn_set_font_family_cn(btn1,80); gt_btn_set_font_family_en(btn1,84); gt_btn_set_font_align(btn1,GT_ALIGN_CENTER_MID); gt_btn_set_space(btn1,0,0); gt_btn_set_font_thick_en(btn1,30); gt_btn_set_font_thick_cn(btn1,30); gt_btn_set_font_gray(btn1,4); gt_btn_set_text(btn1,"中文宋體"); gt_btn_set_color_background(btn1,gt_color_hex(0xddeeff)); gt_btn_set_radius(btn1,8); gt_obj_add_event_cb(btn1,btn1_0_cb,GT_EVENT_TYPE_INPUT_RELEASED,NULL); //btn2 btn2=gt_btn_create(screen_home); gt_obj_set_pos(btn2,266,76); gt_obj_set_size(btn2,160,43); gt_btn_set_font_color(btn2,gt_color_hex(0x000000)); gt_btn_set_font_size(btn2,24); gt_btn_set_font_family_cn(btn2,80); gt_btn_set_font_family_en(btn2,84); gt_btn_set_font_align(btn2,GT_ALIGN_CENTER_MID); gt_btn_set_space(btn2,0,0); gt_btn_set_font_thick_en(btn2,30); gt_btn_set_font_thick_cn(btn2,30); gt_btn_set_font_gray(btn2,4); gt_btn_set_text(btn2,"中文黑體"); gt_btn_set_color_background(btn2,gt_color_hex(0xddeeff)); gt_btn_set_radius(btn2,8); gt_obj_add_event_cb(btn2,btn2_0_cb,GT_EVENT_TYPE_INPUT_RELEASED,NULL); //btn3 btn3=gt_btn_create(screen_home); gt_obj_set_pos(btn3,493,76); gt_obj_set_size(btn3,160,41); gt_btn_set_font_color(btn3,gt_color_hex(0x000000)); gt_btn_set_font_size(btn3,24); gt_btn_set_font_family_cn(btn3,80); gt_btn_set_font_family_en(btn3,84); gt_btn_set_font_align(btn3,GT_ALIGN_CENTER_MID); gt_btn_set_space(btn3,0,0); gt_btn_set_font_thick_en(btn3,30); gt_btn_set_font_thick_cn(btn3,30); gt_btn_set_font_gray(btn3,4); gt_btn_set_text(btn3,"英文斜體"); gt_btn_set_color_background(btn3,gt_color_hex(0xddeeff)); gt_btn_set_radius(btn3,8); gt_obj_add_event_cb(btn3,btn3_0_cb,GT_EVENT_TYPE_INPUT_RELEASED,NULL); //btn4 btn4=gt_btn_create(screen_home); gt_obj_set_pos(btn4,33,160); gt_obj_set_size(btn4,160,43); gt_btn_set_font_color(btn4,gt_color_hex(0x000000)); gt_btn_set_font_size(btn4,24); gt_btn_set_font_family_cn(btn4,80); gt_btn_set_font_family_en(btn4,41); gt_btn_set_font_align(btn4,GT_ALIGN_CENTER_MID); gt_btn_set_space(btn4,0,0); gt_btn_set_font_thick_en(btn4,30); gt_btn_set_font_thick_cn(btn4,30); gt_btn_set_font_gray(btn4,4); gt_btn_set_text(btn4,"英文手寫(xiě)體"); gt_btn_set_color_background(btn4,gt_color_hex(0xddeeff)); gt_btn_set_radius(btn4,8); gt_obj_add_event_cb(btn4,btn4_0_cb,GT_EVENT_TYPE_INPUT_RELEASED,NULL); //btn5 btn5=gt_btn_create(screen_home); gt_obj_set_pos(btn5,265,160); gt_obj_set_size(btn5,160,43); gt_btn_set_font_color(btn5,gt_color_hex(0x000000)); gt_btn_set_font_size(btn5,24); gt_btn_set_font_family_cn(btn5,80); gt_btn_set_font_family_en(btn5,53); gt_btn_set_font_align(btn5,GT_ALIGN_CENTER_MID); gt_btn_set_space(btn5,0,0); gt_btn_set_font_thick_en(btn5,30); gt_btn_set_font_thick_cn(btn5,30); gt_btn_set_font_gray(btn5,4); gt_btn_set_text(btn5,"日文黑體"); gt_btn_set_color_background(btn5,gt_color_hex(0xddeeff)); gt_btn_set_radius(btn5,8); gt_obj_add_event_cb(btn5,btn5_0_cb,GT_EVENT_TYPE_INPUT_RELEASED,NULL); //btn7 btn7=gt_btn_create(screen_home); gt_obj_set_pos(btn7,32,240); gt_obj_set_size(btn7,160,43); gt_btn_set_font_color(btn7,gt_color_hex(0x000000)); gt_btn_set_font_size(btn7,24); gt_btn_set_font_family_cn(btn7,80); gt_btn_set_font_family_en(btn7,53); gt_btn_set_font_align(btn7,GT_ALIGN_CENTER_MID); gt_btn_set_space(btn7,0,0); gt_btn_set_font_thick_en(btn7,30); gt_btn_set_font_thick_cn(btn7,30); gt_btn_set_font_gray(btn7,4); gt_btn_set_text(btn7,"俄文"); gt_btn_set_color_background(btn7,gt_color_hex(0xddeeff)); gt_btn_set_radius(btn7,8); gt_obj_add_event_cb(btn7,btn7_0_cb,GT_EVENT_TYPE_INPUT_RELEASED,NULL); //btn8 btn8=gt_btn_create(screen_home); gt_obj_set_pos(btn8,267,240); gt_obj_set_size(btn8,160,43); gt_btn_set_font_color(btn8,gt_color_hex(0x000000)); gt_btn_set_font_size(btn8,24); gt_btn_set_font_family_cn(btn8,80); gt_btn_set_font_family_en(btn8,41); gt_btn_set_font_align(btn8,GT_ALIGN_CENTER_MID); gt_btn_set_space(btn8,0,0); gt_btn_set_font_thick_en(btn8,30); gt_btn_set_font_thick_cn(btn8,30); gt_btn_set_font_gray(btn8,4); gt_btn_set_text(btn8,"泰文"); gt_btn_set_color_background(btn8,gt_color_hex(0xddeeff)); gt_btn_set_radius(btn8,8); gt_obj_add_event_cb(btn8,btn8_0_cb,GT_EVENT_TYPE_INPUT_RELEASED,NULL); //btn9 btn9=gt_btn_create(screen_home); gt_obj_set_pos(btn9,494,240); gt_obj_set_size(btn9,160,43); gt_btn_set_font_color(btn9,gt_color_hex(0x000000)); gt_btn_set_font_size(btn9,24); gt_btn_set_font_family_cn(btn9,80); gt_btn_set_font_family_en(btn9,75); gt_btn_set_font_align(btn9,GT_ALIGN_CENTER_MID); gt_btn_set_space(btn9,0,0); gt_btn_set_font_thick_en(btn9,30); gt_btn_set_font_thick_cn(btn9,30); gt_btn_set_font_gray(btn9,4); gt_btn_set_text(btn9,"阿拉伯文"); gt_btn_set_color_background(btn9,gt_color_hex(0xddeeff)); gt_btn_set_radius(btn9,8); gt_obj_add_event_cb(btn9,btn9_0_cb,GT_EVENT_TYPE_INPUT_RELEASED,NULL); //btn10 btn10=gt_btn_create(screen_home); gt_obj_set_pos(btn10,495,160); gt_obj_set_size(btn10,160,43); gt_btn_set_font_color(btn10,gt_color_hex(0x000000)); gt_btn_set_font_size(btn10,24); gt_btn_set_font_family_cn(btn10,80); gt_btn_set_font_family_en(btn10,60); gt_btn_set_font_align(btn10,GT_ALIGN_CENTER_MID); gt_btn_set_space(btn10,0,0); gt_btn_set_font_thick_en(btn10,30); gt_btn_set_font_thick_cn(btn10,30); gt_btn_set_font_gray(btn10,4); gt_btn_set_text(btn10,"韓文黑體"); gt_btn_set_color_background(btn10,gt_color_hex(0xddeeff)); gt_btn_set_radius(btn10,8); gt_obj_add_event_cb(btn10,btn10_0_cb,GT_EVENT_TYPE_INPUT_RELEASED,NULL); gt_disp_load_scr_anim(screen_home,GT_SCR_ANIM_TYPE_NONE,500,0,true); }
幻燈片示例動(dòng)畫(huà)
#include"gt_ui.h" //screen_home gt_obj_st*screen_home=NULL; staticgt_obj_st*lab1=NULL; staticgt_obj_st*img1=NULL; staticgt_obj_st*player1=NULL; staticgt_obj_st*svg1=NULL; staticgt_obj_st*svg2=NULL; staticvoidsvg1_0_cb(gt_event_st*e){ gt_player_turn_prev(player1); } staticvoidsvg2_0_cb(gt_event_st*e){ gt_player_turn_next(player1); } voidgt_init_screen_home(void) { screen_home=gt_obj_create(NULL); gt_screen_set_bgcolor(screen_home,gt_color_hex(0xFFFFFF)); //lab1 lab1=gt_label_create(screen_home); gt_obj_set_pos(lab1,223,71); gt_obj_set_size(lab1,96,51); gt_label_set_font_color(lab1,gt_color_hex(0x6e6e6e)); gt_label_set_font_size(lab1,32); gt_label_set_font_family_cn(lab1,19); gt_label_set_font_align(lab1,GT_ALIGN_LEFT); gt_label_set_text(lab1,"風(fēng)速"); //img1 img1=gt_img_create(screen_home); gt_obj_set_pos(img1,157,75); gt_obj_set_size(img1,42,40); gt_img_set_src(img1,"f:img_42x40_9.png"); //player1 player1=gt_player_create(screen_home); gt_obj_set_pos(player1,153,136); gt_obj_set_size(player1,161,66); gt_player_add_item(player1,"f:img_161x66_4.png",sizeof("f:img_161x66_4.png")); gt_player_add_item(player1,"f:img_161x66_5.png",sizeof("f:img_161x66_5.png")); gt_player_add_item(player1,"f:img_161x66_6.png",sizeof("f:img_161x66_6.png")); gt_player_add_item(player1,"f:img_161x66_7.png",sizeof("f:img_161x66_7.png")); gt_player_add_item(player1,"f:img_161x66_8.png",sizeof("f:img_161x66_8.png")); gt_player_set_type(player1,GT_PLAYER_TYPE_IMG); gt_player_set_mode(player1,GT_PLAYER_MODE_LOOP); /svg1 svg1=gt_img_create(screen_home); gt_obj_set_pos(svg1,76,149); gt_obj_set_size(svg1,48,48); gt_img_set_src(svg1,"f:img_48x48_minus_0_3.png"); gt_obj_add_event_cb(svg1,svg1_0_cb,GT_EVENT_TYPE_INPUT_RELEASED,NULL); //svg2 svg2=gt_img_create(screen_home); gt_obj_set_pos(svg2,341,148); gt_obj_set_size(svg2,48,48); gt_img_set_src(svg2,"f:img_48x48_plus_0_4.png"); gt_obj_add_event_cb(svg2,svg2_0_cb,GT_EVENT_TYPE_INPUT_RELEASED,NULL); gt_disp_load_scr_anim(screen_home,GT_SCR_ANIM_TYPE_NONE,500,0,true); }
鍵盤(pán)控件示例動(dòng)畫(huà)
#include"gt_ui.h" //screen_home gt_obj_st*screen_home=NULL; staticgt_obj_st*input1=NULL; staticgt_obj_st*keyboard1=NULL; voidgt_init_screen_home(void) { screen_home=gt_obj_create(NULL); gt_screen_set_bgcolor(screen_home,gt_color_hex(0xFFFFFF)); //input1 input1=gt_input_create(screen_home); gt_obj_set_pos(input1,117,38); gt_obj_set_size(input1,249,84); gt_input_set_font_color(input1,gt_color_hex(0x000000)); gt_input_set_font_size(input1,16); gt_input_set_font_family_cn(input1,3); gt_input_set_font_family_en(input1,39); gt_input_set_font_align(input1,GT_ALIGN_LEFT); gt_input_set_placeholder(input1,"placeholder"); gt_input_set_bg_color(input1,gt_color_hex(0xffffff)); //keyboard1 keyboard1=gt_keypad_create(screen_home); gt_obj_set_pos(keyboard1,89,138); gt_obj_set_size(keyboard1,309,170); gt_keypad_set_font_color(keyboard1,gt_color_hex(0xffffff)); gt_keypad_set_font_size(keyboard1,16); gt_keypad_set_font_align(keyboard1,GT_ALIGN_CENTER_MID); gt_keypad_set_color_background(keyboard1,gt_color_hex(0x242424)); gt_keypad_set_target(keyboard1,input1); gt_disp_load_scr_anim(screen_home,GT_SCR_ANIM_TYPE_NONE,500,0,true); }
圖片按鈕控件示例動(dòng)畫(huà)
#include"gt_ui.h" /**screen_home*/ gt_obj_st*screen_home=NULL; staticgt_obj_st*imgbtn1=NULL; voidgt_init_screen_home(void) { screen_home=gt_obj_create(NULL); gt_screen_set_bgcolor(screen_home,gt_color_hex(0xFFFFFF)); /**imgbtn1*/ imgbtn1=gt_imgbtn_create(screen_home); gt_obj_set_pos(imgbtn1,142,136); gt_obj_set_size(imgbtn1,185,50); gt_imgbtn_set_src(imgbtn1,"f:img_185x50_10.png"); gt_imgbtn_set_src_press(imgbtn1,"f:img_185x50_3.png"); gt_disp_load_scr_anim(screen_home,GT_SCR_ANIM_TYPE_NONE,500,0,true); }
-
嵌入式
+關(guān)注
關(guān)注
5057文章
18964瀏覽量
301816 -
開(kāi)源
+關(guān)注
關(guān)注
3文章
3213瀏覽量
42298 -
GUI
+關(guān)注
關(guān)注
3文章
637瀏覽量
39477
原文標(biāo)題:分享一款GUI開(kāi)發(fā)神器
文章出處:【微信號(hào):strongerHuang,微信公眾號(hào):strongerHuang】歡迎添加關(guān)注!文章轉(zhuǎn)載請(qǐng)注明出處。
發(fā)布評(píng)論請(qǐng)先 登錄
相關(guān)推薦
評(píng)論