Compatibility of AppWizard objects and emWin widgets

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

    • Compatibility of AppWizard objects and emWin widgets

      Hi.

      I have read the AppWizard manual and it seems like if you want to control an AppWizard object's properties (other than text and values) from code, you have to use AppWizard's Variables.
      It's useful on simple applications, but I personally believe that method won't scale on large embedded projects.

      Some AppWizard objects like Button is said to be similar to emWin button widget but it's not clear if you can use the Window Manager (WM) APIs on them.
      Is there any document where I can find the information regarding the compatibilities between AppWizard objects and emWin widgets?

      For example, if I have an AppWizard screen (ID_SCREEN_0) with button (ID_BUTTON_00) and I would like to set the button's background color from code, how would I do that without using AppWizard's Variables?

      Is it *safe* to use something like the following code?
      (*safe* meaning AppWizard's button object will remain compatible with emWin's button widgets for foreseeable future)

      C Source Code

      1. /* assume hScreen is the WM_HWIN handle of ID_SCREEN_0 */
      2. WM_HWIN hButton;
      3. hButton = WM_GetDialogItem(hScreen, ID_BUTTON_00);
      4. BUTTON_SetBkColor(hButton, 0, GUI_GREEN);

      It works, but because it is not documented I worry that it may fail on future versions.

      Best Regards,
      Rowel