constructor TDragShadow.Create;
begin
inherited;
Width := 1;
Height := 1;
if csDesigning in ComponentState then
begin
end else
begin
end;
end;
procedure TDragShadow.NewCtlWndProc(var Msg: TMessage);
const
{$J+}
PreX : integer=0;
PreY : integer=0;
fDragPrepared : Boolean=False;
{$J-}
var
cvs : TCanvas;
oldPen : TPen;
TagLeft , TagTop : integer;
rc : TRect;
begin
if Msg.Msg = WM_LButtonUp then
begin
if fDragPrepared = True then
begin
fDragCtl.Left := Left;
fDragCtl.Top := Top;
Parent.Invalidate;
ClipCursor(0);
end;
fDragPrepared := False;
end else if Msg.Msg = WM_MouseMove then
//end else if Msg.Msg = WM_MouseLeave then
//end else if Msg.Msg = WM_MOUSEHOVER then
//end else if Msg.Msg = WM_MOUSEFIRST then
begin
if TWMMouse(Msg).Keys = MK_LBUTTON then
begin
if fDragPrepared = True then
begin
if Parent is TForm then
begin
TForm(Parent).Repaint;
cvs := TForm(Parent).Canvas;
end else
begin
TParent(Parent).Repaint;
cvs := TParent(Parent).Canvas;
end;
TagLeft := Left - PreX + TWMMouse(Msg).XPos;
TagTop := Top - PreY + TWMMouse(Msg).YPos;
if (TagLeft > -(Width div 3)) and
(TagLeft < (Parent.Width - Width div 3)) then Left := TagLeft;
if (TagTop > -(Height div 3)) and
(TagTop < (Parent.Height - Height div 3)) then Top := TagTop;