完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
扫一扫,分享给好友
`本人菜鸟一枚,,这段时间在编写一个UCGUI界面,是一个对话框程序(Dialog),需要创建一个Left按钮,其ID:GUI_KEY_LEFT,但是在资源表里创建这个按钮时,却不能自己设定其在对话框界面的位置,代码如下:/*****************************资源表*****************************************/ static const GUI_WIDGET_CREATE_INFO aDialogCreate[] = { { FRAMEWIN_CreateIndirect, "Dialog", 0, 10, 10, 162, 214, FRAMEWIN_CF_MOVEABLE}, { BUTTON_CreateIndirect, "Up", GUI_KEY_UP, 56, 100, 40, 20 }, { BUTTON_CreateIndirect, "Down", GUI_KEY_DOWN, 56, 150, 40, 20 }, // { BUTTON_CreateIndirect, "Left", GUI_KEY_LEFT 11, 125, 40, 20 }, // { BUTTON_CreateIndirect, "Right", GUI_KEY_RIGHT 101, 125, 40, 20 }, // { BUTTON_CreateIndirect, "Tab", GUI_KEY_TAB 56, 125, 40, 20 }, // { BUTTON_CreateIndirect, "Left", GUI_KEY_LEFT }, // { BUTTON_CreateIndirect, "Right", GUI_KEY_RIGHT }, // { BUTTON_CreateIndirect, "Tab", GUI_KEY_TAB }, { EDIT_CreateIndirect, "", GUI_ID_EDIT0, 27, 5, 100, 20, EDIT_CF_RIGHT, 4 }, { EDIT_CreateIndirect, "", GUI_ID_EDIT1, 27, 30, 100, 20, EDIT_CF_RIGHT, 4 }, { EDIT_CreateIndirect, "", GUI_ID_EDIT2, 27, 55, 100, 20, EDIT_CF_RIGHT, 4 }, }; 如果是按照这个代码来编译的话是没有报错的: // { BUTTON_CreateIndirect, "Left", GUI_KEY_LEFT }, // { BUTTON_CreateIndirect, "Right", GUI_KEY_RIGHT }, // { BUTTON_CreateIndirect, "Tab", GUI_KEY_TAB }, 编译结果如下: Build target 'uCOSDemo' compiling GUIDEMO_Direction_Key.c... SourceuCGUIuCGUIDemoGUIDEMO_Direction_Key.c(116): warning: #550-D: variable "hWin" was set but never used SourceuCGUIuCGUIDemoGUIDEMO_Direction_Key.c: WM_HWIN hWin; SourceuCGUIuCGUIDemoGUIDEMO_Direction_Key.c: ^ SourceuCGUIuCGUIDemoGUIDEMO_Direction_Key.c(160): warning: #1-D: last line of file ends without a newline SourceuCGUIuCGUIDemoGUIDEMO_Direction_Key.c: #endif /* GUI_SUPPORT_MEMDEV */ SourceuCGUIuCGUIDemoGUIDEMO_Direction_Key.c: ^ SourceuCGUIuCGUIDemoGUIDEMO_Direction_Key.c: SourceuCGUIuCGUIDemoGUIDEMO_Direction_Key.c: 2 warnings, 0 errors linking... Program Size: Code=64218 RO-data=12074 RW-data=488 ZI-data=15800 FromELF: creating hex file... ".ObjuCOSDemo.axf" - 0 Error(s), 2 Warning(s). 但是实现后的结果是,只有最后一个TAB键是能够显示出来的,并且是显示在对话框的正中间: 图片在下面的附件里, 但是如果按照有自己设定的位置的代码来的话: // { BUTTON_CreateIndirect, "Left", GUI_KEY_LEFT 11, 125, 40, 20 }, // { BUTTON_CreateIndirect, "Right", GUI_KEY_RIGHT 101, 125, 40, 20 }, // { BUTTON_CreateIndirect, "Tab", GUI_KEY_TAB 56, 125, 40, 20 }, 编译报错: Build target 'uCOSDemo' compiling GUIDEMO_Direction_Key.c... SourceuCGUIuCGUIDemoGUIDEMO_Direction_Key.c(29): error: #67: expected a "}" SourceuCGUIuCGUIDemoGUIDEMO_Direction_Key.c: { BUTTON_CreateIndirect, "Left", GUI_KEY_LEFT 11, 125, 40, 20 }, SourceuCGUIuCGUIDemoGUIDEMO_Direction_Key.c: ^ SourceuCGUIuCGUIDemoGUIDEMO_Direction_Key.c(30): error: #67: expected a "}" SourceuCGUIuCGUIDemoGUIDEMO_Direction_Key.c: { BUTTON_CreateIndirect, "Right", GUI_KEY_RIGHT 101, 125, 40, 20 }, SourceuCGUIuCGUIDemoGUIDEMO_Direction_Key.c: ^ SourceuCGUIuCGUIDemoGUIDEMO_Direction_Key.c(31): error: #67: expected a "}" SourceuCGUIuCGUIDemoGUIDEMO_Direction_Key.c: { BUTTON_CreateIndirect, "Tab", GUI_KEY_TAB 56, 125, 40, 20 }, SourceuCGUIuCGUIDemoGUIDEMO_Direction_Key.c: ^ SourceuCGUIuCGUIDemoGUIDEMO_Direction_Key.c(116): warning: #550-D: variable "hWin" was set but never used SourceuCGUIuCGUIDemoGUIDEMO_Direction_Key.c: WM_HWIN hWin; SourceuCGUIuCGUIDemoGUIDEMO_Direction_Key.c: ^ SourceuCGUIuCGUIDemoGUIDEMO_Direction_Key.c(160): warning: #1-D: last line of file ends without a newline SourceuCGUIuCGUIDemoGUIDEMO_Direction_Key.c: #endif /* GUI_SUPPORT_MEMDEV */ SourceuCGUIuCGUIDemoGUIDEMO_Direction_Key.c: ^ SourceuCGUIuCGUIDemoGUIDEMO_Direction_Key.c: SourceuCGUIuCGUIDemoGUIDEMO_Direction_Key.c: 2 warnings, 3 errors Target not created 我创建对话框的方式是阻塞式,,,, hWin = GUI_ExecDialogBox(aDialogCreate, GUI_COUNTOF(aDialogCreate), _cbCallback, 0, 0, 0); 现在我想知道怎么才能自己设定LEFT方向键的位置,把它设置在自己需要的位置上,,求大神指教,,,感激不尽,,十万火急呐,,,, ` |
|
相关推荐
1个回答
|
|
好吧好吧,,我自己找到错误了,,,都是粗心大意的惩罚 啊!!!!!!
|
|
|
|
你正在撰写答案
如果你是对答案或其他答案精选点评或询问,请使用“评论”功能。
RK3568国产处理器_教学实验箱_操作教程:1-22 密码学编程实验
194 浏览 0 评论
飞凌嵌入式ElfBoard ELF 1板卡-运动追踪之六轴传感器icm20607介绍
406 浏览 0 评论
FacenetPytorch人脸识别方案--基于米尔全志T527开发板
1661 浏览 0 评论
飞凌嵌入式ElfBoard ELF 1板卡-CAN编程示例之开发板测试
1113 浏览 0 评论
该问题是用APP给芯海科技的CST92F25芯片发指令是出现的
4427 浏览 1 评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-12-3 12:05 , Processed in 0.432156 second(s), Total 42, Slave 34 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号