Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 3 of 3 total
Thread OnTouchStart
Sat, Feb 22 2020 11:36 AMPermanent Link

Matthew Jones

Has anyone used the OnTouchStart to get the location of the finger on a control? If I use the same event handler as for a mouse, it is not working because the X value is not coming through properly. With the mouse, I get values in the range 0 to 300 on my panel. The touch gets a value around 6 or 8 regardless of where I touch on the panel. Am I missing something?

--

Matthew Jones
Mon, Feb 24 2020 11:19 AMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Matthew,

<< Has anyone used the OnTouchStart to get the location of the finger on a control? If I use the same event handler as for a mouse, it is not working because the X value is not coming through properly. With the mouse, I get values in the range 0 to 300 on my panel. The touch gets a value around 6 or 8 regardless of where I touch on the panel. >>

I just tried this simple example here:

unit Unit1;

interface

uses WebCore, WebUI, WebForms, WebCtrls, WebCtnrs, WebLabels;

type

  TForm1 = class(TForm)
     BasicPanel1: TBasicPanel;
     Label1: TLabel;
     procedure BasicPanel1TouchStart(Sender: TObject; ShiftKey, CtrlKey, AltKey: Boolean; X, Y: Integer);
  private
     { Private declarations }
  public
     { Public declarations }
  end;

var
  Form1: TForm1;

implementation

procedure TForm1.BasicPanel1TouchStart(Sender: TObject; ShiftKey, CtrlKey, AltKey: Boolean; X, Y: Integer);
begin
  Label1.Caption:=IntToStr(X)+', '+IntToStr(Y);
end;

end.

and it works fine.

Is your panel embedded in another form or some other type of arrangement that isn't covered by the above ?  If so, please try to send me a small example and I'll take a look.

Tim Young
Elevate Software
www.elevatesoft.com
Mon, Feb 24 2020 12:02 PMPermanent Link

Matthew Jones

Tim Young [Elevate Software] wrote:

> Is your panel embedded in another form or some other type of arrangement that isn't covered by the above ?

It is indeed. I will put something together - might just be the project as-is as it is fairly simple. I don't want to distract from bigger things though!

--

Matthew Jones
Image