Sunday, December 17th 2017, 2:56pm UTC+1

You are not logged in.

  • Login
  • Register

Reply

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.

Message information
Message
Settings
Automatically converts internet addresses into links by adding [url] and [/url] around them.
Smiley code in your message such as :) is automatically displayed as image.
You can use BBCode to format your message, if this option is enabled.
Security measure

Please enter the letters that are shown in the picture below (without spaces, and upper or lower case can be used).

The last 8 posts

Monday, November 6th 2017, 11:42pm

by Mr. Spock

Thank you !

Wil try

Monday, November 6th 2017, 8:35am

by SEGGER - Schoenen

Hello Mr. Spock,

You can use WM_GetParent(pMsg->hWin) and use the returned handle to delete the parent. The problem is that the background window doesn't 'know' how to redraw itself and the deleted dialog will be still visible.

Set a callback function for the background window and the dialog will disappear after deleting.

Like:

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
28
29
30
31
32
33
/*********************************************************************
*
*   	_cbBk
*/
static void _cbBk(WM_MESSAGE * pMsg) {
  switch (pMsg->MsgId) {
  case WM_PAINT:
	GUI_SetBkColor(GUI_BLACK);
	GUI_Clear();
	break;
  default:
	WM_DefaultProc(pMsg);
	break;
  }
}

/*********************************************************************
*
*   	Public code
*
**********************************************************************
*/
/*********************************************************************
*
*   	MainTask
*/
void MainTask(void) {
  GUI_Init();
  WM_SetCallback(WM_HBKWIN, _cbBk);
  //
  // ...
  //
}



Live long and prosper
Sven

Monday, October 30th 2017, 11:44pm

by Mr. Spock

Hi

I want to use the example in KeyMsg.zip to end a dialog when GUI_KEY_F1 is pressed. The problem is that I canot get the handle of the dialog. Function WM_GetParent(pMsg->hWin) does not work here.

Regards

Friday, October 20th 2017, 4:28am

by akiramaru

Dear Sir:
Sorry for my eye's karma, your method is right. It's really can get keyMsg when I press the button.

Thursday, October 12th 2017, 8:51am

by akiramaru

Dear Sir:
I have tried your code but it doesn't work well, please see attach pic. I set my BUTTON_ENTER value is 0x81A but i got KeyMsg on _cbEDIT0 is 0x10000000 they are doesn't match, could you solve these problem? Thanks.
Hi,

Unfortunately, you can not react on key messages like you react on e.g. value changed. To react on key messages you have to set a custom callback for the edit widget itself.

Attached you will find a short example on how this can be done. It shows the custom callback and how to distinguish between the different keys.

Regards
Sven
akiramaru has attached the following image:
  • keymsg.png

Wednesday, October 11th 2017, 7:38am

by akiramaru

Dear Sir:
Thanks for your support, I am try to learn it. :thumbup:

Friday, October 6th 2017, 2:45pm

by SEGGER - Schoenen

Hi,

Unfortunately, you can not react on key messages like you react on e.g. value changed. To react on key messages you have to set a custom callback for the edit widget itself.

Attached you will find a short example on how this can be done. It shows the custom callback and how to distinguish between the different keys.

Regards
Sven
SEGGER - Schoenen has attached the following file:
  • KeyMsg.zip (1.08 kB - 83 times downloaded - Last download: Today, 2:54pm)

Thursday, October 5th 2017, 7:10am

by akiramaru

How to get GUI_SendKeyMsg event when I focused at EDIT widget?

Dear all:
Here has a problem when I focused on an EDIT widget, I can't get any KeyMsg when I press button and sent to the queue. Have anybody can help me to solve this problem, thx.

P.S. Myapplication for STemWin is only use keyboard not touch screen.

C/C++ Source code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
switch(Id) {
	case ID_EDIT_0: // Notifications sent by 'Edit'
	switch(NCode) {
		case WM_NOTIFICATION_CLICKED:
			// USER START (Optionally insert code for reacting on notification message)
			// USER END
		break;
		case WM_NOTIFICATION_RELEASED:
			// USER START (Optionally insert code for reacting on notification message)
			// USER END
		break;
		case WM_NOTIFICATION_VALUE_CHANGED:
			// USER START (Optionally insert code for reacting on notification message)
			// USER END
		break;
	// USER START (Optionally insert additional code for further notification handling)
	// USER END
	}
	break; }