Dear Segger Team,
I have tried to implement listview siwpe using the touch call back as shown below. Output generated by below logic is not smooth also it is very slow. So please suggest me some better technique to implement it.
Display All
Rgds,
Rohit.
I have tried to implement listview siwpe using the touch call back as shown below. Output generated by below logic is not smooth also it is very slow. So please suggest me some better technique to implement it.
C Source Code
- static void _cbSwipe(WM_MESSAGE* pMsg) {
- switch (pMsg->MsgId) {
- case WM_TOUCH :
- {
- static int last_y;
- int y;
- const GUI_PID_STATE* pState = (const GUI_PID_STATE*)pMsg->Data.p;
- if (pMsg->Data.p) { /* Something happened in our area (pressed or released) */
- if (pState->Pressed)
- {
- hWinScrollBarV = WM_GetScrollbarV(pMsg->hWin);
- scrollval = SCROLLBAR_GetValue(hWinScrollBarV);
- //WM_SetCapture(pMsg->hWin, 1);
- if(last_y)
- {
- y = pState->y;
- if(y > last_y)
- {
- printf("Scroll Down\r\n");
- scrollval++;
- SCROLLBAR_SetValue(hWinScrollBarV, scrollval);
- }
- if(y < last_y)
- {
- printf("Scroll Up\r\n");
- scrollval--;
- SCROLLBAR_SetValue(hWinScrollBarV, scrollval);
- }
- }
- last_y = pState->y;
- }else {
- last_y=0;
- }
- }else {
- last_y=0;
- }
- LISTVIEW_Callback(pMsg);
- }
- break;
- default:
- LISTVIEW_Callback(pMsg);
- break;
- }
- }
Rgds,
Rohit.
The post was edited 3 times, last by mrohit2011 ().