|
本帖最后由 xiaoqzq 于 2014-1-15 19:37 编辑
我移植的ucGUI3.98, 触摸的时候我用程序附带的例程可以,但是我自己画个按钮就一点反应都没有,请问是什么问题啊,还有我改动#define LCD_SWAP_XY (1);#define GUI_TOUCH_SWAP_XY 0;
#define GUI_TOUCH_MIRROR_X 1;
#define GUI_TOUCH_MIRROR_Y 1;
这几个函数后,读取的AD值也没变化,有谁能指点下吗?是我哪里弄错了?
附上3个按钮的测试代码
BUTTON_Handle ahButton[3];
GUI_SetBkColor(GUI_BLUE);
GUI_Clear();
ahButton[0] = BUTTON_Create( XMid - 50, YMid - 30, 100, 50, ID_CALIBRATE,BUTTON_CF_SHOW|WM_CF_MEMDEV );
ahButton[1] = BUTTON_Create( XMid - 90, YMid + 30, 80, 30, ID_KEYBOARD, BUTTON_CF_SHOW|WM_CF_MEMDEV );
ahButton[2] = BUTTON_Create( XMid + 10, YMid + 30, 80, 30, ID_TESTCAL,BUTTON_CF_SHOW|WM_CF_MEMDEV );
BUTTON_SetText (ahButton[0], "Calibrate");
BUTTON_SetBkColor(ahButton[0], 0, GUI_RED);
BUTTON_SetText (ahButton[1], "Keyboard");
BUTTON_SetText (ahButton[2], "Test calibration");
BUTTON_SetFont(ahButton[0], &GUI_FontComic18B_ASCII);
WM_ExecIdle();
while(1)
{
tch_number_dis();
r = GUI_GetKey();
switch (r) {
case ID_KEYBOARD: _1ExecKeyboard(); break;
case ID_CALIBRATE: _1ExecCalibration(); break;
case ID_TESTCAL: _1TestCalibration(); break;
}
|
|