Monday 15 September 2014

delphi - Drag and drop unicode TText in DelphiXe4 -


I am trying to make a chess guinea with Trashangal in Delphx 4; Using the Unicode Chess Pieces TText (and try drag and drop to see but I can not get the DND working properly My test project is FireMonkey FMX I tried to add / accept and add DragOver Events also add different code for DragDrop The source code for the result is in the code but for no result. TText components & amp;;

I can get the DragDrop set function to auto on TRectangle & No drop function what Code I need to enter Events DragDrop target on TRectangle to accept DragOver Drop event! (I'm very confused with this and I can not find clear instructions anywhere on Google search!)

Here is my basic test code (on the form):

  unit unit 1; Interface System.SysUtils, System.Types, System.UITypes, System.Rtti, System.Classes, System.Variants, FMX.Types, FMX.Controls, FMX.Forms, FMX.Dialogs, FMX.StdCtrls, FMX.Objects Uses; Type TForm1 = Class (TForm) Rectangle1: TRectangle; Rectangle2: TRectangle; Rectangle3: TRectangle; Rectangle4: TRectangle; Rectangle5: TRectangle; Rectangle6: Rectangle Ctangle7: Trectangle; Rectangle 8: Tratengel; Verse 9: Trantengle; Lesson 1: Tietix; Process Rectangle7DragOver (Sender: Tobageist; CONST Data: TDRGABKET; CONNECT Points: TPIFF; Var Accepted: Boolean); Private {Private Announcement} public {public declaration} end; Var Form 1: Teform 1; Implementation {$ R * .fmx} Process TForm1.Rectangle7DragOver (Sender: Tubect; ​​CONST Data: TDRG Object; CONST Points: TIFFF; var Accept: Boolean); If the sender is TText then accept it: = true; End; End.   

Most grateful for help & amp; Thanks for the answer- Thanks

Edit / Update

Here is the code from Boom:

  Unit Unit 3; The interface uses System.SysUtils, System.Types, System.UITypes, System.Rtti, System.Classes, System.Variants, FMX.Types, FMX.Controls, FMX.Forms, FMX.Dialogs, FMX.Objects, FMX .Edit; Type TForm3 = Square (TForm) Rectangle 1: TRectangle; Lesson 1: Tietix; Edit 1: TEdit; Process Rectangle1DragOver (Sender: Tubect; ​​Constant: Tidrageject; Constant: TIFF; var Accept: Boolean); Private {private-declaration} public {public-declaration} end; Var form 3: Teform 3; Implementation {$ R * .fmx} Process TForm3.Rectangle1DragOver (Sender: Tubect; ​​CONST Data: TDRG Object; CONNECT Points: TIFF; var Accept: Boolean); Start Captions: = Data. Source.ClassName; Accept: = Data. Source texts; End; End.   

However with this I still can not find an example of chess! Oh dear Aaargh!

You must accept if the TDragObject is TText source. Accept: = Data. Source texts;

The sender will be your rectangle 7, or any component is assigned to Rectangle7DragOver.

No comments:

Post a Comment