mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-17 20:59:12 +02:00
change formatting in some units: decapitalize keywords, spacing
git-svn-id: trunk@13387 -
This commit is contained in:
parent
17a72ca27b
commit
c711f7fcfc
@ -402,7 +402,7 @@ type
|
|||||||
protected
|
protected
|
||||||
Procedure EndDrag(Target: TObject; X, Y: Integer); Virtual;
|
Procedure EndDrag(Target: TObject; X, Y: Integer); Virtual;
|
||||||
procedure Finished(Target: TObject; X, Y: Integer; Accepted: Boolean); override;
|
procedure Finished(Target: TObject; X, Y: Integer; Accepted: Boolean); override;
|
||||||
Public
|
public
|
||||||
constructor Create(AControl: TControl); virtual;
|
constructor Create(AControl: TControl); virtual;
|
||||||
procedure Assign(Source: TDragObject); override;
|
procedure Assign(Source: TDragObject); override;
|
||||||
property Control: TControl read FControl write FControl;
|
property Control: TControl read FControl write FControl;
|
||||||
|
@ -63,11 +63,11 @@ end;
|
|||||||
------------------------------------------------------------------------------}
|
------------------------------------------------------------------------------}
|
||||||
procedure TControl.BeginDrag(Immediate: Boolean; Threshold: Integer);
|
procedure TControl.BeginDrag(Immediate: Boolean; Threshold: Integer);
|
||||||
var
|
var
|
||||||
P : TPoint;
|
P: TPoint;
|
||||||
begin
|
begin
|
||||||
// start a drag operation, if not already running
|
// start a drag operation, if not already running
|
||||||
if (DragControl = nil) then begin
|
if (DragControl = nil) then
|
||||||
|
begin
|
||||||
// if the last mouse down was not followed by a mouse up, simulate a
|
// if the last mouse down was not followed by a mouse up, simulate a
|
||||||
// mouse up. This way applications need only to react to mouse up to
|
// mouse up. This way applications need only to react to mouse up to
|
||||||
// clean up.
|
// clean up.
|
||||||
@ -76,7 +76,8 @@ begin
|
|||||||
{$endif}
|
{$endif}
|
||||||
if Immediate then
|
if Immediate then
|
||||||
SetCaptureControl(nil);
|
SetCaptureControl(nil);
|
||||||
if csLButtonDown in ControlState then begin
|
if csLButtonDown in ControlState then
|
||||||
|
begin
|
||||||
GetCursorPos(p);
|
GetCursorPos(p);
|
||||||
P := ScreenToClient(p);
|
P := ScreenToClient(p);
|
||||||
Perform(LM_LBUTTONUP, 0, Integer(PointToSmallPoint(p)));
|
Perform(LM_LBUTTONUP, 0, Integer(PointToSmallPoint(p)));
|
||||||
@ -84,7 +85,7 @@ begin
|
|||||||
|
|
||||||
if Threshold < 0 then
|
if Threshold < 0 then
|
||||||
Threshold := Mouse.DragThreshold;
|
Threshold := Mouse.DragThreshold;
|
||||||
DragInitControl(Self,Immediate,Threshold);
|
DragInitControl(Self, Immediate, Threshold);
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -93,7 +94,7 @@ end;
|
|||||||
------------------------------------------------------------------------------}
|
------------------------------------------------------------------------------}
|
||||||
procedure TControl.BeginAutoDrag;
|
procedure TControl.BeginAutoDrag;
|
||||||
begin
|
begin
|
||||||
BeginDrag(Mouse.DragImmediate,Mouse.DragThreshold);
|
BeginDrag(Mouse.DragImmediate, Mouse.DragThreshold);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{------------------------------------------------------------------------------
|
{------------------------------------------------------------------------------
|
||||||
@ -3139,7 +3140,7 @@ end;
|
|||||||
TControl WMMouseMove
|
TControl WMMouseMove
|
||||||
------------------------------------------------------------------------------}
|
------------------------------------------------------------------------------}
|
||||||
procedure TControl.WMMouseMove(Var Message: TLMMouseMove);
|
procedure TControl.WMMouseMove(Var Message: TLMMouseMove);
|
||||||
Begin
|
begin
|
||||||
{$IFDEF VerboseMouseBugfix}
|
{$IFDEF VerboseMouseBugfix}
|
||||||
DebugLn(['[TControl.WMMouseMove] ',Name,':',ClassName,' ',Message.XPos,',',Message.YPos]);
|
DebugLn(['[TControl.WMMouseMove] ',Name,':',ClassName,' ',Message.XPos,',',Message.YPos]);
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
@ -3148,26 +3149,28 @@ Begin
|
|||||||
if not (csNoStdEvents in ControlStyle)
|
if not (csNoStdEvents in ControlStyle)
|
||||||
then with Message do
|
then with Message do
|
||||||
MouseMove(KeystoShiftState(Keys), XPos, YPos);
|
MouseMove(KeystoShiftState(Keys), XPos, YPos);
|
||||||
End;
|
end;
|
||||||
|
|
||||||
{------------------------------------------------------------------------------
|
{------------------------------------------------------------------------------
|
||||||
TControl MouseDown
|
TControl MouseDown
|
||||||
------------------------------------------------------------------------------}
|
------------------------------------------------------------------------------}
|
||||||
Procedure TControl.MouseDown(Button: TMouseButton; Shift: TShiftState;
|
procedure TControl.MouseDown(Button: TMouseButton; Shift: TShiftState;
|
||||||
X, Y: Integer);
|
X, Y: Integer);
|
||||||
var
|
var
|
||||||
P: TPoint;
|
P: TPoint;
|
||||||
Form: TCustomForm;
|
Form: TCustomForm;
|
||||||
begin
|
begin
|
||||||
if (not (Self is TWinControl)) or (not TWinControl(Self).CanFocus) then begin
|
if (not (Self is TWinControl)) or (not TWinControl(Self).CanFocus) then
|
||||||
Form:=GetParentForm(Self);
|
begin
|
||||||
if (Form<>nil) and (Form.ActiveControl<>nil) then
|
Form := GetParentForm(Self);
|
||||||
|
if (Form <> nil) and (Form.ActiveControl <> nil) then
|
||||||
Form.ActiveControl.EditingDone;
|
Form.ActiveControl.EditingDone;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
if (Button in [mbLeft,mbRight]) and (DragObject<>nil) then begin
|
if (Button in [mbLeft, mbRight]) and (DragObject <> nil) then
|
||||||
P:=ClientToScreen(Point(X,Y));
|
begin
|
||||||
DragObject.MouseDown(Button,Shift,P.X,P.Y);
|
P := ClientToScreen(Point(X,Y));
|
||||||
|
DragObject.MouseDown(Button, Shift, P.X, P.Y);
|
||||||
end;
|
end;
|
||||||
if Assigned(FOnMouseDown) then FOnMouseDown(Self, Button, Shift, X,Y);
|
if Assigned(FOnMouseDown) then FOnMouseDown(Self, Button, Shift, X,Y);
|
||||||
end;
|
end;
|
||||||
@ -3175,17 +3178,17 @@ end;
|
|||||||
{------------------------------------------------------------------------------
|
{------------------------------------------------------------------------------
|
||||||
TControl MouseMove
|
TControl MouseMove
|
||||||
------------------------------------------------------------------------------}
|
------------------------------------------------------------------------------}
|
||||||
Procedure TControl.MouseMove(Shift: TShiftState; X, Y: Integer);
|
procedure TControl.MouseMove(Shift: TShiftState; X, Y: Integer);
|
||||||
var
|
var
|
||||||
P: TPoint;
|
P: TPoint;
|
||||||
DragObjectDragging : Boolean;
|
DragObjectDragging : Boolean;
|
||||||
begin
|
begin
|
||||||
if DragObject <> nil then
|
DragObjectDragging := DragObject <> nil;
|
||||||
DragObjectDragging := true else
|
|
||||||
DragObjectDragging := false;
|
if DragObjectDragging then
|
||||||
if DragObjectDragging then begin
|
begin
|
||||||
P:=ClientToScreen(Point(X,Y));
|
P := ClientToScreen(Point(X, Y));
|
||||||
DragObject.MouseMove(Shift,P.X,P.Y);
|
DragObject.MouseMove(Shift, P.X, P.Y);
|
||||||
end;
|
end;
|
||||||
if Assigned(FOnMouseMove) then FOnMouseMove(Self, Shift, X,Y);
|
if Assigned(FOnMouseMove) then FOnMouseMove(Self, Shift, X,Y);
|
||||||
end;
|
end;
|
||||||
@ -3193,18 +3196,18 @@ end;
|
|||||||
{------------------------------------------------------------------------------
|
{------------------------------------------------------------------------------
|
||||||
TControl MouseUp
|
TControl MouseUp
|
||||||
------------------------------------------------------------------------------}
|
------------------------------------------------------------------------------}
|
||||||
Procedure TControl.MouseUp(Button: TMouseButton; Shift:TShiftState;
|
procedure TControl.MouseUp(Button: TMouseButton; Shift:TShiftState;
|
||||||
X, Y: Integer);
|
X, Y: Integer);
|
||||||
var
|
var
|
||||||
P: TPoint;
|
P: TPoint;
|
||||||
DragObjectDragging : Boolean;
|
DragObjectDragging : Boolean;
|
||||||
begin
|
begin
|
||||||
if DragObject <> nil then
|
DragObjectDragging := DragObject <> nil;
|
||||||
DragObjectDragging := true else
|
|
||||||
DragObjectDragging := false;
|
if (Button in [mbLeft, mbRight]) and DragObjectDragging then
|
||||||
if (Button in [mbLeft,mbRight]) and DragObjectDragging then begin
|
begin
|
||||||
P:=ClientToScreen(Point(X,Y));
|
P := ClientToScreen(Point(X, Y));
|
||||||
DragObject.MouseUp(Button,Shift,P.X,P.Y);
|
DragObject.MouseUp(Button, Shift, P.X, P.Y);
|
||||||
end;
|
end;
|
||||||
if Assigned(FOnMouseUp) then FOnMouseUp(Self, Button, Shift, X,Y);
|
if Assigned(FOnMouseUp) then FOnMouseUp(Self, Button, Shift, X,Y);
|
||||||
end;
|
end;
|
||||||
|
@ -23,7 +23,7 @@ var
|
|||||||
DragThreshold: Integer;// treshold before the drag becomes activated
|
DragThreshold: Integer;// treshold before the drag becomes activated
|
||||||
DragImages: TDragImageList; // DragObject.GetDragImages
|
DragImages: TDragImageList; // DragObject.GetDragImages
|
||||||
|
|
||||||
Procedure DragTo(const Position: TPoint); forward;
|
procedure DragTo(const Position: TPoint); forward;
|
||||||
|
|
||||||
{-------------------------------------------------------------------------------
|
{-------------------------------------------------------------------------------
|
||||||
function HostDockSiteManagerAvailable(HostDockSite: TWinControl): boolean;
|
function HostDockSiteManagerAvailable(HostDockSite: TWinControl): boolean;
|
||||||
@ -132,7 +132,7 @@ end;
|
|||||||
it will be started when the user moves the mouse more than DragThreshold
|
it will be started when the user moves the mouse more than DragThreshold
|
||||||
pixel.
|
pixel.
|
||||||
-------------------------------------------------------------------------------}
|
-------------------------------------------------------------------------------}
|
||||||
Procedure DragInitControl(Control: TControl; Immediate: Boolean;
|
procedure DragInitControl(Control: TControl; Immediate: Boolean;
|
||||||
Threshold: Integer);
|
Threshold: Integer);
|
||||||
var
|
var
|
||||||
ok: boolean;
|
ok: boolean;
|
||||||
@ -237,12 +237,12 @@ end;
|
|||||||
|
|
||||||
|
|
||||||
-------------------------------------------------------------------------------}
|
-------------------------------------------------------------------------------}
|
||||||
Procedure DragTo(const Position: TPoint);
|
procedure DragTo(const Position: TPoint);
|
||||||
var
|
var
|
||||||
TargetControl: TControl;
|
TargetControl: TControl;
|
||||||
ADragCursor: TCursor;
|
ADragCursor: TCursor;
|
||||||
AAccepted: Boolean;
|
AAccepted: Boolean;
|
||||||
Begin
|
begin
|
||||||
{$IFDEF VerboseDrag}
|
{$IFDEF VerboseDrag}
|
||||||
DebugLn('DragTo P=', IntToStr(Position.X), ',', IntToStr(Position.Y));
|
DebugLn('DragTo P=', IntToStr(Position.X), ',', IntToStr(Position.Y));
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
@ -317,7 +317,7 @@ end;
|
|||||||
Frees the DragObject if autocreated by the LCL,
|
Frees the DragObject if autocreated by the LCL,
|
||||||
Finish: DragSave.Finished
|
Finish: DragSave.Finished
|
||||||
-------------------------------------------------------------------------------}
|
-------------------------------------------------------------------------------}
|
||||||
Procedure DragDone(Drop : Boolean);
|
procedure DragDone(Drop : Boolean);
|
||||||
var
|
var
|
||||||
Accepted: Boolean;
|
Accepted: Boolean;
|
||||||
OldDragObject: TDragObject;
|
OldDragObject: TDragObject;
|
||||||
@ -368,7 +368,7 @@ Begin
|
|||||||
|
|
||||||
// drop
|
// drop
|
||||||
if (OldDragObject<>nil) and (OldDragObject.DragTarget <> nil) then
|
if (OldDragObject<>nil) and (OldDragObject.DragTarget <> nil) then
|
||||||
Begin
|
begin
|
||||||
DragMsg := dmDragDrop;
|
DragMsg := dmDragDrop;
|
||||||
if not Accepted then begin
|
if not Accepted then begin
|
||||||
DragMsg := dmDragCancel;
|
DragMsg := dmDragCancel;
|
||||||
|
@ -152,7 +152,8 @@ end;
|
|||||||
function TDragControlObject.GetDragCursor(Accepted: Boolean; X, Y: Integer): TCursor;
|
function TDragControlObject.GetDragCursor(Accepted: Boolean; X, Y: Integer): TCursor;
|
||||||
begin
|
begin
|
||||||
if Accepted then
|
if Accepted then
|
||||||
Result := Control.DragCursor else
|
Result := Control.DragCursor
|
||||||
|
else
|
||||||
Result := crNoDrop;
|
Result := crNoDrop;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user