Friday, May 25th 2018, 5:31am UTC+2

You are not logged in.

  • Login
  • Register

Dear visitor, welcome to SEGGER Forum. If this is your first visit here, please read the Help. It explains how this page works. You must be registered before you can use all the page's features. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.

XT-Matz

Beginner

Date of registration: Jul 16th 2015

Posts: 40

1

Thursday, May 19th 2016, 4:42pm

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/C++ Source code

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

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/C++ Source code

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

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

SEGGER - Schoenen

Super Moderator

Date of registration: Aug 13th 2015

Posts: 587

2

Friday, May 20th 2016, 4:17pm

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/C++ Source code

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


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

Regards,
Sven

XT-Matz

Beginner

Date of registration: Jul 16th 2015

Posts: 40

3

Monday, May 23rd 2016, 9:53am

Hi Sven,
it is often the small things needed to make further progress.
Thanks.

Similar threads