summaryrefslogtreecommitdiff
path: root/plugins/Chess4Net/DraggedFigureUnit.pas
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/Chess4Net/DraggedFigureUnit.pas')
-rw-r--r--plugins/Chess4Net/DraggedFigureUnit.pas42
1 files changed, 42 insertions, 0 deletions
diff --git a/plugins/Chess4Net/DraggedFigureUnit.pas b/plugins/Chess4Net/DraggedFigureUnit.pas
new file mode 100644
index 0000000000..bbf513ae77
--- /dev/null
+++ b/plugins/Chess4Net/DraggedFigureUnit.pas
@@ -0,0 +1,42 @@
+unit DraggedFigureUnit;
+
+interface
+
+uses
+ Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
+ Dialogs, ExtCtrls;
+
+type
+ TDraggedFigure = class(TForm)
+ Image1: TImage;
+ procedure FormCreate(Sender: TObject);
+ procedure Image1MouseDown(Sender: TObject; Button: TMouseButton;
+ Shift: TShiftState; X, Y: Integer);
+ private
+ { Private declarations }
+ public
+ { Public declarations }
+ end;
+
+var
+ DraggedFigure: TDraggedFigure;
+
+implementation
+
+{$R *.dfm}
+
+procedure TDraggedFigure.FormCreate(Sender: TObject);
+begin
+ ClientWidth:= 40;
+end;
+
+
+
+procedure TDraggedFigure.Image1MouseDown(Sender: TObject; Button: TMouseButton;
+ Shift: TShiftState; X, Y: Integer);
+const SC_DRAGMOVE = $F012;
+begin ReleaseCapture;
+ Perform(WM_SYSCOMMAND, SC_DRAGMOVE, 0 );
+end;
+
+end.