Rounding the corners of a Box object in AppWizard

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

    • Rounding the corners of a Box object in AppWizard

      Hey guys,

      Is there a way that I can set the radius of a Box object's corners from AppWizard? If not in AppWizard, is there a way through code to round corners to an AppWizard Box object? Let me know and thanks!
    • Hi,

      unfortunately, the AppWizard does not currently offer the possibility to draw rounded rectangles via the Box object. But such a feature definitely makes sense and we will consider adding it with a future release.

      As for now, you can create a window in your application that draws a rounded rectangle. Add an interaction for your screen on INITDIALOG and set NULL as the job (e.g. ID_SCREEN_0 -> INITDIALOG -> NULL).

      This will generate a slot routine in the slot file of the screen, where you can create the window, that draws the rectangle. Like this:

      C Source Code

      1. static void _cbWin(WM_MESSAGE * pMsg) {
      2. GUI_RECT Rect;
      3. switch(pMsg->MsgId) {
      4. case WM_PAINT:
      5. GUI_SetBkColor(GUI_WHITE);
      6. GUI_Clear();
      7. GUI_SetColor(GUI_BLACK);
      8. WM_GetClientRect(&Rect);
      9. GUI_DrawRoundedRectEx(&Rect, 5);
      10. break;
      11. default:
      12. WM_DefaultProc(pMsg);
      13. }
      14. }
      15. /*********************************************************************
      16. *
      18. */
      19. void ID_SCREEN_00__APPW_NOTIFICATION_INITDIALOG(APPW_ACTION_ITEM * pAction, WM_HWIN hScreen, WM_MESSAGE * pMsg, int * pResult) {
      20. GUI_USE_PARA(pAction);
      21. GUI_USE_PARA(hScreen);
      22. GUI_USE_PARA(pMsg);
      23. GUI_USE_PARA(pResult);
      24. WM_CreateWindowAsChild(0, 0, 100, 100, hScreen, WM_CF_SHOW, _cbWin, 0);
      25. }
      Display All
      Since AppWizard cannot compile slot routine code, the rectangle will only be visible in the Simulation project, not in the AppWizard tool.

      Best regards,