Bookstore

Recent

Author Topic: stringgrid's onclick in windows mobile  (Read 9178 times)

zariq

  • Full Member
  • ***
  • Posts: 109
stringgrid's onclick in windows mobile
« on: November 12, 2010, 08:55:11 pm »
Hi everyone.

I was using a stringgrid with windows mobile 6 and noticed that when using the stylus, the first time round the stringgrid needs to be clicked twice before the onclick handler gets executed, after that it's behaviour is normal. When using the phone in mouse mode the event doesn't get triggered at all, but if the stylus is used to click the the grid once, then the mouse triggers the event normally after that.

The grid needs to be clicked twice the first time in the emulator aswell but, strangely, when the phone is connected to and controlled from the computer with a program like mymobiler, then the first click triggers the event. I tried a few other component and they work fine.

Is this a bug in the grid or has it something to do with windows mobile?  I'm using snapshot 27550 fpc 2.4.0.

Should have started a new topic, but don't know how to link a comment into a new topic.

Thanks.

« Last Edit: February 10, 2011, 10:05:31 pm by zariq »

felipemdc

  • Administrator
  • Hero Member
  • *
  • Posts: 3541
Re: stringgrid's onclick in windows mobile
« Reply #1 on: November 15, 2010, 06:28:13 am »
It could be either. It's hard to say without trying to fix the bug. Most bugs are problems in the LCL, but some of them are caused by Windows CE itself and very hard to get solved.

The string grid is a TCustomControl descendent, so the odds are higher that it is a LCL bug.

You could try to compare how the project behaves in LCL-Win32 and also LCL-WinCE compiled for Win32-x86

PS: What is mouse mode? Simply attaching a mouse via USB? And the events don't work? Do other events work with an attached mouse? If that's the case, then probably WinCE treats mouse events differently from win32, you can test this by using the LCL-WinCE compiled for win32-x86
« Last Edit: November 15, 2010, 06:36:29 am by felipemdc »

zariq

  • Full Member
  • ***
  • Posts: 109
Re: stringgrid's onclick in windows mobile
« Reply #2 on: November 16, 2010, 03:11:36 am »

regarding your suggestion about running it in windows, I've never been able to get that working, I always get the error of "Fatal: Can't find unit Interfaces used by project". I set the widget type to wince in "compiler options" and left the target os and target cpu in "code generation" blank, but for some reason it doesn't work.

I did replace the grids message handler with my own to see if it was getting any messages from the first click. The new handler does recieve mouse down and mouse up messages on the first click so obviously the grids original handler would be recieving them messages aswell, but they seem to get lost somewhere down the line.

Thanks.

felipemdc

  • Administrator
  • Hero Member
  • *
  • Posts: 3541
Re: stringgrid's onclick in windows mobile
« Reply #3 on: November 16, 2010, 06:27:30 am »

regarding your suggestion about running it in windows, I've never been able to get that working, I always get the error of "Fatal: Can't find unit Interfaces used by project". I set the widget type to wince in "compiler options" and left the target os and target cpu in "code generation" blank, but for some reason it doesn't work.

This message always means that you need to build your LCL. In this case you need to build the LCL-WinCE for win32-x86.

Menu Tools -> Configure Build Lazarus

Set LCL to build+clean, everything else to NONE, widgetset WinCE, leave blank OS and Architecture. Build Lazarus

zariq

  • Full Member
  • ***
  • Posts: 109
Re: stringgrid's onclick in windows mobile
« Reply #4 on: November 16, 2010, 09:07:40 pm »
Thanks Felipe for the instructions. The click event works normally under win32.

By the way mouse mode is for being able to use the phone without using the touchscreen and doesn't involve connecting a real mouse to the phone. The phone shows a mouse cursor which you can maneuver with the trackball. Pressing the trackball is equivalent to pressing the left button on a mouse.

zariq

  • Full Member
  • ***
  • Posts: 109
Re: stringgrid's onclick in windows mobile
« Reply #5 on: February 10, 2011, 10:02:48 pm »

regarding your suggestion about running it in windows, I've never been able to get that working, I always get the error of "Fatal: Can't find unit Interfaces used by project". I set the widget type to wince in "compiler options" and left the target os and target cpu in "code generation" blank, but for some reason it doesn't work.

This message always means that you need to build your LCL. In this case you need to build the LCL-WinCE for win32-x86.

Menu Tools -> Configure Build Lazarus

Set LCL to build+clean, everything else to NONE, widgetset WinCE, leave blank OS and Architecture. Build Lazarus


I downloaded 0.9.31(29303) with 2.4.2 and I can't get it to work any more. After building and restarting about 3 partial windows show and then it freezes. There are three icons on the taskbar, two for the main program and one I think for the messages window. Clicking on the taskbar icons does nothing. Is this particular feature temporarily broken or am I just doing it wrong.

Thanks.