DROPDOWN widget select BUG

    This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

    • Hi,

      Thanks for pointing this one out.

      We will fix this behavior. In the meanwhile you can use the workaround below. You have to set a custom callback for the DRAOPDOWN widget and react on WM_KEY. If the selection is disabled set a new selection.

      Set the callback below with WM_SetCallback(hDropdown, _cbDropdown);

      C Source Code

      1. /*********************************************************************
      2. *
      3. * _cbDropdown
      4. */
      5. static void _cbDropdown(WM_MESSAGE * pMsg) {
      6. WM_KEY_INFO * pInfo;
      7. static int OldSel;
      8. int NewSel;
      9. int NumIndexes;
      10. switch (pMsg->MsgId) {
      11. case WM_KEY:
      12. pInfo = (WM_KEY_INFO *)pMsg->Data.p;
      13. if (pInfo) {
      14. if (pInfo->PressedCnt) {
      15. OldSel = DROPDOWN_GetSel(pMsg->hWin);
      16. DROPDOWN_Callback(pMsg);
      17. NewSel = DROPDOWN_GetSel(pMsg->hWin);
      18. NumIndexes = DROPDOWN_GetNumItems(pMsg->hWin) - 1;
      19. while (DROPDOWN_GetItemDisabled(pMsg->hWin, NewSel)) {
      20. if (NewSel < OldSel) {
      21. NewSel = (NewSel > 0) ? NewSel - 1 : OldSel;
      22. } else if (NewSel > OldSel) {
      23. NewSel = (NewSel < NumIndexes) ? NewSel + 1 : OldSel;
      24. }
      25. }
      26. DROPDOWN_SetSel(pMsg->hWin, NewSel);
      27. }
      28. }
      29. break;
      30. default:
      31. DROPDOWN_Callback(pMsg);
      32. break;
      33. }
      34. }
      Display All

      Regards,
      Sven