Hello,
I'm working on trying to get a time/date picker working with STeMWIN, I have a basic screen working however movement of the various wheels is something I've not quite grasped yet. Currently each list wheel has it's own callback:
Display All
When I touch on the wheel it moves, however it only moves in 1 direction. I'm wondering how (if?) I control the direction of movement with listwheels? The example code looks like this:
Display All
Which sadly I am struggling to understand - I suspect this is trying to find the list wheel selection at given screen coordinates. However this would surely just move the wheel there, rather than enable a smooth scroll to a new selection.
All in all I'm a little confused about this widget and would like some pointing in the right direction.
Thanks,
Peter.
I'm working on trying to get a time/date picker working with STeMWIN, I have a basic screen working however movement of the various wheels is something I've not quite grasped yet. Currently each list wheel has it's own callback:
Source Code
- static void
- CbListWheel (WM_MESSAGE *pMsg)
- {
- switch (pMsg->MsgId)
- {
- //**********************************************************************
- // WM_PID_STATE_CHANGED
- case WM_PID_STATE_CHANGED:
- {
- // React on pressing data areas
- LISTWHEEL_SetVelocity(pMsg->hWin, LISTWHEEL_VELOCITY);
- break;
- }
- //**********************************************************************
- // Default handling.
- default:
- {
- LISTWHEEL_Callback(pMsg);
- break;
- }
- }
- }
- /******************************************************************************/
When I touch on the wheel it moves, however it only moves in 1 direction. I'm wondering how (if?) I control the direction of movement with listwheels? The example code looks like this:
Source Code
- case WM_PID_STATE_CHANGED:
- //
- // React on pressing data areas
- //
- pState = (const WM_PID_STATE_CHANGED_INFO *)pMsg->Data.p;
- if ((pState->StatePrev == 0) && (pState->State == 1)) {
- x = pState->x;
- y = pState->y;
- if ((x >= 10) && (x <= 230)) {
- for (j = 0; j < 2; j++) {
- if ((y >= (75 + j * 40)) && (y < 75 + (j + 1) * 40)) {
- if (Selection != j) {
- Selection = j;
- for (i = 0; i < 3; i++) {
- LISTWHEEL_MoveToPos(_aWheel[i].hWin, _aSelection[Selection][i]);
- }
- WM_InvalidateWindow(pMsg->hWin);
- }
- }
- }
- }
- }
- break;
All in all I'm a little confused about this widget and would like some pointing in the right direction.
Thanks,
Peter.