Modify FRAMEWIN properties (FRAMEWIN as part of MULTIPAGE)

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

  • Modify FRAMEWIN properties (FRAMEWIN as part of MULTIPAGE)

    Hi,

    I have a multipage with four pages. The multipage contains a FRAMEWIN as first dialog item of the GUI_WIDGET_CREATE_INFO. I want to modify some FRAMEWIN properties but I failed. Unfortunately I dont see any effect.

    Some Details and code snippets:

    C Source Code

    1. static const GUI_WIDGET_CREATE_INFO _aDialogCreate2[] = {
    2. { FRAMEWIN_CreateIndirect, "blablabla", GUI_ID_FRAMEWIN, 5, 5, 200, 150, 0 },
    3. { CHECKBOX_CreateIndirect, 0, GUI_ID_CHECK0, 10, 30, 100, 0, 0 },
    4. { CHECKBOX_CreateIndirect, 0, GUI_ID_CHECK1, 10, 50, 100, 0, 0 },
    5. ...
    6. };

    The multipage and the checkboxes works fine. So far so good.

    Then I tried to modify some properties of the FRAMEWIN with the FRAMEWIN API functions, e.g. FRAMEWIN_SetText(); I call the FRAMEWIN_API functions within the dialog callback of the corresponding multipage dialog when its called with WM_INIT_DIALOG, like:

    C Source Code

    1. static void _cbDialog2(WM_MESSAGE * pMsg) {
    2. switch(pMsg) {
    3. ...
    4. case WM_INIT_DIALOG:
    5. hItem = WM_GetDialogItem(pMsg->hWin, GUI_ID_FRAMEWIN);
    6. FRAMEWIN_SetText(hItem, "TestTest");
    7. //... other statements work fine like CHECKBOX_SetText...
    8. break;
    9. ...

    Unfortunately I dont see any effect. Same with other FRAMEWIN properties like color, border size.

    What have I done wrong? Is there something magic because the FRAMEWIN is part of a mutlipage? ?(

    Regards
    Matz

    PS: I am actually working with the simulation - precompiled emWin5.32
  • Hi Matz,

    The frame window is the dialog. And it conatins no Item with the ID GUI_ID_FRAMEWIN ;)
    The handle you are looking for is pMsg->hWin.

    Change your code like shown below:

    C Source Code

    1. static void _cbDialog2(WM_MESSAGE * pMsg) {
    2. switch(pMsg) {
    3. ...
    4. case WM_INIT_DIALOG:
    5. //hItem = WM_GetDialogItem(pMsg->hWin, GUI_ID_FRAMEWIN);
    6. FRAMEWIN_SetText(pMsg->hWin, "TestTest");
    7. //... other statements work fine like CHECKBOX_SetText...
    8. break;


    If you want to change other properties, do it the same way as above, with pMsg->hWin.

    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.