mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-24 06:00:15 +02:00
lcl: ensure SnapOptions are streamed
This commit is contained in:
parent
b83838139d
commit
0b50d7cfc2
@ -426,6 +426,7 @@ type
|
|||||||
FDistance: integer;
|
FDistance: integer;
|
||||||
public
|
public
|
||||||
constructor Create;
|
constructor Create;
|
||||||
|
procedure AssignTo(Dest: TPersistent); override;
|
||||||
published
|
published
|
||||||
property SnapToMonitor: boolean read FSnapMonitor write FSnapMonitor default false;
|
property SnapToMonitor: boolean read FSnapMonitor write FSnapMonitor default false;
|
||||||
property SnapToForms: boolean read FSnapForms write FSnapForms default false;
|
property SnapToForms: boolean read FSnapForms write FSnapForms default false;
|
||||||
@ -609,6 +610,7 @@ type
|
|||||||
procedure SetScreenSnap(aValue: boolean);
|
procedure SetScreenSnap(aValue: boolean);
|
||||||
function GetSnapBuffer: integer;
|
function GetSnapBuffer: integer;
|
||||||
procedure SetSnapBuffer(aValue: integer);
|
procedure SetSnapBuffer(aValue: integer);
|
||||||
|
procedure SetSnapOptions(aValue: TWindowMagnetOptions);
|
||||||
protected
|
protected
|
||||||
procedure WMActivate(var Message : TLMActivate); message LM_ACTIVATE;
|
procedure WMActivate(var Message : TLMActivate); message LM_ACTIVATE;
|
||||||
procedure WMCloseQuery(var message: TLMessage); message LM_CLOSEQUERY;
|
procedure WMCloseQuery(var message: TLMessage); message LM_CLOSEQUERY;
|
||||||
@ -795,7 +797,7 @@ type
|
|||||||
property LastActiveControl: TWinControl read FLastActiveControl;
|
property LastActiveControl: TWinControl read FLastActiveControl;
|
||||||
property PopupMode: TPopupMode read FPopupMode write SetPopupMode default pmNone;
|
property PopupMode: TPopupMode read FPopupMode write SetPopupMode default pmNone;
|
||||||
property PopupParent: TCustomForm read FPopupParent write SetPopupParent;
|
property PopupParent: TCustomForm read FPopupParent write SetPopupParent;
|
||||||
property SnapOptions: TWindowMagnetOptions read FSnapOptions;
|
property SnapOptions: TWindowMagnetOptions read FSnapOptions write SetSnapOptions;
|
||||||
property ScreenSnap: boolean read GetScreenSnap write SetScreenSnap stored false;
|
property ScreenSnap: boolean read GetScreenSnap write SetScreenSnap stored false;
|
||||||
property SnapBuffer: integer read GetSnapBuffer write SetSnapBuffer stored false;
|
property SnapBuffer: integer read GetSnapBuffer write SetSnapBuffer stored false;
|
||||||
|
|
||||||
|
@ -21,6 +21,17 @@ begin
|
|||||||
FDistance:= 10;
|
FDistance:= 10;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TWindowMagnetOptions.AssignTo(Dest: TPersistent);
|
||||||
|
begin
|
||||||
|
if Dest is TWindowMagnetOptions then
|
||||||
|
with TWindowMagnetOptions(Dest) do begin
|
||||||
|
Distance:= Self.Distance;
|
||||||
|
SnapToMonitor:= Self.SnapToMonitor;
|
||||||
|
SnapToForms:= Self.SnapToForms;
|
||||||
|
SnapFormTarget:= Self.SnapFormTarget;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
{ TWindowMagnetManager }
|
{ TWindowMagnetManager }
|
||||||
|
|
||||||
function PosToRect(wp: TWindowPos): TRect;
|
function PosToRect(wp: TWindowPos): TRect;
|
||||||
@ -220,6 +231,12 @@ begin
|
|||||||
FSnapOptions.Distance:= aValue;
|
FSnapOptions.Distance:= aValue;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TCustomForm.SetSnapOptions(aValue: TWindowMagnetOptions);
|
||||||
|
begin
|
||||||
|
if FSnapOptions=aValue then Exit;
|
||||||
|
FSnapOptions.Assign(aValue);
|
||||||
|
end;
|
||||||
|
|
||||||
procedure TCustomForm.WMWindowPosChanging(var Message: TLMWindowPosChanging);
|
procedure TCustomForm.WMWindowPosChanging(var Message: TLMWindowPosChanging);
|
||||||
begin
|
begin
|
||||||
Screen.MagnetManager.SnapForm(Self, Message.WindowPos^);
|
Screen.MagnetManager.SnapForm(Self, Message.WindowPos^);
|
||||||
|
Loading…
Reference in New Issue
Block a user