Some FRAMEWIN API functions doesnt work with skinning (?)

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

  • Some FRAMEWIN API functions doesnt work with skinning (?)

    Hi,

    I have an issue concerning skinning in conjunction with widget API methods.

    I have multiple FRAMEWIN-dialogs.
    I use an own skinning callback routine for all of the FRAMEWINs, means in principle all FRAMEWINs look similar.

    But a few properties of the different FRAMEWINs must differ, e.g.:
    - Title Bar Height
    - Text Font
    - Title Bar Color
    - Title Text Color

    For that I initializes each FRAMEWIN when the particular dialog receives the WM_INIT_DIALOG command:

    C Source Code

    1. case WM_INIT_DIALOG:
    2. FRAMEWIN_SetSkin(hDlg, mySkinningCallback); // same for each framewin
    3. FRAMEWIN_SetTitleHeight(hDlg, <height>); // same for each framewin
    4. FRAMEWIN_SetFont(hDlg, &<font>); // same for each framewin
    5. FRAMEWIN_SetTextColor(hDlg, <color>); // different for each framewin
    6. FRAMEWIN_SetBarColor(hDlg, 1, <color>); // different for each framewin
    7. FRAMEWIN_SetBarColor(hDlg, 0, <color>); // different for each framewin

    I found out, that some of the properties could be changed, some not:

    FRAMEWIN_SetTitleHeight - works :)
    FRAMEWIN_SetFont - works :)
    FRAMEWIN_SetTextColor - works :)
    FRAMEWIN_SetBarColor - doesn't work ?(

    Is there a special reason why SetBarColor doesn't work but other functions work? I dont understand the difference behaviour.
    Are there some more widget API functions that wont work in conjunction with skinning?

    Best regards
    Matz
  • Hi Matz,

    unfortunately this is not possible with skinning and the FRAMEWIN widget. The default skin of the FRAMEWIN has no color bar..

    But you can either define your own skin and handle the look or you set the colors used for the gradient which is drawn in the topmost area of the FRAMWIN (see below).

    C Source Code

    1. #include "DIALOG.h"
    2. /*********************************************************************
    3. *
    4. * MainTask
    5. */
    6. void MainTask(void) {
    7. FRAMEWIN_SKINFLEX_PROPS PropsActive;
    8. FRAMEWIN_SKINFLEX_PROPS PropsInactive;
    9. GUI_Init();
    10. WM_SetDesktopColor(GUI_BLACK);
    11. //
    12. // Create two frame windows
    13. //
    14. FRAMEWIN_Create("Framewin0", 0, WM_CF_SHOW, 10, 10, 120, 120);
    15. FRAMEWIN_Create("Framewin1", 0, WM_CF_SHOW, 140, 10, 120, 120);
    16. //
    17. // Receive the default properties for selected and un-selected state
    18. //
    19. FRAMEWIN_GetSkinFlexProps(&PropsActive, FRAMEWIN_SKINFLEX_PI_ACTIVE);
    20. FRAMEWIN_GetSkinFlexProps(&PropsInactive, FRAMEWIN_SKINFLEX_PI_INACTIVE);
    21. //
    22. // Overwrite the colors used for drawing a gradient
    23. //
    24. PropsActive.aColorTitle[0] = GUI_RED;
    25. PropsActive.aColorTitle[1] = GUI_DARKRED;
    26. PropsInactive.aColorTitle[0] = GUI_BLUE;
    27. PropsInactive.aColorTitle[1] = GUI_DARKBLUE;
    28. //
    29. // Write back the properties
    30. //
    31. FRAMEWIN_SetSkinFlexProps(&PropsActive, FRAMEWIN_SKINFLEX_PI_ACTIVE);
    32. FRAMEWIN_SetSkinFlexProps(&PropsInactive, FRAMEWIN_SKINFLEX_PI_INACTIVE);
    33. while (1) {
    34. GUI_Delay(100);
    35. }
    36. }
    Display All



    Regards,
    Sven
    Please read the forum rules before posting.

    Keep in mind, this is *not* a support forum.
    Our engineers will try to answer your questions between their projects if possible but this can be delayed by longer periods of time.
    Should you be entitled to support you can contact us via our support system: segger.com/ticket/

    Or you can contact us via e-mail.