AnchorEditor: commit keyboard changes. Issue #0020826

git-svn-id: trunk@35960 -
This commit is contained in:
martin 2012-03-14 00:41:15 +00:00
parent ff6d88d005
commit a4e43e4501
2 changed files with 77 additions and 68 deletions

View File

@ -10,6 +10,7 @@ object AnchorDesigner: TAnchorDesigner
Constraints.MinHeight = 282 Constraints.MinHeight = 282
Constraints.MinWidth = 476 Constraints.MinWidth = 476
OnCreate = AnchorDesignerCreate OnCreate = AnchorDesignerCreate
OnDeactivate = FormDeactivate
OnDestroy = AnchorDesignerDestroy OnDestroy = AnchorDesignerDestroy
OnShow = AnchorDesignerShow OnShow = AnchorDesignerShow
LCLVersion = '0.9.31' LCLVersion = '0.9.31'
@ -20,22 +21,22 @@ object AnchorDesigner: TAnchorDesigner
AnchorSideTop.Side = asrBottom AnchorSideTop.Side = asrBottom
AnchorSideBottom.Control = BottomGroupBox AnchorSideBottom.Control = BottomGroupBox
Left = 193 Left = 193
Height = 170 Height = 168
Top = 59 Top = 60
Width = 210 Width = 210
Anchors = [akTop, akLeft, akBottom] Anchors = [akTop, akLeft, akBottom]
BorderSpacing.Top = 4 BorderSpacing.Top = 4
BorderSpacing.Bottom = 4 BorderSpacing.Bottom = 4
Caption = 'BorderSpaceGroupBox' Caption = 'BorderSpaceGroupBox'
ClientHeight = 153 ClientHeight = 150
ClientWidth = 206 ClientWidth = 206
TabOrder = 2 TabOrder = 2
object LeftBorderSpaceSpinEdit: TSpinEdit object LeftBorderSpaceSpinEdit: TSpinEdit
AnchorSideTop.Control = AroundBorderSpaceSpinEdit AnchorSideTop.Control = AroundBorderSpaceSpinEdit
AnchorSideRight.Control = AroundBorderSpaceSpinEdit AnchorSideRight.Control = AroundBorderSpaceSpinEdit
Left = 11 Left = 11
Height = 19 Height = 23
Top = 67 Top = 64
Width = 56 Width = 56
Anchors = [akTop, akRight] Anchors = [akTop, akRight]
BorderSpacing.Right = 8 BorderSpacing.Right = 8
@ -51,8 +52,8 @@ object AnchorDesigner: TAnchorDesigner
AnchorSideLeft.Side = asrBottom AnchorSideLeft.Side = asrBottom
AnchorSideTop.Control = AroundBorderSpaceSpinEdit AnchorSideTop.Control = AroundBorderSpaceSpinEdit
Left = 139 Left = 139
Height = 19 Height = 23
Top = 67 Top = 64
Width = 56 Width = 56
BorderSpacing.Left = 8 BorderSpacing.Left = 8
MaxValue = 2048 MaxValue = 2048
@ -66,8 +67,8 @@ object AnchorDesigner: TAnchorDesigner
AnchorSideLeft.Control = AroundBorderSpaceSpinEdit AnchorSideLeft.Control = AroundBorderSpaceSpinEdit
AnchorSideBottom.Control = AroundBorderSpaceSpinEdit AnchorSideBottom.Control = AroundBorderSpaceSpinEdit
Left = 75 Left = 75
Height = 19 Height = 23
Top = 36 Top = 29
Width = 56 Width = 56
Anchors = [akLeft, akBottom] Anchors = [akLeft, akBottom]
BorderSpacing.Bottom = 12 BorderSpacing.Bottom = 12
@ -83,8 +84,8 @@ object AnchorDesigner: TAnchorDesigner
AnchorSideTop.Control = AroundBorderSpaceSpinEdit AnchorSideTop.Control = AroundBorderSpaceSpinEdit
AnchorSideTop.Side = asrBottom AnchorSideTop.Side = asrBottom
Left = 75 Left = 75
Height = 19 Height = 23
Top = 98 Top = 99
Width = 56 Width = 56
BorderSpacing.Top = 12 BorderSpacing.Top = 12
MaxValue = 2048 MaxValue = 2048
@ -100,8 +101,8 @@ object AnchorDesigner: TAnchorDesigner
AnchorSideTop.Control = BorderSpaceGroupBox AnchorSideTop.Control = BorderSpaceGroupBox
AnchorSideTop.Side = asrCenter AnchorSideTop.Side = asrCenter
Left = 75 Left = 75
Height = 19 Height = 23
Top = 67 Top = 64
Width = 56 Width = 56
MaxValue = 2048 MaxValue = 2048
OnChange = BorderSpaceSpinEditChange OnChange = BorderSpaceSpinEditChange
@ -113,7 +114,7 @@ object AnchorDesigner: TAnchorDesigner
end end
object TopGroupBox: TGroupBox object TopGroupBox: TGroupBox
Left = 56 Left = 56
Height = 55 Height = 56
Top = 0 Top = 0
Width = 484 Width = 484
Anchors = [akTop, akLeft, akRight] Anchors = [akTop, akLeft, akRight]
@ -180,10 +181,10 @@ object AnchorDesigner: TAnchorDesigner
AnchorSideLeft.Side = asrBottom AnchorSideLeft.Side = asrBottom
AnchorSideTop.Control = TopRefCenterSpeedButton AnchorSideTop.Control = TopRefCenterSpeedButton
AnchorSideTop.Side = asrCenter AnchorSideTop.Side = asrCenter
Left = 93 Left = 86
Height = 14 Height = 16
Top = 8 Top = 7
Width = 39 Width = 37
BorderSpacing.Left = 16 BorderSpacing.Left = 16
Caption = 'Sibling' Caption = 'Sibling'
ParentColor = False ParentColor = False
@ -192,9 +193,9 @@ object AnchorDesigner: TAnchorDesigner
AnchorSideTop.Control = TopRefCenterSpeedButton AnchorSideTop.Control = TopRefCenterSpeedButton
AnchorSideTop.Side = asrCenter AnchorSideTop.Side = asrCenter
Left = 8 Left = 8
Height = 18 Height = 19
Top = 6 Top = 6
Width = 69 Width = 62
BorderSpacing.Left = 8 BorderSpacing.Left = 8
Caption = 'Enabled' Caption = 'Enabled'
OnChange = AnchorEnabledCheckBoxChange OnChange = AnchorEnabledCheckBoxChange
@ -206,14 +207,14 @@ object AnchorDesigner: TAnchorDesigner
AnchorSideTop.Control = TopRefCenterSpeedButton AnchorSideTop.Control = TopRefCenterSpeedButton
AnchorSideTop.Side = asrCenter AnchorSideTop.Side = asrCenter
AnchorSideRight.Control = TopRefTopSpeedButton AnchorSideRight.Control = TopRefTopSpeedButton
Left = 136 Left = 127
Height = 20 Height = 23
Top = 5 Top = 4
Width = 226 Width = 235
Anchors = [akTop, akLeft, akRight] Anchors = [akTop, akLeft, akRight]
BorderSpacing.Left = 4 BorderSpacing.Left = 4
BorderSpacing.Right = 12 BorderSpacing.Right = 12
ItemHeight = 0 ItemHeight = 15
OnEditingDone = SiblingComboBoxChange OnEditingDone = SiblingComboBoxChange
ParentShowHint = False ParentShowHint = False
ShowHint = True ShowHint = True
@ -223,8 +224,8 @@ object AnchorDesigner: TAnchorDesigner
end end
object BottomGroupBox: TGroupBox object BottomGroupBox: TGroupBox
Left = 56 Left = 56
Height = 55 Height = 56
Top = 233 Top = 232
Width = 484 Width = 484
Anchors = [akLeft, akRight, akBottom] Anchors = [akLeft, akRight, akBottom]
AutoSize = True AutoSize = True
@ -288,10 +289,10 @@ object AnchorDesigner: TAnchorDesigner
AnchorSideLeft.Side = asrBottom AnchorSideLeft.Side = asrBottom
AnchorSideTop.Control = BottomRefCenterSpeedButton AnchorSideTop.Control = BottomRefCenterSpeedButton
AnchorSideTop.Side = asrCenter AnchorSideTop.Side = asrCenter
Left = 93 Left = 86
Height = 14 Height = 16
Top = 8 Top = 7
Width = 39 Width = 37
BorderSpacing.Left = 16 BorderSpacing.Left = 16
Caption = 'Sibling' Caption = 'Sibling'
ParentColor = False ParentColor = False
@ -300,9 +301,9 @@ object AnchorDesigner: TAnchorDesigner
AnchorSideTop.Control = BottomRefCenterSpeedButton AnchorSideTop.Control = BottomRefCenterSpeedButton
AnchorSideTop.Side = asrCenter AnchorSideTop.Side = asrCenter
Left = 8 Left = 8
Height = 18 Height = 19
Top = 6 Top = 6
Width = 69 Width = 62
BorderSpacing.Left = 8 BorderSpacing.Left = 8
Caption = 'Enabled' Caption = 'Enabled'
OnChange = AnchorEnabledCheckBoxChange OnChange = AnchorEnabledCheckBoxChange
@ -314,14 +315,14 @@ object AnchorDesigner: TAnchorDesigner
AnchorSideTop.Control = BottomRefCenterSpeedButton AnchorSideTop.Control = BottomRefCenterSpeedButton
AnchorSideTop.Side = asrCenter AnchorSideTop.Side = asrCenter
AnchorSideRight.Control = BottomRefTopSpeedButton AnchorSideRight.Control = BottomRefTopSpeedButton
Left = 136 Left = 127
Height = 20 Height = 23
Top = 5 Top = 4
Width = 226 Width = 235
Anchors = [akTop, akLeft, akRight] Anchors = [akTop, akLeft, akRight]
BorderSpacing.Left = 4 BorderSpacing.Left = 4
BorderSpacing.Right = 12 BorderSpacing.Right = 12
ItemHeight = 0 ItemHeight = 15
OnEditingDone = SiblingComboBoxChange OnEditingDone = SiblingComboBoxChange
ParentShowHint = False ParentShowHint = False
ShowHint = True ShowHint = True
@ -336,13 +337,13 @@ object AnchorDesigner: TAnchorDesigner
AnchorSideBottom.Control = BorderSpaceGroupBox AnchorSideBottom.Control = BorderSpaceGroupBox
AnchorSideBottom.Side = asrBottom AnchorSideBottom.Side = asrBottom
Left = 407 Left = 407
Height = 170 Height = 168
Top = 59 Top = 60
Width = 179 Width = 179
Anchors = [akTop, akLeft, akRight, akBottom] Anchors = [akTop, akLeft, akRight, akBottom]
BorderSpacing.Left = 4 BorderSpacing.Left = 4
Caption = 'RightGroupBox' Caption = 'RightGroupBox'
ClientHeight = 153 ClientHeight = 150
ClientWidth = 175 ClientWidth = 175
TabOrder = 3 TabOrder = 3
object RightRefLeftSpeedButton: TSpeedButton object RightRefLeftSpeedButton: TSpeedButton
@ -350,7 +351,7 @@ object AnchorDesigner: TAnchorDesigner
AnchorSideRight.Control = RightRefRightSpeedButton AnchorSideRight.Control = RightRefRightSpeedButton
Left = 69 Left = 69
Height = 30 Height = 30
Top = 98 Top = 99
Width = 30 Width = 30
Anchors = [akTop, akRight] Anchors = [akTop, akRight]
BorderSpacing.Right = 4 BorderSpacing.Right = 4
@ -366,7 +367,7 @@ object AnchorDesigner: TAnchorDesigner
AnchorSideRight.Control = RightRefCenterSpeedButton AnchorSideRight.Control = RightRefCenterSpeedButton
Left = 103 Left = 103
Height = 30 Height = 30
Top = 98 Top = 99
Width = 30 Width = 30
Anchors = [akTop, akRight] Anchors = [akTop, akRight]
BorderSpacing.Right = 4 BorderSpacing.Right = 4
@ -384,7 +385,7 @@ object AnchorDesigner: TAnchorDesigner
AnchorSideRight.Side = asrBottom AnchorSideRight.Side = asrBottom
Left = 137 Left = 137
Height = 30 Height = 30
Top = 98 Top = 99
Width = 30 Width = 30
Anchors = [akTop, akRight] Anchors = [akTop, akRight]
BorderSpacing.Top = 12 BorderSpacing.Top = 12
@ -400,9 +401,9 @@ object AnchorDesigner: TAnchorDesigner
AnchorSideTop.Side = asrBottom AnchorSideTop.Side = asrBottom
AnchorSideBottom.Control = RightSiblingComboBox AnchorSideBottom.Control = RightSiblingComboBox
Left = 8 Left = 8
Height = 14 Height = 16
Top = 52 Top = 48
Width = 39 Width = 37
Anchors = [akLeft, akBottom] Anchors = [akLeft, akBottom]
BorderSpacing.Top = 2 BorderSpacing.Top = 2
Caption = 'Sibling' Caption = 'Sibling'
@ -413,9 +414,9 @@ object AnchorDesigner: TAnchorDesigner
AnchorSideTop.Side = asrBottom AnchorSideTop.Side = asrBottom
AnchorSideBottom.Control = RightSiblingLabel AnchorSideBottom.Control = RightSiblingLabel
Left = 8 Left = 8
Height = 18 Height = 19
Top = 26 Top = 21
Width = 69 Width = 62
Anchors = [akLeft, akBottom] Anchors = [akLeft, akBottom]
BorderSpacing.Bottom = 8 BorderSpacing.Bottom = 8
Caption = 'Enabled' Caption = 'Enabled'
@ -429,13 +430,13 @@ object AnchorDesigner: TAnchorDesigner
AnchorSideRight.Control = RightGroupBox AnchorSideRight.Control = RightGroupBox
AnchorSideRight.Side = asrBottom AnchorSideRight.Side = asrBottom
Left = 8 Left = 8
Height = 20 Height = 23
Top = 66 Top = 64
Width = 159 Width = 159
Anchors = [akTop, akLeft, akRight] Anchors = [akTop, akLeft, akRight]
BorderSpacing.Left = 8 BorderSpacing.Left = 8
BorderSpacing.Right = 8 BorderSpacing.Right = 8
ItemHeight = 0 ItemHeight = 15
OnEditingDone = SiblingComboBoxChange OnEditingDone = SiblingComboBoxChange
ParentShowHint = False ParentShowHint = False
ShowHint = True ShowHint = True
@ -449,13 +450,13 @@ object AnchorDesigner: TAnchorDesigner
AnchorSideBottom.Control = BorderSpaceGroupBox AnchorSideBottom.Control = BorderSpaceGroupBox
AnchorSideBottom.Side = asrBottom AnchorSideBottom.Side = asrBottom
Left = 8 Left = 8
Height = 170 Height = 168
Top = 59 Top = 60
Width = 181 Width = 181
Anchors = [akTop, akLeft, akRight, akBottom] Anchors = [akTop, akLeft, akRight, akBottom]
BorderSpacing.Right = 4 BorderSpacing.Right = 4
Caption = 'LeftGroupBox' Caption = 'LeftGroupBox'
ClientHeight = 153 ClientHeight = 150
ClientWidth = 177 ClientWidth = 177
TabOrder = 1 TabOrder = 1
object LeftRefLeftSpeedButton: TSpeedButton object LeftRefLeftSpeedButton: TSpeedButton
@ -463,7 +464,7 @@ object AnchorDesigner: TAnchorDesigner
AnchorSideRight.Control = LeftRefRightSpeedButton AnchorSideRight.Control = LeftRefRightSpeedButton
Left = 71 Left = 71
Height = 30 Height = 30
Top = 98 Top = 99
Width = 30 Width = 30
Anchors = [akTop, akRight] Anchors = [akTop, akRight]
BorderSpacing.Right = 4 BorderSpacing.Right = 4
@ -480,7 +481,7 @@ object AnchorDesigner: TAnchorDesigner
AnchorSideRight.Control = LeftRefCenterSpeedButton AnchorSideRight.Control = LeftRefCenterSpeedButton
Left = 105 Left = 105
Height = 30 Height = 30
Top = 98 Top = 99
Width = 30 Width = 30
Anchors = [akTop, akRight] Anchors = [akTop, akRight]
BorderSpacing.Right = 4 BorderSpacing.Right = 4
@ -499,7 +500,7 @@ object AnchorDesigner: TAnchorDesigner
AnchorSideRight.Side = asrBottom AnchorSideRight.Side = asrBottom
Left = 139 Left = 139
Height = 30 Height = 30
Top = 98 Top = 99
Width = 30 Width = 30
Anchors = [akTop, akRight] Anchors = [akTop, akRight]
BorderSpacing.Top = 12 BorderSpacing.Top = 12
@ -514,9 +515,9 @@ object AnchorDesigner: TAnchorDesigner
AnchorSideLeft.Control = LeftSiblingComboBox AnchorSideLeft.Control = LeftSiblingComboBox
AnchorSideBottom.Control = LeftSiblingComboBox AnchorSideBottom.Control = LeftSiblingComboBox
Left = 8 Left = 8
Height = 14 Height = 16
Top = 52 Top = 48
Width = 39 Width = 37
Anchors = [akLeft, akBottom] Anchors = [akLeft, akBottom]
BorderSpacing.Top = 2 BorderSpacing.Top = 2
Caption = 'Sibling' Caption = 'Sibling'
@ -526,9 +527,9 @@ object AnchorDesigner: TAnchorDesigner
AnchorSideLeft.Control = LeftSiblingComboBox AnchorSideLeft.Control = LeftSiblingComboBox
AnchorSideBottom.Control = LeftSiblingLabel AnchorSideBottom.Control = LeftSiblingLabel
Left = 8 Left = 8
Height = 18 Height = 19
Top = 26 Top = 21
Width = 69 Width = 62
Anchors = [akLeft, akBottom] Anchors = [akLeft, akBottom]
BorderSpacing.Bottom = 8 BorderSpacing.Bottom = 8
Caption = 'Enabled' Caption = 'Enabled'
@ -542,13 +543,13 @@ object AnchorDesigner: TAnchorDesigner
AnchorSideRight.Control = LeftGroupBox AnchorSideRight.Control = LeftGroupBox
AnchorSideRight.Side = asrBottom AnchorSideRight.Side = asrBottom
Left = 8 Left = 8
Height = 20 Height = 23
Top = 66 Top = 64
Width = 161 Width = 161
Anchors = [akTop, akLeft, akRight] Anchors = [akTop, akLeft, akRight]
BorderSpacing.Left = 8 BorderSpacing.Left = 8
BorderSpacing.Right = 8 BorderSpacing.Right = 8
ItemHeight = 0 ItemHeight = 15
OnEditingDone = SiblingComboBoxChange OnEditingDone = SiblingComboBoxChange
ParentShowHint = False ParentShowHint = False
ShowHint = True ShowHint = True

View File

@ -136,6 +136,7 @@ type
procedure AnchorDesignerShow(Sender: TObject); procedure AnchorDesignerShow(Sender: TObject);
procedure AnchorEnabledCheckBoxChange(Sender: TObject); procedure AnchorEnabledCheckBoxChange(Sender: TObject);
procedure BorderSpaceSpinEditChange(Sender: TObject); procedure BorderSpaceSpinEditChange(Sender: TObject);
procedure FormDeactivate(Sender: TObject);
procedure SiblingComboBoxChange(Sender: TObject); procedure SiblingComboBoxChange(Sender: TObject);
procedure ReferenceSideButtonClicked(Sender: TObject); procedure ReferenceSideButtonClicked(Sender: TObject);
private private
@ -390,6 +391,13 @@ begin
end; end;
end; end;
procedure TAnchorDesigner.FormDeactivate(Sender: TObject);
begin
// commit changes made by keyboard
if (ActiveControl is TComboBox) then
SiblingComboBoxChange(ActiveControl);
end;
function compareControlTop(Item1, Item2: pointer): Integer; function compareControlTop(Item1, Item2: pointer): Integer;
begin begin
if tcontrol(item1).top<tcontrol(item2).top then result:=-1 if tcontrol(item1).top<tcontrol(item2).top then result:=-1