CGDevTools Forum

Welcome to the Official CGDevTools Support Community Forums.

Aparams list POS value

by bryl » 28 Jun 2017 04:34

I need to get the position of the mouse when clicking on a region or dropping another region on the parent region.
The problem is I never get the same information in the aparams list on mouse up event or RegionJQDropOptionsDrop() event.

1 out of 10 times or so I get this (I need it every time to locate the position of the drop or mouse click).
IW_SessionID_=RYwvOmWpbKQeOTayAJBogG IW_TrackID_=2
[color=#FF0000]IWCGJQREGION7_POS=481,101

IWCGJQREGION7_POS=481,101
callback=REGRESTIMESLOT2.DoAjaxRequest
ajaxevent=JQDropOptions.OnDrop
ComponentName=REGResTimeSlot2

Most of the time I get this in the aparams list
IW_SessionID_=RYwvOmWpbKQeOTayAJBogG
IW_TrackID_=2
callback=REGRESTIMESLOT3.DoAjaxRequest
ajaxevent=JQDropOptions.OnDrop
ComponentName=REGResTimeSlot3

To replicate just drop a region with this event ...
procedure TIWForm3.IWCGJQRegion2JQEventsMouseUp(Sender: TObject;
AParams: TStringList);
begin
webapplication.ShowMessage('MouseUp ' + aparams.text);
end;

Can you advise on getting the position every time?

Thanks!
[/color]
bryl
 
Posts: 15
Joined: 23 Mar 2017 17:23

by Alexander Bulei » 28 Jun 2017 09:50

Hi bryl,

Please explain me what are you trying to do/handle?

Best Regards.
Group: Developers | Support Team

  • info [at] cgdevtools.com - General information
  • sales [at] cgdevtools.com - Sales department
  • support [at] cgdevtools.com - Product and Technical Support
User avatar
Alexander Bulei
Site Admin
 
Posts: 3635
Joined: 15 May 2012 08:52
Location: Mealhada, Portugal

by Alexander Bulei » 30 Jun 2017 09:41

Hi bryl,

independently from your intention, you can pass the coordenates by using the browser params.

Exemple on button click:

delphi code
procedure TIWForm10.IWAppFormCreate(Sender: TObject);
begin
with IWCGJQButton2.JQButtonOptions.OnClick.BrowserParams.Add do
begin
ServerName:= 'x';
BrowserScript:= 'e.pageX';
end;
with IWCGJQButton2.JQButtonOptions.OnClick.BrowserParams.Add do
begin
ServerName:= 'y';
BrowserScript:= 'e.pageY';
end;
end;

procedure TIWForm10.IWCGJQButton2JQButtonOptionsClick(Sender: TObject; AParams: TStringList);
var
PageX, PageY: Integer;
begin
PageX:= StrToInt( AParams.Values['x']);
PageY:= StrToInt( AParams.Values['y']);
end;


Best Regards.
Group: Developers | Support Team

  • info [at] cgdevtools.com - General information
  • sales [at] cgdevtools.com - Sales department
  • support [at] cgdevtools.com - Product and Technical Support
User avatar
Alexander Bulei
Site Admin
 
Posts: 3635
Joined: 15 May 2012 08:52
Location: Mealhada, Portugal

by bryl » 12 Jul 2017 04:02

Alexander,
Thank you for your reply. I have tried your solution modified for a region.
with IWCGJQRegion7.JQDropOptions.OnDrop.BrowserParams.add do
begin
ServerName:= 'x';
BrowserScript:= 'e.pageX';
end;
with IWCGJQRegion7.JQDropOptions.OnDrop.BrowserParams.add do
begin
ServerName:= 'y';
BrowserScript:= 'e.pageY';
end;
when implemented at create the region drag does not function.

I have attached a form and pas file that explains what I need. You can run it and see that it fails.
Thanks
Bryan
You do not have the required permissions to view the files attached to this post.
bryl
 
Posts: 15
Joined: 23 Mar 2017 17:23

by bryl » 12 Jul 2017 16:27

I found that setting OnDrop.AjaxQueued=true provided accurate X and Y positions.
bryl
 
Posts: 15
Joined: 23 Mar 2017 17:23

by Alexander Bulei » 13 Jul 2017 11:37

Hi bryl,

I found that setting OnDrop.AjaxQueued=true provided accurate X and Y positions.


I'm glad that you found the solution :)

Best Regards.
Group: Developers | Support Team

  • info [at] cgdevtools.com - General information
  • sales [at] cgdevtools.com - Sales department
  • support [at] cgdevtools.com - Product and Technical Support
User avatar
Alexander Bulei
Site Admin
 
Posts: 3635
Joined: 15 May 2012 08:52
Location: Mealhada, Portugal


Return to JQRegion

Who is online

Users browsing this forum: No registered users and 1 guest

Contact Us.