Rounded FRAMEWIN

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

  • Rounded FRAMEWIN

    Hello,

    I am drawing a dialogue as below

    static const GUI_WIDGET_CREATE_INFO _aDialogCreate[] = {
    { FRAMEWIN_CreateIndirect, "Round button sample", 0, 50, 60, 200, 120, FRAMEWIN_CF_MOVEABLE },
    { BUTTON_CreateIndirect, "Button", GUI_ID_BUTTON0, 100, 10, 80, 80 },
    }

    I want my pop up window or FRAMEWIN as rounded frame.
    Is it possible to do that?

    Regards
    Anu
  • Hi Anu,

    to have a FRAMEWIN with rounded edges you might want to use skinning.
    To use the default skinning define the FRAMEWIN_USE_SKIN_FLEX macro as 1 in GUIConf.h.
    You are also able to configure the look of the skinning.
    Please have a look at the Skinning chapter in the emWin user manual.

    Another possibility is to set your own drawing routine for the FRAMEWIN window with the function FRAMEWIN_OwnerDraw().
    How to use a custom drawing routine is described chapter 19.4.3 User drawn widgets.

    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.
  • Hello Sven,

    Thanks for the replay. I have not fully understood with the below sentence

    "To use the default skinning define the FRAMEWIN_USE_SKIN_FLEX macro as 1 in GUIConf.h"


    I have added below code, but it does not seems to have any effect on my GUI.



    FRAMEWIN_SetSkin(hWin, FRAMEWIN_SKIN_FLEX); // Sets the skin for the given widget
    FRAMEWIN_SetDefaultSkin(FRAMEWIN_SKIN_FLEX); // Sets the default skin for new widgets

    Can u please elaborate again.

    Regards
    Anu
  • Hi Anu,

    FRAMEWIN_SetDefaultSkin(FRAMEWIN_SKIN_FLEX);
    Sets the default skin for all framewindows. It has to be called before creating the first framewindow, e.g. right after GUI_Init().


    FRAMEWIN_SetSkin(hWin, FRAMEWIN_SKIN_FLEX);
    Sets the skin for a single framewindow. This has to be called after creating the framewindow to have the window handle hWin initialized.

    Unfortunately I was wrong with defining FRAMEWIN_USE_SKIN_FLEX to 1.
    You have to add the following to your GUIConf.h to use flex skin for ALL widgets.
    #define WIDGET_USE_FLEX_SKIN 1

    I tried all three ways to set the skin, all are working without issues.

    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.