button bitmap change issue

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

    • button bitmap change issue

      at dialog init. I am able to change the bitmap of button as shown below,

      case WM_PAINT:
      hItem = WM_GetDialogItem(pMsg->hWin, ID_BUTTON_0);
      BUTTON_SetBitmapEx ( hItem, BUTTON_BI_UNPRESSED, &bmStart_Test, (175/2)-(50/2), (100/2)-(50/2));
      break;



      but after that I am not able to change bitmap of same button, what would be the reason?

      void vGeneralFunction_StartTest (void){
      WM_HWIN hCWin;

      /* Create a dialog */
      hCWin = GUI_CreateDialogBox(_aDialogCreate, GUI_COUNTOF(_aDialogCreate), _cbDialog, WM_HBKWIN, LCD_X_SIZE-175, 0);

      hButton = WM_GetDialogItem(hCWin , ID_BUTTON_0);
      BUTTON_SetBitmapEx ( hButton, BUTTON_BI_UNPRESSED, &bmStop_Test, (175/2)-(50/2), (100/2)-(50/2));

      while (1){
      GUI_Delay (25);
      }
      }

      The post was edited 1 time, last by himsha ().

    • You should handle the events inside your dialogs callback function.
      E.g. on WM_INIT_DLG set the button to show the start bitmap. When button is pressed (WM_NOTIFY_PARENT / WM_NOTIFICATION_RELEASED) change the button to show the stop image.