Hi,
I am writing an application running on a STM32 processor using the STemWin precompiled library based on emWin version 5.40.
I am using a 'LISTVIEW' object in my application to list 100 items for the user to select from.
I am able to select an item from the list and the index is returned correctly until the vertical scrollbar is moved, once the vertical scrollbar has been moved the LISTVIEW_GetSel() function is always returning the value 0 regardless of the selection in the 'LISTVIEW'.
Here is a snippet of my window callback which handles this...
Display All
I have tried using the auto scroll bar function and have also tried adding the scrollbar manually but both scenarios yield the same result.
I would appreciate it if you have any suggestions as to what might be going wrong here. Hopefully I am just missing something obvious!
Thank you in advance.
Kind Regards,
Pete
I am writing an application running on a STM32 processor using the STemWin precompiled library based on emWin version 5.40.
I am using a 'LISTVIEW' object in my application to list 100 items for the user to select from.
I am able to select an item from the list and the index is returned correctly until the vertical scrollbar is moved, once the vertical scrollbar has been moved the LISTVIEW_GetSel() function is always returning the value 0 regardless of the selection in the 'LISTVIEW'.
Here is a snippet of my window callback which handles this...
C Source Code
- static int selected;
- case WM_NOTIFY_PARENT:
- Id = WM_GetId(pMsg->hWinSrc);
- NCode = pMsg->Data.v;
- switch(Id) {
- case ID_LISTVIEW_0: // Notifications sent by 'Listview'
- switch(NCode) {
- case WM_NOTIFICATION_CLICKED:
- WM_HideWindow(_hNumKeyboard);
- break;
- case WM_NOTIFICATION_RELEASED:
- break;
- case WM_NOTIFICATION_SEL_CHANGED:
- hItem = WM_GetDialogItem(pMsg->hWin, ID_LISTVIEW_0);
- selected = LISTVIEW_GetSel(hItem);
- break;
- }
- break;
I have tried using the auto scroll bar function and have also tried adding the scrollbar manually but both scenarios yield the same result.
I would appreciate it if you have any suggestions as to what might be going wrong here. Hopefully I am just missing something obvious!
Thank you in advance.
Kind Regards,
Pete