Wednesday, January 24th 2018, 6:58am UTC+1

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

Monday, May 23rd 2016, 4:47pm

Multiple WINDOWs/DIALOGs in each MULTIPAGE-page

Hi,

I have a MULTIPAGE widget running with a dialog on each of four multipage pages. So far so good.

Now I want to modify this. The requirement is:
I want to have TWO Windows within each Multipage-page:
- one window for status display,
- one scrollable window with a dialog.
The dialog window will have multiple checkboxes or similar (defined by a GUI_WIDGET_CREATE_INFO structure) and must have a scrollbar. The status window must not be scrollable and must be visible all the time the dedicated multipage-page is displayed.

I think about realizing this in the following way:

Create a - in the beginning WN_UNATTACHED - (parent)-window for each multipage page.
Create two child windows (for status and for dialog) as childs of the above parent window.
Add a scrollbar to the dialog window.
Then attach the parent window to the multipage-page with MULTIPAGE_AddPage();

Is that a possible solution? Should it work?
What do you recommend to realize it?

Best regards
XT-MAtz

XT-Matz

Beginner

Date of registration: Jul 16th 2015

Posts: 40

2

Tuesday, May 24th 2016, 1:15pm

Hi,

In beetween I tried it. I created one parent window containing two child windows. One of the childs is the dialog.
Then I add this parent window to the MULTIPAGE. Unfortunately I have a problem with the focus.

Here a code snippet:

C/C++ Source code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
WM_HWIN CreatePageWindow(void) {
	WM_HWIN h_parent, h_dlg;

	// Parent Window (later added to the multipage page)
	h_parent = WM_CreateWindow(0, 0, 200, 220, WM_CF_SHOW | WM_CF_DISABLED, _cbParent, 0);

	// Child Window (later for status information)
	WM_CreateWindowAsChild(0, 0, 180, 30, h_parent, WM_CF_SHOW | WM_CF_DISABLED, _cbInfo, 0);
	
	// Child Window with the Dialog itself
	h_dlg = GUI_CreateDialogBox(_aDialogCreate, GUI_COUNTOF(_aDialogCreate), _cbDialog, h_parent, 0, 35);

	// Trying to get the focus by this way doesnt work: :-(
	WM_SetFocus(h_dlg); 

	return(h_parent);
}


void CreateMultipageMenu(void) {
	...
	h_multipage = MULTIPAGE_CreateEx(....);
	
	h_page = CreatePageWindow();
	MULTIPAGE_AddPage(h_multipage, h_page, ""); 
	...
}


The problem:
the dialog child window didnt get the focus when the multipage page is selected. Instead the parent window gets the focus.
WM_SetFocus after WM_CreatDialog dont have any effect!
Where and when have I to call WM_SetFocus?.

Looking forward to help.
Best regards.

This post has been edited 1 times, last edit by "XT-Matz" (May 24th 2016, 1:18pm)