LISTBOX WrapMode

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

    • LISTBOX WrapMode

      Hi everyone,
      I am working a demo project, i have use Listbox in it. Every thing works fine in the normal mode. But When i enable Wrap mode the execution of simulation program hangs. I am not able understand, what may the reason.


      Please help me out


      Thankyou in advance
    • Hi,

      I tried to reproduce the behavior but on my end it is working fine.

      Pleas give it a try and run the application below. Does it works on your side?

      C Source Code

      1. #include "DIALOG.h"
      2. /*********************************************************************
      3. *
      4. * Externals
      5. *
      6. **********************************************************************
      7. */
      8. /*********************************************************************
      9. *
      10. * Defines
      11. *
      12. **********************************************************************
      13. */
      14. #define ID_WINDOW_0 (GUI_ID_USER + 0x00)
      15. #define ID_LISTBOX_0 (GUI_ID_USER + 0x01)
      16. /*********************************************************************
      17. *
      18. * Static data
      19. *
      20. **********************************************************************
      21. */
      22. /*********************************************************************
      23. *
      24. * _aDialogCreate
      25. */
      26. static const GUI_WIDGET_CREATE_INFO _aDialogCreate[] = {
      27. { WINDOW_CreateIndirect, "Window", ID_WINDOW_0, 0, 0, 320, 240, 0, 0x0, 0 },
      28. { LISTBOX_CreateIndirect, "Listbox", ID_LISTBOX_0, 30, 30, 80, 60, 0, 0x0, 0 },
      29. };
      30. /*********************************************************************
      31. *
      32. * Static code
      33. *
      34. **********************************************************************
      35. */
      36. /*********************************************************************
      37. *
      38. * _cbDialog
      39. */
      40. static void _cbDialog(WM_MESSAGE * pMsg) {
      41. WM_HWIN hItem;
      42. int NCode;
      43. int Id;
      44. switch (pMsg->MsgId) {
      45. case WM_INIT_DIALOG:
      46. hItem = WM_GetDialogItem(pMsg->hWin, ID_LISTBOX_0);
      47. LISTBOX_AddString(hItem, "Item 0");
      48. LISTBOX_AddString(hItem, "Item 1");
      49. LISTBOX_AddString(hItem, "Item 2");
      50. LISTBOX_AddString(hItem, "Item 3");
      51. LISTBOX_EnableWrapMode(hItem, 1);
      52. break;
      53. default:
      54. WM_DefaultProc(pMsg);
      55. break;
      56. }
      57. }
      58. /*********************************************************************
      59. *
      60. * _cbBk
      61. */
      62. static void _cbBk(WM_MESSAGE * pMsg) {
      63. switch (pMsg->MsgId) {
      64. case WM_PAINT:
      65. GUI_SetBkColor(GUI_BLACK);
      66. GUI_Clear();
      67. break;
      68. default:
      69. WM_DefaultProc(pMsg);
      70. break;
      71. }
      72. }
      73. /*********************************************************************
      74. *
      75. * Public code
      76. *
      77. **********************************************************************
      78. */
      79. /*********************************************************************
      80. *
      81. * MainTask
      82. */
      83. void MainTask(void) {
      84. GUI_Init();
      85. WM_SetCallback(WM_HBKWIN, _cbBk);
      86. GUI_CreateDialogBox(_aDialogCreate, GUI_COUNTOF(_aDialogCreate), _cbDialog, WM_HBKWIN, 0, 0);
      87. while (1) {
      88. GUI_Delay(100);
      89. }
      90. }
      91. /*************************** End of file ****************************/
      Display All
      Regards,
      Sven