Tuesday, April 24th 2018, 6:35pm 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.

zoechoeng

Beginner

Date of registration: Jan 19th 2017

Posts: 15

1

Thursday, February 9th 2017, 8:00am

Touched event of widow.

I use WM_touch to return the touch location and raise an event. But I'm scrolling the window with the touch scroll. So using WM_touch will return position and event will work, but scrolling will not work. ;( ;(
Is not there a way to use both? ?( ?(

What should I do? Give me a good idea. please.
Thank you. :)

This post has been edited 1 times, last edit by "zoechoeng" (Feb 9th 2017, 8:48am)


zoechoeng

Beginner

Date of registration: Jan 19th 2017

Posts: 15

2

Thursday, February 9th 2017, 9:46am

Can I add a question?

If I run the window again after scrolling, it starts from the origin again. When I turn the window back on, can I run the screen at that location that was scrolled?

Thank you. I will wait for your reply. please. :thumbsup:

SEGGER - Schoenen

Super Moderator

Date of registration: Aug 13th 2015

Posts: 562

3

Friday, February 10th 2017, 9:26am

Hi,

Regarding the first question:
If you react on WM_TOUCH and handle this message, the default callback won't have a chance of doing default things..
Try this:

C/C++ Source code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
static void _cbWin(WM_MESSAGE * pMsg) {
  switch (pMsg->MsgId) {
  case WM_TOUCH:
	/*
  	.. Here you can handle your own code
	*/
	//
	// call the default callback to keep the default touch behavior, too
	//
	WM_DefaultProc(pMsg);
	break;
  default:
	//
	// Handle all other messages by the default callback
	//
	WM_DefaultProc(pMsg);
	break;
  }
}


Second question:
Do you delete the window and create it again?
If you create the window again you have to remeber the last position on your own and create it there.

If you use WM_HideWindow() and WM_ShowWindow() it should stay at the position where it has become hidden.

Regards,
Sven

Similar threads