mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-11 16:56:01 +02:00
DockedFormEditor: Option AllowSizing added
git-svn-id: trunk@64606 -
This commit is contained in:
parent
ac3fae6d99
commit
ae5a9b54d1
@ -12,6 +12,8 @@ resourceString
|
||||
SCode = 'Code';
|
||||
SDesigner = 'Form';
|
||||
SAnchors = 'Anchors';
|
||||
SAllowSizingCaption = 'Allow size changing';
|
||||
SAllowSizingHint = 'Grips can change size in Anchor Editor';
|
||||
SAnchorControlBorderCaption = 'Border Around Control';
|
||||
SAnchorControlColorCaption = 'Control Background';
|
||||
SAnchorTabVisibleCaption = 'Show Anchors Tab';
|
||||
|
@ -12,6 +12,14 @@ msgstr ""
|
||||
"X-Poedit-SourceCharset: utf-8\n"
|
||||
"X-Generator: Poedit 1.8.6\n"
|
||||
|
||||
#: dockedstrconsts.sallowsizingcaption
|
||||
msgid "Allow size changing"
|
||||
msgstr ""
|
||||
|
||||
#: dockedstrconsts.sallowsizinghint
|
||||
msgid "Grips can change size in Anchor Editor"
|
||||
msgstr ""
|
||||
|
||||
#: dockedstrconsts.sanchorbottomcolorcaption
|
||||
msgid "Bottom Anchor"
|
||||
msgstr ""
|
||||
|
@ -11,6 +11,14 @@ msgstr ""
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"X-Generator: Poedit 1.5.4\n"
|
||||
|
||||
#: dockedstrconsts.sallowsizingcaption
|
||||
msgid "Allow size changing"
|
||||
msgstr ""
|
||||
|
||||
#: dockedstrconsts.sallowsizinghint
|
||||
msgid "Grips can change size in Anchor Editor"
|
||||
msgstr ""
|
||||
|
||||
#: dockedstrconsts.sanchorbottomcolorcaption
|
||||
msgid "Bottom Anchor"
|
||||
msgstr ""
|
||||
|
@ -12,6 +12,14 @@ msgstr ""
|
||||
"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && (n%100<10 || n%100>=20) ? 1 : 2);\n"
|
||||
"X-Generator: Lokalize 2.0\n"
|
||||
|
||||
#: dockedstrconsts.sallowsizingcaption
|
||||
msgid "Allow size changing"
|
||||
msgstr ""
|
||||
|
||||
#: dockedstrconsts.sallowsizinghint
|
||||
msgid "Grips can change size in Anchor Editor"
|
||||
msgstr ""
|
||||
|
||||
#: dockedstrconsts.sanchorbottomcolorcaption
|
||||
msgid "Bottom Anchor"
|
||||
msgstr ""
|
||||
|
@ -1,6 +1,14 @@
|
||||
msgid ""
|
||||
msgstr "Content-Type: text/plain; charset=UTF-8"
|
||||
|
||||
#: dockedstrconsts.sallowsizingcaption
|
||||
msgid "Allow size changing"
|
||||
msgstr ""
|
||||
|
||||
#: dockedstrconsts.sallowsizinghint
|
||||
msgid "Grips can change size in Anchor Editor"
|
||||
msgstr ""
|
||||
|
||||
#: dockedstrconsts.sanchorbottomcolorcaption
|
||||
msgid "Bottom Anchor"
|
||||
msgstr ""
|
||||
|
@ -11,6 +11,14 @@ msgstr ""
|
||||
"Language: pt_BR\n"
|
||||
"X-Generator: Poedit 1.8.13\n"
|
||||
|
||||
#: dockedstrconsts.sallowsizingcaption
|
||||
msgid "Allow size changing"
|
||||
msgstr ""
|
||||
|
||||
#: dockedstrconsts.sallowsizinghint
|
||||
msgid "Grips can change size in Anchor Editor"
|
||||
msgstr ""
|
||||
|
||||
#: dockedstrconsts.sanchorbottomcolorcaption
|
||||
msgid "Bottom Anchor"
|
||||
msgstr ""
|
||||
|
@ -11,6 +11,14 @@ msgstr ""
|
||||
"Language: ru\n"
|
||||
"X-Generator: Poedit 2.2.1\n"
|
||||
|
||||
#: dockedstrconsts.sallowsizingcaption
|
||||
msgid "Allow size changing"
|
||||
msgstr ""
|
||||
|
||||
#: dockedstrconsts.sallowsizinghint
|
||||
msgid "Grips can change size in Anchor Editor"
|
||||
msgstr ""
|
||||
|
||||
#: dockedstrconsts.sanchorbottomcolorcaption
|
||||
msgid "Bottom Anchor"
|
||||
msgstr "Нижняя привязка"
|
||||
|
@ -11,6 +11,14 @@ msgstr ""
|
||||
"Language: tr\n"
|
||||
"X-Generator: Poedit 2.2.3\n"
|
||||
|
||||
#: dockedstrconsts.sallowsizingcaption
|
||||
msgid "Allow size changing"
|
||||
msgstr ""
|
||||
|
||||
#: dockedstrconsts.sallowsizinghint
|
||||
msgid "Grips can change size in Anchor Editor"
|
||||
msgstr ""
|
||||
|
||||
#: dockedstrconsts.sanchorbottomcolorcaption
|
||||
msgid "Bottom Anchor"
|
||||
msgstr ""
|
||||
|
@ -11,6 +11,14 @@ msgstr ""
|
||||
"Language: ru\n"
|
||||
"X-Generator: Poedit 1.7.7\n"
|
||||
|
||||
#: dockedstrconsts.sallowsizingcaption
|
||||
msgid "Allow size changing"
|
||||
msgstr ""
|
||||
|
||||
#: dockedstrconsts.sallowsizinghint
|
||||
msgid "Grips can change size in Anchor Editor"
|
||||
msgstr ""
|
||||
|
||||
#: dockedstrconsts.sanchorbottomcolorcaption
|
||||
msgid "Bottom Anchor"
|
||||
msgstr ""
|
||||
|
@ -12,6 +12,14 @@ msgstr ""
|
||||
"X-Generator: Poedit 1.8.7.1\n"
|
||||
"X-Poedit-SourceCharset: UTF-8\n"
|
||||
|
||||
#: dockedstrconsts.sallowsizingcaption
|
||||
msgid "Allow size changing"
|
||||
msgstr ""
|
||||
|
||||
#: dockedstrconsts.sallowsizinghint
|
||||
msgid "Grips can change size in Anchor Editor"
|
||||
msgstr ""
|
||||
|
||||
#: dockedstrconsts.sanchorbottomcolorcaption
|
||||
msgid "Bottom Anchor"
|
||||
msgstr ""
|
||||
|
@ -73,9 +73,8 @@ type
|
||||
procedure PopupMenuAdapt(Sender: TObject);
|
||||
procedure SelectedAdaptAnchors;
|
||||
procedure SelectedAdaptBorder;
|
||||
procedure SelectedAdaptBounds(RemoveAnchorSides: Boolean);
|
||||
procedure SelectedAdaptBounds;
|
||||
procedure SelectedAnchorNewTarget(AKind: TAnchorKind);
|
||||
procedure SetParent(AValue: TWinControl); override;
|
||||
procedure SetSelectedControl(AValue: TAnchorControl);
|
||||
public
|
||||
constructor Create(ADesignForm: TDesignForm; AParent: TWinControl);
|
||||
@ -85,6 +84,7 @@ type
|
||||
procedure EndUpdate; override;
|
||||
procedure Invalidate; override;
|
||||
procedure Refresh; override;
|
||||
procedure SetParent(AValue: TWinControl); override;
|
||||
public
|
||||
property SelectedControl: TAnchorControl read FSelectedControl write SetSelectedControl;
|
||||
property State: TAnchorStates read FState write FState;
|
||||
@ -139,6 +139,8 @@ end;
|
||||
|
||||
procedure TAnchorDesigner.AnchorControlMouseMove(Sender: TObject;
|
||||
Shift: TShiftState; X, Y: Integer);
|
||||
var
|
||||
LAllowMoving: Boolean;
|
||||
begin
|
||||
if not State.IsMouseDown then Exit;
|
||||
if not (Shift = [ssLeft]) and not (Shift = [ssCtrl, ssLeft]) then Exit;
|
||||
@ -154,15 +156,22 @@ begin
|
||||
if not State.IsBordering then
|
||||
begin
|
||||
FBackGround.Invalidate;
|
||||
FState := FState + [asAnchorTop, asAnchorLeft, asAnchorRight, asAnchorBottom];
|
||||
if (akTop in FPreviousControl.Anchors) and Assigned(FPreviousControl.AnchorSide[akTop].Control) then
|
||||
FState := FState - [asAnchorTop];
|
||||
if (akLeft in FPreviousControl.Anchors) and Assigned(FPreviousControl.AnchorSide[akLeft].Control) then
|
||||
FState := FState - [asAnchorLeft];
|
||||
if (akRight in FPreviousControl.Anchors) and Assigned(FPreviousControl.AnchorSide[akRight].Control) then
|
||||
FState := FState - [asAnchorRight];
|
||||
if (akBottom in FPreviousControl.Anchors) and Assigned(FPreviousControl.AnchorSide[akBottom].Control) then
|
||||
FState := FState - [asAnchorBottom];
|
||||
if DockedOptions.AllowSizing then
|
||||
FState := FState + [asAnchorTop, asAnchorLeft, asAnchorRight, asAnchorBottom]
|
||||
else
|
||||
begin
|
||||
LAllowMoving := True;
|
||||
if (akTop in FPreviousControl.Anchors) and Assigned(FPreviousControl.AnchorSide[akTop].Control) then
|
||||
LAllowMoving := False;
|
||||
if (akLeft in FPreviousControl.Anchors) and Assigned(FPreviousControl.AnchorSide[akLeft].Control) then
|
||||
LAllowMoving := False;
|
||||
if (akRight in FPreviousControl.Anchors) and Assigned(FPreviousControl.AnchorSide[akRight].Control) then
|
||||
LAllowMoving := False;
|
||||
if (akBottom in FPreviousControl.Anchors) and Assigned(FPreviousControl.AnchorSide[akBottom].Control) then
|
||||
LAllowMoving := False;
|
||||
if LAllowMoving then
|
||||
FState := FState + [asAnchorTop, asAnchorLeft, asAnchorRight, asAnchorBottom]
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
||||
@ -172,7 +181,7 @@ begin
|
||||
SelectedAdaptBorder;
|
||||
end else begin
|
||||
// sizing
|
||||
SelectedAdaptBounds(False);
|
||||
SelectedAdaptBounds;
|
||||
end;
|
||||
AdjustGrips;
|
||||
end;
|
||||
@ -294,8 +303,7 @@ begin
|
||||
FTargetControl.Color := DockedOptions.AnchorTargetColor;
|
||||
end else begin
|
||||
// size control
|
||||
SelectedAdaptBounds(True);
|
||||
FState := [asMouseDown, asMoving];
|
||||
SelectedAdaptBounds;
|
||||
FTargetControl.Color := DockedOptions.AnchorControlColor;
|
||||
FTargetControl := nil;
|
||||
end;
|
||||
@ -317,6 +325,23 @@ begin
|
||||
Abort;
|
||||
Exit;
|
||||
end;
|
||||
if not DockedOptions.AllowSizing then
|
||||
begin
|
||||
if State.IsAnchoringLeft and (FSelectedControl.AnchorSide[akLeft].Control = nil) then
|
||||
begin
|
||||
FSelectedControl.Left := FPreviousControl.Left;
|
||||
FSelectedControl.Width := FPreviousControl.Width;
|
||||
end;
|
||||
if State.IsAnchoringRight and (FSelectedControl.AnchorSide[akRight].Control = nil) then
|
||||
FSelectedControl.Width := FPreviousControl.Width;
|
||||
if State.IsAnchoringTop and (FSelectedControl.AnchorSide[akTop].Control = nil) then
|
||||
begin
|
||||
FSelectedControl.Height := FPreviousControl.Height;
|
||||
FSelectedControl.Top := FPreviousControl.Top;
|
||||
end;
|
||||
if State.IsAnchoringBottom and (FSelectedControl.AnchorSide[akBottom].Control = nil) then
|
||||
FSelectedControl.Height := FPreviousControl.Height;
|
||||
end;
|
||||
FSelectedControl.AssignToRoot_Anchors;
|
||||
FSelectedControl.AssignToRoot_ControlsBounds(True);
|
||||
|
||||
@ -773,7 +798,7 @@ begin
|
||||
FSelectedControl.BorderSpacing.Bottom := Max(0, LBottomBorder);
|
||||
end;
|
||||
|
||||
procedure TAnchorDesigner.SelectedAdaptBounds(RemoveAnchorSides: Boolean);
|
||||
procedure TAnchorDesigner.SelectedAdaptBounds;
|
||||
var
|
||||
LMouseOffset: TPoint;
|
||||
LRect: TRect;
|
||||
@ -783,36 +808,28 @@ begin
|
||||
|
||||
if State.IsAnchoringLeft then
|
||||
begin
|
||||
FSelectedControl.RemoveAnchorSide(akLeft);
|
||||
LRect.Left := LRect.Left + LMouseOffset.x;
|
||||
if RemoveAnchorSides then
|
||||
FSelectedControl.RemoveAnchorSide(akLeft);
|
||||
end else
|
||||
if RemoveAnchorSides then
|
||||
FSelectedControl.AssignAnchor(FPreviousControl, akLeft);
|
||||
FSelectedControl.AssignAnchor(FPreviousControl, akLeft);
|
||||
if State.IsAnchoringRight then
|
||||
begin
|
||||
FSelectedControl.RemoveAnchorSide(akRight);
|
||||
LRect.Right := LRect.Right + LMouseOffset.x;
|
||||
if RemoveAnchorSides then
|
||||
FSelectedControl.RemoveAnchorSide(akRight);
|
||||
end else
|
||||
if RemoveAnchorSides then
|
||||
FSelectedControl.AssignAnchor(FPreviousControl, akRight);
|
||||
FSelectedControl.AssignAnchor(FPreviousControl, akRight);
|
||||
if State.IsAnchoringTop then
|
||||
begin
|
||||
FSelectedControl.RemoveAnchorSide(akTop);
|
||||
LRect.Top := LRect.Top + LMouseOffset.y;
|
||||
if RemoveAnchorSides then
|
||||
FSelectedControl.RemoveAnchorSide(akTop);
|
||||
end else
|
||||
if RemoveAnchorSides then
|
||||
FSelectedControl.AssignAnchor(FPreviousControl, akTop);
|
||||
FSelectedControl.AssignAnchor(FPreviousControl, akTop);
|
||||
if State.IsAnchoringBottom then
|
||||
begin
|
||||
FSelectedControl.RemoveAnchorSide(akBottom);
|
||||
LRect.Bottom := LRect.Bottom + LMouseOffset.y;
|
||||
if RemoveAnchorSides then
|
||||
FSelectedControl.RemoveAnchorSide(akBottom);
|
||||
end else
|
||||
if RemoveAnchorSides then
|
||||
FSelectedControl.AssignAnchor(FPreviousControl, akBottom);
|
||||
FSelectedControl.AssignAnchor(FPreviousControl, akBottom);
|
||||
|
||||
if FSelectedControl.RootControl.Constraints.MaxWidth > 0 then
|
||||
LRect.Width := Min(LRect.Width, FSelectedControl.RootControl.Constraints.MaxWidth);
|
||||
@ -836,13 +853,6 @@ begin
|
||||
FSelectedControl.Anchors := FSelectedControl.Anchors + [AKind];
|
||||
end;
|
||||
|
||||
procedure TAnchorDesigner.SetParent(AValue: TWinControl);
|
||||
begin
|
||||
inherited SetParent(AValue);
|
||||
if Assigned(FBackGround) then
|
||||
FBackGround.Parent := Parent;
|
||||
end;
|
||||
|
||||
procedure TAnchorDesigner.SetSelectedControl(AValue: TAnchorControl);
|
||||
begin
|
||||
if FSelectedControl = AValue then Exit;
|
||||
@ -936,5 +946,12 @@ begin
|
||||
Invalidate;
|
||||
end;
|
||||
|
||||
procedure TAnchorDesigner.SetParent(AValue: TWinControl);
|
||||
begin
|
||||
inherited SetParent(AValue);
|
||||
if Assigned(FBackGround) then
|
||||
FBackGround.Parent := Parent;
|
||||
end;
|
||||
|
||||
end.
|
||||
|
||||
|
@ -12,9 +12,9 @@ object FrameDockedOptions: TFrameDockedOptions
|
||||
AnchorSideLeft.Control = Owner
|
||||
AnchorSideTop.Control = Owner
|
||||
Left = 6
|
||||
Height = 15
|
||||
Height = 13
|
||||
Top = 0
|
||||
Width = 66
|
||||
Width = 58
|
||||
BorderSpacing.Left = 6
|
||||
Caption = 'Tab Position'
|
||||
ParentColor = False
|
||||
@ -26,12 +26,12 @@ object FrameDockedOptions: TFrameDockedOptions
|
||||
AnchorSideRight.Control = Owner
|
||||
AnchorSideRight.Side = asrBottom
|
||||
Left = 6
|
||||
Height = 23
|
||||
Top = 15
|
||||
Height = 21
|
||||
Top = 13
|
||||
Width = 559
|
||||
Anchors = [akTop, akLeft, akRight]
|
||||
BorderSpacing.Right = 6
|
||||
ItemHeight = 15
|
||||
ItemHeight = 13
|
||||
ParentShowHint = False
|
||||
ReadOnly = True
|
||||
ShowHint = True
|
||||
@ -43,9 +43,9 @@ object FrameDockedOptions: TFrameDockedOptions
|
||||
AnchorSideTop.Control = ComboBoxTabPosition
|
||||
AnchorSideTop.Side = asrBottom
|
||||
Left = 6
|
||||
Height = 15
|
||||
Top = 44
|
||||
Width = 68
|
||||
Height = 13
|
||||
Top = 40
|
||||
Width = 63
|
||||
BorderSpacing.Top = 6
|
||||
Caption = 'Resizer Color'
|
||||
ParentColor = False
|
||||
@ -58,7 +58,7 @@ object FrameDockedOptions: TFrameDockedOptions
|
||||
AnchorSideRight.Side = asrBottom
|
||||
Left = 6
|
||||
Height = 22
|
||||
Top = 59
|
||||
Top = 53
|
||||
Width = 559
|
||||
Style = [cbStandardColors, cbExtendedColors, cbSystemColors, cbIncludeDefault, cbCustomColor]
|
||||
Anchors = [akTop, akLeft, akRight]
|
||||
@ -74,8 +74,8 @@ object FrameDockedOptions: TFrameDockedOptions
|
||||
AnchorSideRight.Control = ComboBoxTabPosition
|
||||
AnchorSideRight.Side = asrBottom
|
||||
Left = 6
|
||||
Height = 15
|
||||
Top = 112
|
||||
Height = 13
|
||||
Top = 104
|
||||
Width = 559
|
||||
Caption = 'Anchors'
|
||||
Anchors = [akTop, akLeft, akRight]
|
||||
@ -88,9 +88,9 @@ object FrameDockedOptions: TFrameDockedOptions
|
||||
AnchorSideTop.Control = DividerBevelAnchors
|
||||
AnchorSideTop.Side = asrBottom
|
||||
Left = 6
|
||||
Height = 19
|
||||
Top = 133
|
||||
Width = 119
|
||||
Height = 17
|
||||
Top = 123
|
||||
Width = 109
|
||||
BorderSpacing.Top = 6
|
||||
Caption = 'Show Anchors Tab'
|
||||
OnChange = CheckBoxAnchorTabVisibleChange
|
||||
@ -103,9 +103,9 @@ object FrameDockedOptions: TFrameDockedOptions
|
||||
AnchorSideTop.Control = CheckBoxAnchorTabVisible
|
||||
AnchorSideTop.Side = asrBottom
|
||||
Left = 6
|
||||
Height = 15
|
||||
Top = 158
|
||||
Width = 90
|
||||
Height = 13
|
||||
Top = 146
|
||||
Width = 83
|
||||
BorderSpacing.Top = 6
|
||||
Caption = 'Capture Distance'
|
||||
ParentColor = False
|
||||
@ -117,8 +117,8 @@ object FrameDockedOptions: TFrameDockedOptions
|
||||
AnchorSideRight.Control = ComboBoxTabPosition
|
||||
AnchorSideRight.Side = asrBottom
|
||||
Left = 6
|
||||
Height = 23
|
||||
Top = 173
|
||||
Height = 21
|
||||
Top = 159
|
||||
Width = 559
|
||||
Anchors = [akTop, akLeft, akRight]
|
||||
ParentShowHint = False
|
||||
@ -130,9 +130,9 @@ object FrameDockedOptions: TFrameDockedOptions
|
||||
AnchorSideTop.Control = SpinEditCaptureDistance
|
||||
AnchorSideTop.Side = asrBottom
|
||||
Left = 6
|
||||
Height = 15
|
||||
Top = 202
|
||||
Width = 127
|
||||
Height = 13
|
||||
Top = 186
|
||||
Width = 114
|
||||
BorderSpacing.Top = 6
|
||||
Caption = 'Mouse Bordering Factor'
|
||||
ParentColor = False
|
||||
@ -144,8 +144,8 @@ object FrameDockedOptions: TFrameDockedOptions
|
||||
AnchorSideRight.Control = ComboBoxTabPosition
|
||||
AnchorSideRight.Side = asrBottom
|
||||
Left = 6
|
||||
Height = 23
|
||||
Top = 217
|
||||
Height = 21
|
||||
Top = 199
|
||||
Width = 559
|
||||
Anchors = [akTop, akLeft, akRight]
|
||||
MaxValue = 10
|
||||
@ -160,9 +160,9 @@ object FrameDockedOptions: TFrameDockedOptions
|
||||
AnchorSideTop.Control = SpinEditMouseBorderFactor
|
||||
AnchorSideTop.Side = asrBottom
|
||||
Left = 6
|
||||
Height = 19
|
||||
Top = 246
|
||||
Width = 142
|
||||
Height = 17
|
||||
Top = 226
|
||||
Width = 128
|
||||
BorderSpacing.Top = 6
|
||||
Caption = 'Automatic Treat Aligns'
|
||||
ParentShowHint = False
|
||||
@ -171,12 +171,12 @@ object FrameDockedOptions: TFrameDockedOptions
|
||||
end
|
||||
object LabelColors: TLabel
|
||||
AnchorSideLeft.Control = LabelTabPosition
|
||||
AnchorSideTop.Control = CheckBoxTreatBorder
|
||||
AnchorSideTop.Control = CheckBoxAllowSizing
|
||||
AnchorSideTop.Side = asrBottom
|
||||
Left = 6
|
||||
Height = 15
|
||||
Top = 296
|
||||
Width = 34
|
||||
Height = 13
|
||||
Top = 295
|
||||
Width = 30
|
||||
BorderSpacing.Top = 6
|
||||
Caption = 'Colors'
|
||||
ParentColor = False
|
||||
@ -186,9 +186,9 @@ object FrameDockedOptions: TFrameDockedOptions
|
||||
AnchorSideTop.Control = ColorBoxResizer
|
||||
AnchorSideTop.Side = asrBottom
|
||||
Left = 6
|
||||
Height = 19
|
||||
Top = 87
|
||||
Width = 157
|
||||
Height = 17
|
||||
Top = 81
|
||||
Width = 146
|
||||
BorderSpacing.Top = 6
|
||||
Caption = 'Force Refreshing At Sizing'
|
||||
OnChange = CheckBoxAnchorTabVisibleChange
|
||||
@ -205,7 +205,7 @@ object FrameDockedOptions: TFrameDockedOptions
|
||||
AnchorSideBottom.Side = asrBottom
|
||||
Left = 6
|
||||
Height = 26
|
||||
Top = 456
|
||||
Top = 430
|
||||
Width = 559
|
||||
Style = [cbStandardColors, cbExtendedColors, cbSystemColors, cbIncludeNone, cbIncludeDefault, cbCustomColor, cbPrettyNames, cbCustomColors]
|
||||
Anchors = [akTop, akLeft, akRight]
|
||||
@ -222,7 +222,7 @@ object FrameDockedOptions: TFrameDockedOptions
|
||||
AnchorSideRight.Side = asrBottom
|
||||
Left = 6
|
||||
Height = 143
|
||||
Top = 311
|
||||
Top = 308
|
||||
Width = 559
|
||||
Style = [cbCustomColors]
|
||||
OnGetColors = AnchorsColorListBoxGetColors
|
||||
@ -236,13 +236,27 @@ object FrameDockedOptions: TFrameDockedOptions
|
||||
AnchorSideTop.Control = CheckBoxTreatAlign
|
||||
AnchorSideTop.Side = asrBottom
|
||||
Left = 6
|
||||
Height = 19
|
||||
Top = 271
|
||||
Width = 187
|
||||
Height = 17
|
||||
Top = 249
|
||||
Width = 170
|
||||
BorderSpacing.Top = 6
|
||||
Caption = 'Automatic Treat Around Border'
|
||||
ParentShowHint = False
|
||||
ShowHint = True
|
||||
TabOrder = 9
|
||||
end
|
||||
object CheckBoxAllowSizing: TCheckBox
|
||||
AnchorSideLeft.Control = LabelTabPosition
|
||||
AnchorSideTop.Control = CheckBoxTreatBorder
|
||||
AnchorSideTop.Side = asrBottom
|
||||
Left = 6
|
||||
Height = 17
|
||||
Top = 272
|
||||
Width = 170
|
||||
BorderSpacing.Top = 6
|
||||
Caption = 'Allow Sizing'
|
||||
ParentShowHint = False
|
||||
ShowHint = True
|
||||
TabOrder = 10
|
||||
end
|
||||
end
|
||||
|
@ -33,6 +33,7 @@ type
|
||||
CheckBoxForceRefreshing: TCheckBox;
|
||||
CheckBoxTreatAlign: TCheckBox;
|
||||
CheckBoxTreatBorder: TCheckBox;
|
||||
CheckBoxAllowSizing: TCheckBox;
|
||||
ColorBoxResizer: TColorBox;
|
||||
ComboBoxTabPosition: TComboBox;
|
||||
DividerBevelAnchors: TDividerBevel;
|
||||
@ -50,6 +51,7 @@ type
|
||||
procedure AnchorsColorListBoxGetColors(Sender: TCustomColorListBox; Items: TStrings);
|
||||
procedure AnchorsColorListBoxSelectionChange(Sender: TObject; User: Boolean);
|
||||
private
|
||||
FLastAllowSizing: Boolean;
|
||||
FLastAnchorBorderColor: TColor;
|
||||
FLastAnchorControlColor: TColor;
|
||||
FLastAnchorTabsVisible: Boolean;
|
||||
@ -83,6 +85,7 @@ implementation
|
||||
|
||||
procedure TFrameDockedOptions.CheckBoxAnchorTabVisibleChange(Sender: TObject);
|
||||
begin
|
||||
CheckBoxAllowSizing.Enabled := CheckBoxAnchorTabVisible.Checked;
|
||||
CheckBoxTreatAlign.Enabled := CheckBoxAnchorTabVisible.Checked;
|
||||
CheckBoxTreatBorder.Enabled := CheckBoxAnchorTabVisible.Checked;
|
||||
LabelColors.Enabled := CheckBoxAnchorTabVisible.Checked;
|
||||
@ -130,6 +133,7 @@ begin
|
||||
for ATabPosition := Low(TTabPosition) to High(TTabPosition) do
|
||||
ComboBoxTabPosition.Items.Add(STabPosition[ATabPosition]);
|
||||
|
||||
CheckBoxAllowSizing.Caption := SAllowSizingCaption;
|
||||
CheckBoxAnchorTabVisible.Caption := SAnchorTabVisibleCaption;
|
||||
CheckBoxForceRefreshing.Caption := SForceRefreshingCaption;
|
||||
CheckBoxTreatAlign.Caption := STreatAlignCaption;
|
||||
@ -141,6 +145,7 @@ begin
|
||||
LabelCaptureDistance.Caption := SCaptureDistanceCaption;
|
||||
LabelMouseBorderFactor.Caption := SMouseBorderFactorCaption;
|
||||
|
||||
CheckBoxAllowSizing.Hint := SAllowSizingHint;
|
||||
CheckBoxAnchorTabVisible.Hint := SAnchorTabVisibleHint;
|
||||
CheckBoxTreatAlign.Hint := STreatAlignHint;
|
||||
CheckBoxTreatBorder.Hint := StreatBorderHint;
|
||||
@ -153,6 +158,7 @@ end;
|
||||
|
||||
procedure TFrameDockedOptions.ReadSettings(AOptions: TAbstractIDEOptions);
|
||||
begin
|
||||
FLastAllowSizing := DockedOptions.AllowSizing;
|
||||
FLastAnchorBorderColor := DockedOptions.AnchorBorderColor;
|
||||
FLastAnchorControlColor := DockedOptions.AnchorControlColor;
|
||||
FLastAnchorTabsVisible := DockedOptions.AnchorTabVisible;
|
||||
@ -174,6 +180,7 @@ end;
|
||||
|
||||
procedure TFrameDockedOptions.WriteSettings(AOptions: TAbstractIDEOptions);
|
||||
begin
|
||||
DockedOptions.AllowSizing := CheckBoxAllowSizing.Checked;
|
||||
DockedOptions.AnchorBorderColor := AnchorsColorListBox.Colors[ord(acControlBorder)];
|
||||
DockedOptions.AnchorControlColor := AnchorsColorListBox.Colors[ord(acControl)];
|
||||
DockedOptions.AnchorTopColor := AnchorsColorListBox.Colors[ord(acAnchorTop)];
|
||||
@ -209,6 +216,7 @@ begin
|
||||
AnchorsColorListBox.Colors[ord(acAnchorTarget)] := DockedOptions.AnchorTargetColor;
|
||||
CheckBoxAnchorTabVisible.Checked := FLastAnchorTabsVisible;
|
||||
CheckBoxAnchorTabVisible.OnChange(nil);
|
||||
CheckBoxAllowSizing.Checked := FLastAllowSizing;
|
||||
CheckBoxForceRefreshing.Checked := FLastForceRefreshing;
|
||||
CheckBoxTreatAlign.Checked := FLastTreatAlign;
|
||||
CheckBoxTreatBorder.Checked := FLastTreatBorder;
|
||||
|
@ -58,6 +58,7 @@ type
|
||||
DefaultAnchorBottomColor = $FFAA00;
|
||||
DefaultResizerColor = $AAFFAA;
|
||||
private
|
||||
FAllowSizing: Boolean;
|
||||
FAnchorBorderColor: TColor;
|
||||
FAnchorBottomColor: TColor;
|
||||
FAnchorControlColor: TColor;
|
||||
@ -76,6 +77,7 @@ type
|
||||
FTreatAlign: Boolean;
|
||||
FTreatBorder: Boolean;
|
||||
function GetModified: Boolean;
|
||||
procedure SetAllowSizing(AValue: Boolean);
|
||||
procedure SetAnchorBorderColor(AValue: TColor);
|
||||
procedure SetAnchorBottomColor(AValue: TColor);
|
||||
procedure SetAnchorControlColor(AValue: TColor);
|
||||
@ -103,6 +105,7 @@ type
|
||||
property ChangeStamp: Integer read FChangeStamp;
|
||||
property Modified: Boolean read GetModified write SetModified;
|
||||
|
||||
property AllowSizing: Boolean read FAllowSizing write SetAllowSizing;
|
||||
property AnchorBorderColor: TColor read FAnchorBorderColor write SetAnchorBorderColor;
|
||||
property AnchorControlColor: TColor read FAnchorControlColor write SetAnchorControlColor;
|
||||
property AnchorTabVisible: Boolean read FAnchorTabVisible write SetAnchorTabVisible;
|
||||
@ -136,6 +139,13 @@ begin
|
||||
Result := FLastSavedChangeStamp <> FChangeStamp;
|
||||
end;
|
||||
|
||||
procedure TDockedOptions.SetAllowSizing(AValue: Boolean);
|
||||
begin
|
||||
if FAllowSizing = AValue then Exit;
|
||||
FAllowSizing := AValue;
|
||||
IncreaseChangeStamp;
|
||||
end;
|
||||
|
||||
procedure TDockedOptions.SetAnchorBorderColor(AValue: TColor);
|
||||
begin
|
||||
if FAnchorBorderColor = AValue then Exit;
|
||||
@ -251,6 +261,7 @@ end;
|
||||
|
||||
constructor TDockedOptions.Create;
|
||||
begin
|
||||
FAllowSizing := False;
|
||||
FAnchorBorderColor := DefaultAnchorBorderColor;
|
||||
FAnchorControlColor := DefaultAnchorControlColor;
|
||||
FAnchorTabVisible := True;
|
||||
@ -296,6 +307,7 @@ var
|
||||
begin
|
||||
Cfg := GetIDEConfigStorage(AFilename, False);
|
||||
try
|
||||
Cfg.SetDeleteValue('AllowSizing/Value', AllowSizing, False);
|
||||
Cfg.SetDeleteValue('AnchorBorderColor/Value', AnchorBorderColor, DefaultAnchorBorderColor);
|
||||
Cfg.SetDeleteValue('AnchorControlColor/Value', AnchorControlColor, DefaultAnchorControlColor);
|
||||
Cfg.SetDeleteValue('AnchorTopColor/Value', AnchorTopColor, DefaultAnchorTopColor);
|
||||
@ -322,6 +334,7 @@ var
|
||||
begin
|
||||
Cfg := GetIDEConfigStorage(AFilename, True);
|
||||
try
|
||||
AllowSizing := Cfg.GetValue('AllowSizing/Value', False);
|
||||
AnchorBorderColor := Cfg.GetValue('AnchorBorderColor/Value', DefaultAnchorBorderColor);
|
||||
AnchorControlColor := Cfg.GetValue('AnchorControlColor/Value', DefaultAnchorControlColor);
|
||||
AnchorTopColor := Cfg.GetValue('AnchorTopColor/Value', DefaultAnchorTopColor);
|
||||
|
Loading…
Reference in New Issue
Block a user