38
Classes, SysUtils, LCLProc, Forms, Controls, Graphics, Dialogs,
39
StdCtrls, Buttons, Spin,
40
IDECommands, PropEdits,
41
LazarusIDEStrConsts, EnvironmentOpts, IDEOptionDefs;
38
Classes, SysUtils, LCLProc, Forms, Controls, Dialogs, StdCtrls, Buttons, Spin,
39
IDECommands, PropEdits, LazarusIDEStrConsts, IDEOptionDefs;
136
134
procedure AnchorDesignerShow(Sender: TObject);
137
135
procedure AnchorEnabledCheckBoxChange(Sender: TObject);
138
136
procedure BorderSpaceSpinEditChange(Sender: TObject);
137
procedure FormDeactivate(Sender: TObject);
139
138
procedure SiblingComboBoxChange(Sender: TObject);
140
139
procedure ReferenceSideButtonClicked(Sender: TObject);
141
Values: TAnchorDesignerValues;
142
142
FSelection: TPersistentSelectionList;
143
143
FSelectedControlsList: TList;
144
144
FUpdating: Boolean;
146
procedure KeyUp(var Key: Word; Shift: TShiftState); override;
147
procedure FillComboBoxWithSiblings(AComboBox: TComboBox);
148
function AnchorDesignerNoSiblingText: string;
149
function AnchorDesignerNeighbourText(direction: TAnchorKind): string;
151
Values: TAnchorDesignerValues;
152
destructor Destroy; override;
153
145
procedure Refresh(Force: boolean);
154
146
procedure OnRefreshPropertyValues;
147
procedure OnSetSelection(const ASelection: TPersistentSelectionList);
155
148
function GetSelectedControls: TList;
156
149
function FindSibling(const Sibling: string): TControl;
157
class function ControlToStr(AControl: TControl): string;
150
procedure FillComboBoxWithSiblings(AComboBox: TComboBox);
151
function AnchorDesignerNoSiblingText: string;
152
function AnchorDesignerNeighbourText(direction: TAnchorKind): string;
158
153
procedure CollectValues(const ASelection: TList;
159
154
var TheValues: TAnchorDesignerValues;
160
155
var SelectedControlCount: integer);
161
procedure OnSetSelection(const ASelection: TPersistentSelectionList);
157
procedure KeyUp(var Key: Word; Shift: TShiftState); override;
159
destructor Destroy; override;
160
class function ControlToStr(AControl: TControl): string;
162
161
property Selection: TPersistentSelectionList read FSelection;
200
197
BottomAnchoredCheckBox.Hint:=Format(AnchorEnabledHint,['akBottom']);
201
198
BottomBorderSpaceSpinEdit.Hint:=lisBottomBorderSpaceSpinEditHint;
202
199
BottomGroupBox.Caption:=lisBottomGroupBoxCaption;
203
BottomRefBottomSpeedButton.Hint:=lisAnchorToBottomSideKeepBorderSpace;
200
BottomRefBottomSpeedButton.Hint:=lisAnchorBottomToBottomSide;
204
201
BottomRefCenterSpeedButton.Hint:=lisCenterControlVerticallyRelativeToSibling;
205
BottomRefTopSpeedButton.Hint:=lisAnchorToTopSideKeepBorderSpace;
202
BottomRefTopSpeedButton.Hint:=lisAnchorBottomToTopSide;
206
203
BottomSiblingComboBox.Hint:=lisBottomSiblingComboBoxHint;
207
204
BottomSiblingLabel.Caption:=lisSibling;
211
208
LeftBorderSpaceSpinEdit.Hint:=lisLeftBorderSpaceSpinEditHint;
212
209
LeftGroupBox.Caption:=lisLeftGroupBoxCaption;
213
210
LeftRefCenterSpeedButton.Hint:=lisCenterControlHorizontallyRelativeToSibling;
214
LeftRefLeftSpeedButton.Hint:=lisAnchorToLeftSideKeepBorderSpace;
215
LeftRefRightSpeedButton.Hint:=lisAnchorToRightSideKeepBorderSpace;
211
LeftRefLeftSpeedButton.Hint:=lisAnchorLeftToLeftSide;
212
LeftRefRightSpeedButton.Hint:=lisAnchorLeftToRightSide;
216
213
LeftSiblingComboBox.Hint:=lisLeftSiblingComboBoxHint;
217
214
LeftSiblingLabel.Caption:=lisSibling;
221
218
RightBorderSpaceSpinEdit.Hint:=lisRightBorderSpaceSpinEditHint;
222
219
RightGroupBox.Caption:=lisRightAnchoring;
223
220
RightRefCenterSpeedButton.Hint:=lisCenterControlHorizontallyRelativeToSibling;
224
RightRefLeftSpeedButton.Hint:=lisAnchorToLeftSideKeepBorderSpace;
225
RightRefRightSpeedButton.Hint:=lisAnchorToRightSideKeepBorderSpace;
221
RightRefLeftSpeedButton.Hint:=lisAnchorRightToLeftSide;
222
RightRefRightSpeedButton.Hint:=lisAnchorRightToRightSide;
226
223
RightSiblingComboBox.Hint:=lisRightSiblingComboBoxHint;
227
224
RightSiblingLabel.Caption:=lisSibling;
230
227
TopAnchoredCheckBox.Hint:=Format(AnchorEnabledHint,['akTop']);
231
228
TopBorderSpaceSpinEdit.Hint:=lisTopBorderSpaceSpinEditHint;
232
229
TopGroupBox.Caption:=lisTopAnchoring;
233
TopRefBottomSpeedButton.Hint:=lisAnchorToBottomSideKeepBorderSpace;
230
TopRefBottomSpeedButton.Hint:=lisAnchorTopToBottomSide;
234
231
TopRefCenterSpeedButton.Hint:=lisCenterControlVerticallyRelativeToSibling;
235
TopRefTopSpeedButton.Hint:= lisAnchorToTopSideKeepBorderSpace;
232
TopRefTopSpeedButton.Hint:= lisAnchorTopToTopSide;
236
233
TopSiblingComboBox.Hint:=lisTopSiblingComboBoxHint;
237
234
TopSiblingLabel.Caption:=lisSibling;
318
315
ReferenceControl,ReferenceSide,CheckPosition))
320
317
if MessageDlg(lisCCOWarningCaption,
321
lisThisWillCreateACircle, mtWarning, [mbIgnore, mbCancel], 0)<>
318
lisThisWillCreateACircularDependency, mtWarning, [mbIgnore, mbCancel], 0)<>
390
procedure TAnchorDesigner.FormDeactivate(Sender: TObject);
392
// commit changes made by keyboard
393
if (ActiveControl is TComboBox) then
394
SiblingComboBoxChange(ActiveControl);
393
397
function compareControlTop(Item1, Item2: pointer): Integer;
395
399
if tcontrol(item1).top<tcontrol(item2).top then result:=-1
538
542
ReferenceControl,ReferenceSide,CheckPosition))
540
544
if MessageDlg(lisCCOWarningCaption,
541
lisThisWillCreateACircle, mtWarning, [mbIgnore, mbCancel], 0)<>
545
lisThisWillCreateACircularDependency, mtWarning, [mbIgnore, mbCancel], 0)<>
649
653
ReferenceControl,ReferenceSide,CheckPosition))
651
655
if MessageDlg(lisCCOWarningCaption,
652
lisThisWillCreateACircle, mtWarning, [mbIgnore, mbCancel], 0)<>
656
lisThisWillCreateACircularDependency, mtWarning, [mbIgnore, mbCancel], 0)<>
1053
1055
CurSide: TAnchorSide;
1055
1057
FAmbiguousBorderSpace:=false;
1056
FBorderSpace:=AControl.BorderSpacing.GetSideSpace(FAnchorKind);
1058
FBorderSpace:=AControl.BorderSpacing.GetSpace(FAnchorKind);
1057
1059
FAmbiguousEnabled:=false;
1058
1060
FEnabled:=(FAnchorKind in AControl.Anchors);
1059
1061
CurSide:=AControl.AnchorSide[FAnchorKind];
1068
1070
CurSide: TAnchorSide;
1070
1072
FAmbiguousBorderSpace:=FAmbiguousBorderSpace
1071
or (FBorderSpace<>AControl.BorderSpacing.GetSideSpace(FAnchorKind));
1073
or (FBorderSpace<>AControl.BorderSpacing.GetSpace(FAnchorKind));
1072
1074
FAmbiguousEnabled:=FAmbiguousEnabled
1073
1075
or (FEnabled<>(FAnchorKind in AControl.Anchors));
1074
1076
CurSide:=AControl.AnchorSide[FAnchorKind];