diff --git a/designer/anchoreditor.lfm b/designer/anchoreditor.lfm index 9692d45392..8180f657fb 100644 --- a/designer/anchoreditor.lfm +++ b/designer/anchoreditor.lfm @@ -7,14 +7,15 @@ object AnchorDesigner: TAnchorDesigner OnDestroy = AnchorDesignerDestroy OnShow = AnchorDesignerShow PixelsPerInch = 90 - HorzScrollBar.Page = 521 - VertScrollBar.Page = 260 + HorzScrollBar.Page = 519 + VertScrollBar.Page = 258 Left = 290 Height = 259 Top = 163 Width = 520 object BorderSpaceGroupBox: TGroupBox Anchors = [akTop, akLeft, akBottom] + BorderSpacing.OnChange = nil Caption = 'BorderSpaceGroupBox' ClientHeight = 87 ClientWidth = 168 @@ -25,68 +26,63 @@ object AnchorDesigner: TAnchorDesigner Top = 80 Width = 172 object LeftBorderSpaceSpinEdit: TSpinEdit + BorderSpacing.OnChange = nil Decimal_Places = 0 MaxValue = 100 ParentShowHint = False ShowHint = True TabStop = True TabOrder = 0 - Decimal_Places = 0 - MaxValue = 100 Height = 20 Top = 30 Width = 50 end object RightBorderSpaceSpinEdit: TSpinEdit + BorderSpacing.OnChange = nil Decimal_Places = 0 MaxValue = 100 ParentShowHint = False ShowHint = True TabStop = True TabOrder = 1 - Decimal_Places = 0 - MaxValue = 100 Left = 118 Height = 20 Top = 30 Width = 50 end object TopBorderSpaceSpinEdit: TSpinEdit + BorderSpacing.OnChange = nil Decimal_Places = 0 MaxValue = 100 ParentShowHint = False ShowHint = True TabStop = True TabOrder = 2 - Decimal_Places = 0 - MaxValue = 100 Left = 58 Height = 20 Width = 50 end object BottomBorderSpaceSpinEdit: TSpinEdit + BorderSpacing.OnChange = nil Decimal_Places = 0 MaxValue = 100 ParentShowHint = False ShowHint = True TabStop = True TabOrder = 3 - Decimal_Places = 0 - MaxValue = 100 Left = 58 Height = 20 Top = 57 Width = 50 end object AroundBorderSpaceSpinEdit: TSpinEdit + BorderSpacing.OnChange = nil Decimal_Places = 0 MaxValue = 100 ParentShowHint = False ShowHint = True TabStop = True TabOrder = 4 - Decimal_Places = 0 - MaxValue = 100 Left = 58 Height = 20 Top = 30 @@ -95,6 +91,7 @@ object AnchorDesigner: TAnchorDesigner end object TopGroupBox: TGroupBox Anchors = [akTop, akLeft, akRight] + BorderSpacing.OnChange = nil Caption = 'TopGroupBox' ClientHeight = 33 ClientWidth = 404 @@ -105,6 +102,7 @@ object AnchorDesigner: TAnchorDesigner Width = 408 object TopRefTopSpeedButton: TSpeedButton Anchors = [akTop, akRight] + BorderSpacing.OnChange = nil GroupIndex = 1 NumGlyphs = 0 ShowHint = True @@ -115,6 +113,7 @@ object AnchorDesigner: TAnchorDesigner end object TopRefBottomSpeedButton: TSpeedButton Anchors = [akTop, akRight] + BorderSpacing.OnChange = nil GroupIndex = 1 NumGlyphs = 0 ShowHint = True @@ -125,6 +124,7 @@ object AnchorDesigner: TAnchorDesigner end object TopRefCenterSpeedButton: TSpeedButton Anchors = [akTop, akRight] + BorderSpacing.OnChange = nil GroupIndex = 1 NumGlyphs = 0 ShowHint = True @@ -133,15 +133,29 @@ object AnchorDesigner: TAnchorDesigner Height = 30 Width = 30 end + object TopSiblingLabel: TLabel + AutoSize = True + BorderSpacing.OnChange = nil + Caption = 'Sibling' + ParentColor = True + Left = 94 + Height = 12 + Top = 4 + Width = 38 + end object TopAnchoredCheckBox: TCheckBox + BorderSpacing.OnChange = nil Caption = 'Enabled' + OnChange = AnchorEnabledCheckBoxChange TabOrder = 0 + UseOnChange = True Left = 2 Height = 24 Width = 70 end object TopSiblingComboBox: TComboBox Anchors = [akTop, akLeft, akRight] + BorderSpacing.OnChange = nil MaxLength = 0 ParentShowHint = False ShowHint = True @@ -151,17 +165,10 @@ object AnchorDesigner: TAnchorDesigner Height = 25 Width = 129 end - object TopSiblingLabel: TLabel - AutoSize = True - Caption = 'Sibling' - Left = 94 - Height = 16 - Top = 4 - Width = 38 - end end object BottomGroupBox: TGroupBox Anchors = [akLeft, akRight, akBottom] + BorderSpacing.OnChange = nil Caption = 'BottomGroupBox' ClientHeight = 33 ClientWidth = 404 @@ -173,6 +180,7 @@ object AnchorDesigner: TAnchorDesigner Width = 408 object BottomRefTopSpeedButton: TSpeedButton Anchors = [akTop, akRight] + BorderSpacing.OnChange = nil GroupIndex = 3 NumGlyphs = 0 ShowHint = True @@ -183,6 +191,7 @@ object AnchorDesigner: TAnchorDesigner end object BottomRefBottomSpeedButton: TSpeedButton Anchors = [akTop, akRight] + BorderSpacing.OnChange = nil GroupIndex = 3 NumGlyphs = 0 ShowHint = True @@ -193,6 +202,7 @@ object AnchorDesigner: TAnchorDesigner end object BottomRefCenterSpeedButton: TSpeedButton Anchors = [akTop, akRight] + BorderSpacing.OnChange = nil GroupIndex = 3 NumGlyphs = 0 ShowHint = True @@ -201,15 +211,29 @@ object AnchorDesigner: TAnchorDesigner Height = 30 Width = 30 end + object BottomSiblingLabel: TLabel + AutoSize = True + BorderSpacing.OnChange = nil + Caption = 'Sibling' + ParentColor = True + Left = 94 + Height = 12 + Top = 8 + Width = 38 + end object BottomAnchoredCheckBox: TCheckBox + BorderSpacing.OnChange = nil Caption = 'Enabled' + OnChange = AnchorEnabledCheckBoxChange TabOrder = 0 + UseOnChange = True Left = 2 Height = 24 Width = 70 end object BottomSiblingComboBox: TComboBox Anchors = [akTop, akLeft, akRight] + BorderSpacing.OnChange = nil MaxLength = 0 ParentShowHint = False ShowHint = True @@ -219,17 +243,10 @@ object AnchorDesigner: TAnchorDesigner Height = 25 Width = 129 end - object BottomSiblingLabel: TLabel - AutoSize = True - Caption = 'Sibling' - Left = 94 - Height = 16 - Top = 8 - Width = 38 - end end object RightGroupBox: TGroupBox Anchors = [akTop, akLeft, akBottom] + BorderSpacing.OnChange = nil Caption = 'RightGroupBox' ClientHeight = 112 ClientWidth = 146 @@ -240,6 +257,7 @@ object AnchorDesigner: TAnchorDesigner Top = 64 Width = 150 object RightRefLeftSpeedButton: TSpeedButton + BorderSpacing.OnChange = nil GroupIndex = 4 NumGlyphs = 0 ShowHint = True @@ -250,6 +268,7 @@ object AnchorDesigner: TAnchorDesigner Width = 30 end object RightRefRightSpeedButton: TSpeedButton + BorderSpacing.OnChange = nil GroupIndex = 4 NumGlyphs = 0 ShowHint = True @@ -260,6 +279,7 @@ object AnchorDesigner: TAnchorDesigner Width = 30 end object RightRefCenterSpeedButton: TSpeedButton + BorderSpacing.OnChange = nil GroupIndex = 4 NumGlyphs = 0 ShowHint = True @@ -269,27 +289,32 @@ object AnchorDesigner: TAnchorDesigner Top = 81 Width = 30 end + object RightSiblingLabel: TLabel + AutoSize = True + BorderSpacing.OnChange = nil + Caption = 'Sibling' + ParentColor = True + Left = 2 + Height = 12 + Top = 28 + Width = 38 + end object RightAnchoredCheckBox: TCheckBox + BorderSpacing.OnChange = nil Caption = 'Enabled' + OnChange = AnchorEnabledCheckBoxChange TabOrder = 0 + UseOnChange = True Left = 2 Height = 24 Width = 70 end - object RightSiblingLabel: TLabel - AutoSize = True - Caption = 'Sibling' - Left = 2 - Height = 16 - Top = 28 - Width = 38 - end object RightSiblingComboBox: TComboBox Anchors = [akTop, akLeft, akRight] + BorderSpacing.OnChange = nil MaxLength = 0 ParentShowHint = False ShowHint = True - TabOrder = 2 Text = 'RightSiblingComboBox' Left = 5 Height = 25 @@ -299,6 +324,7 @@ object AnchorDesigner: TAnchorDesigner end object LeftGroupBox: TGroupBox Anchors = [akTop, akLeft, akBottom] + BorderSpacing.OnChange = nil Caption = 'LeftGroupBox' ClientHeight = 112 ClientWidth = 146 @@ -309,6 +335,7 @@ object AnchorDesigner: TAnchorDesigner Top = 64 Width = 150 object LeftRefLeftSpeedButton: TSpeedButton + BorderSpacing.OnChange = nil GroupIndex = 2 NumGlyphs = 0 ShowHint = True @@ -319,6 +346,7 @@ object AnchorDesigner: TAnchorDesigner Width = 30 end object LeftRefRightSpeedButton: TSpeedButton + BorderSpacing.OnChange = nil GroupIndex = 2 NumGlyphs = 0 ShowHint = True @@ -329,6 +357,7 @@ object AnchorDesigner: TAnchorDesigner Width = 30 end object LeftRefCenterSpeedButton: TSpeedButton + BorderSpacing.OnChange = nil GroupIndex = 2 NumGlyphs = 0 ShowHint = True @@ -338,27 +367,32 @@ object AnchorDesigner: TAnchorDesigner Top = 81 Width = 30 end + object LeftSiblingLabel: TLabel + AutoSize = True + BorderSpacing.OnChange = nil + Caption = 'Sibling' + ParentColor = True + Left = 2 + Height = 12 + Top = 28 + Width = 38 + end object LeftAnchoredCheckBox: TCheckBox + BorderSpacing.OnChange = nil Caption = 'Enabled' + OnChange = AnchorEnabledCheckBoxChange TabOrder = 0 + UseOnChange = True Left = 2 Height = 24 Width = 70 end - object LeftSiblingLabel: TLabel - AutoSize = True - Caption = 'Sibling' - Left = 2 - Height = 16 - Top = 28 - Width = 38 - end object LeftSiblingComboBox: TComboBox Anchors = [akTop, akLeft, akRight] + BorderSpacing.OnChange = nil MaxLength = 0 ParentShowHint = False ShowHint = True - TabOrder = 2 Text = 'LeftSiblingComboBox' Left = 5 Height = 25 diff --git a/designer/anchoreditor.lrs b/designer/anchoreditor.lrs index 71d94c923d..4fcfa49d37 100644 --- a/designer/anchoreditor.lrs +++ b/designer/anchoreditor.lrs @@ -5,97 +5,110 @@ LazarusResources.Add('TAnchorDesigner','FORMDATA',[ +#12'ClientHeight'#3#3#1#11'ClientWidth'#3#8#2#7'OnClose'#7#19'AnchorDesigner' +'Close'#8'OnCreate'#7#20'AnchorDesignerCreate'#9'OnDestroy'#7#21'AnchorDesig' +'nerDestroy'#6'OnShow'#7#18'AnchorDesignerShow'#13'PixelsPerInch'#2'Z'#18'Ho' - +'rzScrollBar.Page'#3#9#2#18'VertScrollBar.Page'#3#4#1#4'Left'#3'"'#1#6'Heigh' + +'rzScrollBar.Page'#3#7#2#18'VertScrollBar.Page'#3#2#1#4'Left'#3'"'#1#6'Heigh' +'t'#3#3#1#3'Top'#3#163#0#5'Width'#3#8#2#0#9'TGroupBox'#19'BorderSpaceGroupBo' - +'x'#7'Anchors'#11#5'akTop'#6'akLeft'#8'akBottom'#0#7'Caption'#6#19'BorderSpa' - +'ceGroupBox'#12'ClientHeight'#2'W'#11'ClientWidth'#3#168#0#11'ParentColor'#9 - +#8'TabOrder'#2#0#4'Left'#3#172#0#6'Height'#2'h'#3'Top'#2'P'#5'Width'#3#172#0 - +#0#9'TSpinEdit'#23'LeftBorderSpaceSpinEdit'#14'Decimal_Places'#2#0#8'MaxValu' - +'e'#5#0#0#0#0#0#0#0#200#5'@'#14'ParentShowHint'#8#8'ShowHint'#9#7'TabStop'#9 - +#8'TabOrder'#2#0#14'Decimal_Places'#2#0#8'MaxValue'#5#0#0#0#0#0#0#0#200#5'@' - +#6'Height'#2#20#3'Top'#2#30#5'Width'#2'2'#0#0#9'TSpinEdit'#24'RightBorderSpa' - +'ceSpinEdit'#14'Decimal_Places'#2#0#8'MaxValue'#5#0#0#0#0#0#0#0#200#5'@'#14 - +'ParentShowHint'#8#8'ShowHint'#9#7'TabStop'#9#8'TabOrder'#2#1#14'Decimal_Pla' - +'ces'#2#0#8'MaxValue'#5#0#0#0#0#0#0#0#200#5'@'#4'Left'#2'v'#6'Height'#2#20#3 - +'Top'#2#30#5'Width'#2'2'#0#0#9'TSpinEdit'#22'TopBorderSpaceSpinEdit'#14'Deci' - +'mal_Places'#2#0#8'MaxValue'#5#0#0#0#0#0#0#0#200#5'@'#14'ParentShowHint'#8#8 - +'ShowHint'#9#7'TabStop'#9#8'TabOrder'#2#2#14'Decimal_Places'#2#0#8'MaxValue' - +#5#0#0#0#0#0#0#0#200#5'@'#4'Left'#2':'#6'Height'#2#20#5'Width'#2'2'#0#0#9'TS' - +'pinEdit'#25'BottomBorderSpaceSpinEdit'#14'Decimal_Places'#2#0#8'MaxValue'#5 + +'x'#7'Anchors'#11#5'akTop'#6'akLeft'#8'akBottom'#0#22'BorderSpacing.OnChange' + +#13#7'Caption'#6#19'BorderSpaceGroupBox'#12'ClientHeight'#2'W'#11'ClientWidt' + +'h'#3#168#0#11'ParentColor'#9#8'TabOrder'#2#0#4'Left'#3#172#0#6'Height'#2'h' + +#3'Top'#2'P'#5'Width'#3#172#0#0#9'TSpinEdit'#23'LeftBorderSpaceSpinEdit'#22 + +'BorderSpacing.OnChange'#13#14'Decimal_Places'#2#0#8'MaxValue'#5#0#0#0#0#0#0 + +#0#200#5'@'#14'ParentShowHint'#8#8'ShowHint'#9#7'TabStop'#9#8'TabOrder'#2#0#6 + +'Height'#2#20#3'Top'#2#30#5'Width'#2'2'#0#0#9'TSpinEdit'#24'RightBorderSpace' + +'SpinEdit'#22'BorderSpacing.OnChange'#13#14'Decimal_Places'#2#0#8'MaxValue'#5 +#0#0#0#0#0#0#0#200#5'@'#14'ParentShowHint'#8#8'ShowHint'#9#7'TabStop'#9#8'Ta' - +'bOrder'#2#3#14'Decimal_Places'#2#0#8'MaxValue'#5#0#0#0#0#0#0#0#200#5'@'#4'L' - +'eft'#2':'#6'Height'#2#20#3'Top'#2'9'#5'Width'#2'2'#0#0#9'TSpinEdit'#25'Arou' - +'ndBorderSpaceSpinEdit'#14'Decimal_Places'#2#0#8'MaxValue'#5#0#0#0#0#0#0#0 - +#200#5'@'#14'ParentShowHint'#8#8'ShowHint'#9#7'TabStop'#9#8'TabOrder'#2#4#14 - +'Decimal_Places'#2#0#8'MaxValue'#5#0#0#0#0#0#0#0#200#5'@'#4'Left'#2':'#6'Hei' - +'ght'#2#20#3'Top'#2#30#5'Width'#2'2'#0#0#0#9'TGroupBox'#11'TopGroupBox'#7'An' - +'chors'#11#5'akTop'#6'akLeft'#7'akRight'#0#7'Caption'#6#11'TopGroupBox'#12'C' - +'lientHeight'#2'!'#11'ClientWidth'#3#148#1#11'ParentColor'#9#8'TabOrder'#2#1 - +#4'Left'#2'@'#6'Height'#2'2'#5'Width'#3#152#1#0#12'TSpeedButton'#20'TopRefTo' - +'pSpeedButton'#7'Anchors'#11#5'akTop'#7'akRight'#0#10'GroupIndex'#2#1#9'NumG' - +'lyphs'#2#0#8'ShowHint'#9#14'ParentShowHint'#8#4'Left'#3'('#1#6'Height'#2#30 - +#5'Width'#2#30#0#0#12'TSpeedButton'#23'TopRefBottomSpeedButton'#7'Anchors'#11 - +#5'akTop'#7'akRight'#0#10'GroupIndex'#2#1#9'NumGlyphs'#2#0#8'ShowHint'#9#14 - +'ParentShowHint'#8#4'Left'#3'K'#1#6'Height'#2#30#5'Width'#2#30#0#0#12'TSpeed' - +'Button'#23'TopRefCenterSpeedButton'#7'Anchors'#11#5'akTop'#7'akRight'#0#10 - +'GroupIndex'#2#1#9'NumGlyphs'#2#0#8'ShowHint'#9#14'ParentShowHint'#8#4'Left' - +#3'n'#1#6'Height'#2#30#5'Width'#2#30#0#0#9'TCheckBox'#19'TopAnchoredCheckBox' - +#7'Caption'#6#7'Enabled'#8'TabOrder'#2#0#4'Left'#2#2#6'Height'#2#24#5'Width' - +#2'F'#0#0#9'TComboBox'#18'TopSiblingComboBox'#7'Anchors'#11#5'akTop'#6'akLef' - +'t'#7'akRight'#0#9'MaxLength'#2#0#14'ParentShowHint'#8#8'ShowHint'#9#8'TabOr' - +'der'#2#1#4'Text'#6#18'TopSiblingComboBox'#4'Left'#3#158#0#6'Height'#2#25#5 - +'Width'#3#129#0#0#0#6'TLabel'#15'TopSiblingLabel'#8'AutoSize'#9#7'Caption'#6 - +#7'Sibling'#4'Left'#2'^'#6'Height'#2#16#3'Top'#2#4#5'Width'#2'&'#0#0#0#9'TGr' - +'oupBox'#14'BottomGroupBox'#7'Anchors'#11#6'akLeft'#7'akRight'#8'akBottom'#0 - +#7'Caption'#6#14'BottomGroupBox'#12'ClientHeight'#2'!'#11'ClientWidth'#3#148 - +#1#11'ParentColor'#9#8'TabOrder'#2#2#4'Left'#2'@'#6'Height'#2'2'#3'Top'#3#200 - +#0#5'Width'#3#152#1#0#12'TSpeedButton'#23'BottomRefTopSpeedButton'#7'Anchors' - +#11#5'akTop'#7'akRight'#0#10'GroupIndex'#2#3#9'NumGlyphs'#2#0#8'ShowHint'#9 - +#14'ParentShowHint'#8#4'Left'#3'('#1#6'Height'#2#30#5'Width'#2#30#0#0#12'TSp' - +'eedButton'#26'BottomRefBottomSpeedButton'#7'Anchors'#11#5'akTop'#7'akRight' - +#0#10'GroupIndex'#2#3#9'NumGlyphs'#2#0#8'ShowHint'#9#14'ParentShowHint'#8#4 - +'Left'#3'K'#1#6'Height'#2#30#5'Width'#2#30#0#0#12'TSpeedButton'#26'BottomRef' - +'CenterSpeedButton'#7'Anchors'#11#5'akTop'#7'akRight'#0#10'GroupIndex'#2#3#9 - +'NumGlyphs'#2#0#8'ShowHint'#9#14'ParentShowHint'#8#4'Left'#3'n'#1#6'Height'#2 - +#30#5'Width'#2#30#0#0#9'TCheckBox'#22'BottomAnchoredCheckBox'#7'Caption'#6#7 - +'Enabled'#8'TabOrder'#2#0#4'Left'#2#2#6'Height'#2#24#5'Width'#2'F'#0#0#9'TCo' - +'mboBox'#21'BottomSiblingComboBox'#7'Anchors'#11#5'akTop'#6'akLeft'#7'akRigh' - +'t'#0#9'MaxLength'#2#0#14'ParentShowHint'#8#8'ShowHint'#9#8'TabOrder'#2#1#4 - +'Text'#6#21'BottomSiblingComboBox'#4'Left'#3#158#0#6'Height'#2#25#5'Width'#3 - +#129#0#0#0#6'TLabel'#18'BottomSiblingLabel'#8'AutoSize'#9#7'Caption'#6#7'Sib' - +'ling'#4'Left'#2'^'#6'Height'#2#16#3'Top'#2#8#5'Width'#2'&'#0#0#0#9'TGroupBo' - +'x'#13'RightGroupBox'#7'Anchors'#11#5'akTop'#6'akLeft'#8'akBottom'#0#7'Capti' - ,'on'#6#13'RightGroupBox'#12'ClientHeight'#2'p'#11'ClientWidth'#3#146#0#11'Pa' - +'rentColor'#9#8'TabOrder'#2#3#4'Left'#3'l'#1#6'Height'#3#129#0#3'Top'#2'@'#5 - +'Width'#3#150#0#0#12'TSpeedButton'#23'RightRefLeftSpeedButton'#10'GroupIndex' - +#2#4#9'NumGlyphs'#2#0#8'ShowHint'#9#14'ParentShowHint'#8#4'Left'#2#5#6'Heigh' - +'t'#2#30#3'Top'#2'Q'#5'Width'#2#30#0#0#12'TSpeedButton'#24'RightRefRightSpee' - +'dButton'#10'GroupIndex'#2#4#9'NumGlyphs'#2#0#8'ShowHint'#9#14'ParentShowHin' - +'t'#8#4'Left'#2'('#6'Height'#2#30#3'Top'#2'Q'#5'Width'#2#30#0#0#12'TSpeedBut' - +'ton'#25'RightRefCenterSpeedButton'#10'GroupIndex'#2#4#9'NumGlyphs'#2#0#8'Sh' - +'owHint'#9#14'ParentShowHint'#8#4'Left'#2'K'#6'Height'#2#30#3'Top'#2'Q'#5'Wi' - +'dth'#2#30#0#0#9'TCheckBox'#21'RightAnchoredCheckBox'#7'Caption'#6#7'Enabled' - +#8'TabOrder'#2#0#4'Left'#2#2#6'Height'#2#24#5'Width'#2'F'#0#0#6'TLabel'#17'R' - +'ightSiblingLabel'#8'AutoSize'#9#7'Caption'#6#7'Sibling'#4'Left'#2#2#6'Heigh' - +'t'#2#16#3'Top'#2#28#5'Width'#2'&'#0#0#9'TComboBox'#20'RightSiblingComboBox' - +#7'Anchors'#11#5'akTop'#6'akLeft'#7'akRight'#0#9'MaxLength'#2#0#14'ParentSho' - +'wHint'#8#8'ShowHint'#9#8'TabOrder'#2#2#4'Text'#6#20'RightSiblingComboBox'#4 - +'Left'#2#5#6'Height'#2#25#3'Top'#2'1'#5'Width'#3#135#0#0#0#0#9'TGroupBox'#12 - +'LeftGroupBox'#7'Anchors'#11#5'akTop'#6'akLeft'#8'akBottom'#0#7'Caption'#6#12 - +'LeftGroupBox'#12'ClientHeight'#2'p'#11'ClientWidth'#3#146#0#11'ParentColor' - +#9#8'TabOrder'#2#4#4'Left'#2#8#6'Height'#3#129#0#3'Top'#2'@'#5'Width'#3#150#0 - +#0#12'TSpeedButton'#22'LeftRefLeftSpeedButton'#10'GroupIndex'#2#2#9'NumGlyph' - +'s'#2#0#8'ShowHint'#9#14'ParentShowHint'#8#4'Left'#2#5#6'Height'#2#30#3'Top' - +#2'Q'#5'Width'#2#30#0#0#12'TSpeedButton'#23'LeftRefRightSpeedButton'#10'Grou' - +'pIndex'#2#2#9'NumGlyphs'#2#0#8'ShowHint'#9#14'ParentShowHint'#8#4'Left'#2'(' - +#6'Height'#2#30#3'Top'#2'Q'#5'Width'#2#30#0#0#12'TSpeedButton'#24'LeftRefCen' - +'terSpeedButton'#10'GroupIndex'#2#2#9'NumGlyphs'#2#0#8'ShowHint'#9#14'Parent' - +'ShowHint'#8#4'Left'#2'K'#6'Height'#2#30#3'Top'#2'Q'#5'Width'#2#30#0#0#9'TCh' - +'eckBox'#20'LeftAnchoredCheckBox'#7'Caption'#6#7'Enabled'#8'TabOrder'#2#0#4 - +'Left'#2#2#6'Height'#2#24#5'Width'#2'F'#0#0#6'TLabel'#16'LeftSiblingLabel'#8 - +'AutoSize'#9#7'Caption'#6#7'Sibling'#4'Left'#2#2#6'Height'#2#16#3'Top'#2#28#5 - +'Width'#2'&'#0#0#9'TComboBox'#19'LeftSiblingComboBox'#7'Anchors'#11#5'akTop' - +#6'akLeft'#7'akRight'#0#9'MaxLength'#2#0#14'ParentShowHint'#8#8'ShowHint'#9#8 - +'TabOrder'#2#2#4'Text'#6#19'LeftSiblingComboBox'#4'Left'#2#5#6'Height'#2#25#3 - +'Top'#2'1'#5'Width'#3#134#0#0#0#0#0 + +'bOrder'#2#1#4'Left'#2'v'#6'Height'#2#20#3'Top'#2#30#5'Width'#2'2'#0#0#9'TSp' + +'inEdit'#22'TopBorderSpaceSpinEdit'#22'BorderSpacing.OnChange'#13#14'Decimal' + +'_Places'#2#0#8'MaxValue'#5#0#0#0#0#0#0#0#200#5'@'#14'ParentShowHint'#8#8'Sh' + +'owHint'#9#7'TabStop'#9#8'TabOrder'#2#2#4'Left'#2':'#6'Height'#2#20#5'Width' + +#2'2'#0#0#9'TSpinEdit'#25'BottomBorderSpaceSpinEdit'#22'BorderSpacing.OnChan' + +'ge'#13#14'Decimal_Places'#2#0#8'MaxValue'#5#0#0#0#0#0#0#0#200#5'@'#14'Paren' + +'tShowHint'#8#8'ShowHint'#9#7'TabStop'#9#8'TabOrder'#2#3#4'Left'#2':'#6'Heig' + +'ht'#2#20#3'Top'#2'9'#5'Width'#2'2'#0#0#9'TSpinEdit'#25'AroundBorderSpaceSpi' + +'nEdit'#22'BorderSpacing.OnChange'#13#14'Decimal_Places'#2#0#8'MaxValue'#5#0 + +#0#0#0#0#0#0#200#5'@'#14'ParentShowHint'#8#8'ShowHint'#9#7'TabStop'#9#8'TabO' + +'rder'#2#4#4'Left'#2':'#6'Height'#2#20#3'Top'#2#30#5'Width'#2'2'#0#0#0#9'TGr' + +'oupBox'#11'TopGroupBox'#7'Anchors'#11#5'akTop'#6'akLeft'#7'akRight'#0#22'Bo' + +'rderSpacing.OnChange'#13#7'Caption'#6#11'TopGroupBox'#12'ClientHeight'#2'!' + +#11'ClientWidth'#3#148#1#11'ParentColor'#9#8'TabOrder'#2#1#4'Left'#2'@'#6'He' + +'ight'#2'2'#5'Width'#3#152#1#0#12'TSpeedButton'#20'TopRefTopSpeedButton'#7'A' + +'nchors'#11#5'akTop'#7'akRight'#0#22'BorderSpacing.OnChange'#13#10'GroupInde' + +'x'#2#1#9'NumGlyphs'#2#0#8'ShowHint'#9#14'ParentShowHint'#8#4'Left'#3'('#1#6 + +'Height'#2#30#5'Width'#2#30#0#0#12'TSpeedButton'#23'TopRefBottomSpeedButton' + +#7'Anchors'#11#5'akTop'#7'akRight'#0#22'BorderSpacing.OnChange'#13#10'GroupI' + +'ndex'#2#1#9'NumGlyphs'#2#0#8'ShowHint'#9#14'ParentShowHint'#8#4'Left'#3'K'#1 + +#6'Height'#2#30#5'Width'#2#30#0#0#12'TSpeedButton'#23'TopRefCenterSpeedButto' + +'n'#7'Anchors'#11#5'akTop'#7'akRight'#0#22'BorderSpacing.OnChange'#13#10'Gro' + +'upIndex'#2#1#9'NumGlyphs'#2#0#8'ShowHint'#9#14'ParentShowHint'#8#4'Left'#3 + +'n'#1#6'Height'#2#30#5'Width'#2#30#0#0#6'TLabel'#15'TopSiblingLabel'#8'AutoS' + +'ize'#9#22'BorderSpacing.OnChange'#13#7'Caption'#6#7'Sibling'#11'ParentColor' + +#9#4'Left'#2'^'#6'Height'#2#12#3'Top'#2#4#5'Width'#2'&'#0#0#9'TCheckBox'#19 + +'TopAnchoredCheckBox'#22'BorderSpacing.OnChange'#13#7'Caption'#6#7'Enabled'#8 + +'OnChange'#7#27'AnchorEnabledCheckBoxChange'#8'TabOrder'#2#0#11'UseOnChange' + +#9#4'Left'#2#2#6'Height'#2#24#5'Width'#2'F'#0#0#9'TComboBox'#18'TopSiblingCo' + +'mboBox'#7'Anchors'#11#5'akTop'#6'akLeft'#7'akRight'#0#22'BorderSpacing.OnCh' + +'ange'#13#9'MaxLength'#2#0#14'ParentShowHint'#8#8'ShowHint'#9#8'TabOrder'#2#1 + +#4'Text'#6#18'TopSiblingComboBox'#4'Left'#3#158#0#6'Height'#2#25#5'Width'#3 + +#129#0#0#0#0#9'TGroupBox'#14'BottomGroupBox'#7'Anchors'#11#6'akLeft'#7'akRig' + +'ht'#8'akBottom'#0#22'BorderSpacing.OnChange'#13#7'Caption'#6#14'BottomGroup' + +'Box'#12'ClientHeight'#2'!'#11'ClientWidth'#3#148#1#11'ParentColor'#9#8'TabO' + +'rder'#2#2#4'Left'#2'@'#6'Height'#2'2'#3'Top'#3#200#0#5'Width'#3#152#1#0#12 + +'TSpeedButton'#23'BottomRefTopSpeedButton'#7'Anchors'#11#5'akTop'#7'akRight' + +#0#22'BorderSpacing.OnChange'#13#10'GroupIndex'#2#3#9'NumGlyphs'#2#0#8'ShowH' + +'int'#9#14'ParentShowHint'#8#4'Left'#3'('#1#6'Height'#2#30#5'Width'#2#30#0#0 + +#12'TSpeedButton'#26'BottomRefBottomSpeedButton'#7'Anchors'#11#5'akTop'#7'ak' + +'Right'#0#22'BorderSpacing.OnChange'#13#10'GroupIndex'#2#3#9'NumGlyphs'#2#0#8 + +'ShowHint'#9#14'ParentShowHint'#8#4'Left'#3'K'#1#6'Height'#2#30#5'Width'#2#30 + +#0#0#12'TSpeedButton'#26'BottomRefCenterSpeedButton'#7'Anchors'#11#5'akTop'#7 + +'akRight'#0#22'BorderSpacing.OnChange'#13#10'GroupIndex'#2#3#9'NumGlyphs'#2#0 + +#8'ShowHint'#9#14'ParentShowHint'#8#4'Left'#3'n'#1#6'Height'#2#30#5'Width'#2 + +#30#0#0#6'TLabel'#18'BottomSiblingLabel'#8'AutoSize'#9#22'BorderSpacing.OnCh' + +'ange'#13#7'Caption'#6#7'Sibling'#11'ParentColor'#9#4'Left'#2'^'#6'Height'#2 + +#12#3'Top'#2#8#5'Width'#2'&'#0#0#9'TCheckBox'#22'BottomAnchoredCheckBox'#22 + +'BorderSpacing.OnChange'#13#7'Caption'#6#7'Enabled'#8'OnChange'#7#27'AnchorE' + ,'nabledCheckBoxChange'#8'TabOrder'#2#0#11'UseOnChange'#9#4'Left'#2#2#6'Heigh' + +'t'#2#24#5'Width'#2'F'#0#0#9'TComboBox'#21'BottomSiblingComboBox'#7'Anchors' + +#11#5'akTop'#6'akLeft'#7'akRight'#0#22'BorderSpacing.OnChange'#13#9'MaxLengt' + +'h'#2#0#14'ParentShowHint'#8#8'ShowHint'#9#8'TabOrder'#2#1#4'Text'#6#21'Bott' + +'omSiblingComboBox'#4'Left'#3#158#0#6'Height'#2#25#5'Width'#3#129#0#0#0#0#9 + +'TGroupBox'#13'RightGroupBox'#7'Anchors'#11#5'akTop'#6'akLeft'#8'akBottom'#0 + +#22'BorderSpacing.OnChange'#13#7'Caption'#6#13'RightGroupBox'#12'ClientHeigh' + +'t'#2'p'#11'ClientWidth'#3#146#0#11'ParentColor'#9#8'TabOrder'#2#3#4'Left'#3 + +'l'#1#6'Height'#3#129#0#3'Top'#2'@'#5'Width'#3#150#0#0#12'TSpeedButton'#23'R' + +'ightRefLeftSpeedButton'#22'BorderSpacing.OnChange'#13#10'GroupIndex'#2#4#9 + +'NumGlyphs'#2#0#8'ShowHint'#9#14'ParentShowHint'#8#4'Left'#2#5#6'Height'#2#30 + +#3'Top'#2'Q'#5'Width'#2#30#0#0#12'TSpeedButton'#24'RightRefRightSpeedButton' + +#22'BorderSpacing.OnChange'#13#10'GroupIndex'#2#4#9'NumGlyphs'#2#0#8'ShowHin' + +'t'#9#14'ParentShowHint'#8#4'Left'#2'('#6'Height'#2#30#3'Top'#2'Q'#5'Width'#2 + +#30#0#0#12'TSpeedButton'#25'RightRefCenterSpeedButton'#22'BorderSpacing.OnCh' + +'ange'#13#10'GroupIndex'#2#4#9'NumGlyphs'#2#0#8'ShowHint'#9#14'ParentShowHin' + +'t'#8#4'Left'#2'K'#6'Height'#2#30#3'Top'#2'Q'#5'Width'#2#30#0#0#6'TLabel'#17 + +'RightSiblingLabel'#8'AutoSize'#9#22'BorderSpacing.OnChange'#13#7'Caption'#6 + +#7'Sibling'#11'ParentColor'#9#4'Left'#2#2#6'Height'#2#12#3'Top'#2#28#5'Width' + +#2'&'#0#0#9'TCheckBox'#21'RightAnchoredCheckBox'#22'BorderSpacing.OnChange' + +#13#7'Caption'#6#7'Enabled'#8'OnChange'#7#27'AnchorEnabledCheckBoxChange'#8 + +'TabOrder'#2#0#11'UseOnChange'#9#4'Left'#2#2#6'Height'#2#24#5'Width'#2'F'#0#0 + +#9'TComboBox'#20'RightSiblingComboBox'#7'Anchors'#11#5'akTop'#6'akLeft'#7'ak' + +'Right'#0#22'BorderSpacing.OnChange'#13#9'MaxLength'#2#0#14'ParentShowHint'#8 + +#8'ShowHint'#9#4'Text'#6#20'RightSiblingComboBox'#4'Left'#2#5#6'Height'#2#25 + +#3'Top'#2'1'#5'Width'#3#135#0#0#0#0#9'TGroupBox'#12'LeftGroupBox'#7'Anchors' + +#11#5'akTop'#6'akLeft'#8'akBottom'#0#22'BorderSpacing.OnChange'#13#7'Caption' + +#6#12'LeftGroupBox'#12'ClientHeight'#2'p'#11'ClientWidth'#3#146#0#11'ParentC' + +'olor'#9#8'TabOrder'#2#4#4'Left'#2#8#6'Height'#3#129#0#3'Top'#2'@'#5'Width'#3 + +#150#0#0#12'TSpeedButton'#22'LeftRefLeftSpeedButton'#22'BorderSpacing.OnChan' + +'ge'#13#10'GroupIndex'#2#2#9'NumGlyphs'#2#0#8'ShowHint'#9#14'ParentShowHint' + +#8#4'Left'#2#5#6'Height'#2#30#3'Top'#2'Q'#5'Width'#2#30#0#0#12'TSpeedButton' + +#23'LeftRefRightSpeedButton'#22'BorderSpacing.OnChange'#13#10'GroupIndex'#2#2 + +#9'NumGlyphs'#2#0#8'ShowHint'#9#14'ParentShowHint'#8#4'Left'#2'('#6'Height'#2 + +#30#3'Top'#2'Q'#5'Width'#2#30#0#0#12'TSpeedButton'#24'LeftRefCenterSpeedButt' + +'on'#22'BorderSpacing.OnChange'#13#10'GroupIndex'#2#2#9'NumGlyphs'#2#0#8'Sho' + +'wHint'#9#14'ParentShowHint'#8#4'Left'#2'K'#6'Height'#2#30#3'Top'#2'Q'#5'Wid' + +'th'#2#30#0#0#6'TLabel'#16'LeftSiblingLabel'#8'AutoSize'#9#22'BorderSpacing.' + +'OnChange'#13#7'Caption'#6#7'Sibling'#11'ParentColor'#9#4'Left'#2#2#6'Height' + +#2#12#3'Top'#2#28#5'Width'#2'&'#0#0#9'TCheckBox'#20'LeftAnchoredCheckBox'#22 + +'BorderSpacing.OnChange'#13#7'Caption'#6#7'Enabled'#8'OnChange'#7#27'AnchorE' + +'nabledCheckBoxChange'#8'TabOrder'#2#0#11'UseOnChange'#9#4'Left'#2#2#6'Heigh' + +'t'#2#24#5'Width'#2'F'#0#0#9'TComboBox'#19'LeftSiblingComboBox'#7'Anchors'#11 + +#5'akTop'#6'akLeft'#7'akRight'#0#22'BorderSpacing.OnChange'#13#9'MaxLength'#2 + +#0#14'ParentShowHint'#8#8'ShowHint'#9#4'Text'#6#19'LeftSiblingComboBox'#4'Le' + +'ft'#2#5#6'Height'#2#25#3'Top'#2'1'#5'Width'#3#134#0#0#0#0#0 ]); diff --git a/designer/anchoreditor.pas b/designer/anchoreditor.pas index 83d242b1e0..be78569a15 100644 --- a/designer/anchoreditor.pas +++ b/designer/anchoreditor.pas @@ -136,6 +136,7 @@ type procedure AnchorDesignerCreate(Sender: TObject); procedure AnchorDesignerDestroy(Sender: TObject); procedure AnchorDesignerShow(Sender: TObject); + procedure AnchorEnabledCheckBoxChange(Sender: TObject); private FSelection: TPersistentSelectionList; protected @@ -144,11 +145,13 @@ type function AnchorDesignerNoSiblingText: string; public SrcTypeImageList: TImageList; + Values: TAnchorDesignerValues; procedure Refresh(Force: boolean); procedure OnRefreshPropertyValues; + function GetSelectedControls: TList; class function ControlToStr(AControl: TControl): string; - procedure CollectValues(const ASelection: TPersistentSelectionList; - var Values: TAnchorDesignerValues; + procedure CollectValues(const ASelection: TList; + var TheValues: TAnchorDesignerValues; var SelectedControlCount: integer); procedure OnSetSelection(const ASelection: TPersistentSelectionList); property Selection: TPersistentSelectionList read FSelection; @@ -260,6 +263,7 @@ end; procedure TAnchorDesigner.AnchorDesignerDestroy(Sender: TObject); begin + FreeAndNil(Values); GlobalDesignHook.RemoveAllHandlersForObject(Self); FreeAndNil(FSelection); end; @@ -269,6 +273,46 @@ begin Refresh(true); end; +procedure TAnchorDesigner.AnchorEnabledCheckBoxChange(Sender: TObject); +var + Kind: TAnchorKind; + CurSide: TAnchorDesignerSideValues; + NewValue: Boolean; + SelectedControls: TList; + i: Integer; + CurControl: TControl; +begin + debugln('TAnchorDesigner.AnchorEnabledCheckBoxChange ',DbgSName(Sender),' ',dbgs(TCheckBox(Sender).Checked)); + if Values=nil then exit; + if Sender=LeftAnchoredCheckBox then + Kind:=akLeft + else if Sender=RightAnchoredCheckBox then + Kind:=akRight + else if Sender=TopAnchoredCheckBox then + Kind:=akTop + else if Sender=BottomAnchoredCheckBox then + Kind:=akBottom + else + exit; + NewValue:=TCheckBox(Sender).Checked; + CurSide:=Values.Sides[Kind]; + debugln('TAnchorDesigner.AnchorEnabledCheckBoxChange CurSide.AmbigiousEnabled=',dbgs(CurSide.AmbigiousEnabled),' CurSide.Enabled=',dbgs(CurSide.Enabled),' NewValue=',dbgs(NewValue)); + if CurSide.AmbigiousEnabled or (CurSide.Enabled<>NewValue) then begin + debugln('TAnchorDesigner.AnchorEnabledCheckBoxChange ',DbgSName(Sender),' NewValue=',dbgs(NewValue)); + // user changed an anchor + SelectedControls:=GetSelectedControls; + if SelectedControls=nil then exit; + for i:=0 to SelectedControls.Count-1 do begin + CurControl:=TControl(SelectedControls[i]); + if NewValue then + CurControl.Anchors:=CurControl.Anchors+[Kind] + else + CurControl.Anchors:=CurControl.Anchors-[Kind]; + end; + GlobalDesignHook.RefreshPropertyValues; + end; +end; + procedure TAnchorDesigner.KeyUp(var Key: Word; Shift: TShiftState); begin inherited KeyUp(Key, Shift); @@ -282,13 +326,15 @@ var CurControl: TControl; j: Integer; Sibling: TControl; + SelectedControls: TList; begin sl:=TStringList.Create; sl.Add(AnchorDesignerNoSiblingText); - if FSelection<>nil then begin - for i:=0 to FSelection.Count-1 do begin - if FSelection[i] is TControl then begin - CurControl:=TControl(FSelection[i]); + SelectedControls:=GetSelectedControls; + if SelectedControls<>nil then begin + for i:=0 to SelectedControls.Count-1 do begin + if TObject(SelectedControls[i]) is TControl then begin + CurControl:=TControl(SelectedControls[i]); if CurControl.Parent<>nil then begin for j:=0 to CurControl.Parent.ControlCount-1 do begin Sibling:=CurControl.Parent.Controls[j]; @@ -312,132 +358,128 @@ end; procedure TAnchorDesigner.Refresh(Force: boolean); var SelectedControlCount: Integer; - Values: TAnchorDesignerValues; CurSide: TAnchorDesignerSideValues; Sibling: String; + CurSelection: TList; begin - debugln('TAnchorDesigner.Refresh A '); + //debugln('TAnchorDesigner.Refresh A '); if not Force then begin // check if uddate is needed if not Visible then exit; end; - Values:=nil; - try - GlobalDesignHook.GetSelection(FSelection); - CollectValues(FSelection,Values,SelectedControlCount); - debugln('TAnchorDesigner.Refresh B ',dbgs(SelectedControlCount)); + FreeAndNil(Values); + CurSelection:=GetSelectedControls; + CollectValues(CurSelection,Values,SelectedControlCount); + //debugln('TAnchorDesigner.Refresh B ',dbgs(SelectedControlCount)); - if (Values=nil) then begin - Caption:='Anchor Editor - no control selected'; - BorderSpaceGroupBox.Enabled:=false; - TopGroupBox.Enabled:=false; - LeftGroupBox.Enabled:=false; - RightGroupBox.Enabled:=false; - BottomGroupBox.Enabled:=false; - end else begin - Caption:='Anchors of selected controls'; + if (Values=nil) then begin + Caption:='Anchor Editor - no control selected'; + BorderSpaceGroupBox.Enabled:=false; + TopGroupBox.Enabled:=false; + LeftGroupBox.Enabled:=false; + RightGroupBox.Enabled:=false; + BottomGroupBox.Enabled:=false; + end else begin + Caption:='Anchors of selected controls'; - // all - BorderSpaceGroupBox.Enabled:=true; - if Values.AmbigiousBorderspaceAround then - AroundBorderSpaceSpinEdit.Value:=-1 - else - AroundBorderSpaceSpinEdit.Value:=Values.BorderspaceAround; + // all + BorderSpaceGroupBox.Enabled:=true; + if Values.AmbigiousBorderspaceAround then + AroundBorderSpaceSpinEdit.Value:=-1 + else + AroundBorderSpaceSpinEdit.Value:=Values.BorderspaceAround; - // Top - TopGroupBox.Enabled:=true; - CurSide:=Values.Sides[akTop]; - TopAnchoredCheckBox.AllowGrayed:=CurSide.AmbigiousEnabled; - if CurSide.AmbigiousEnabled then - TopAnchoredCheckBox.State:=cbGrayed - else - TopAnchoredCheckBox.Checked:=CurSide.Enabled; - if CurSide.AmbigiousBorderSpace then - TopBorderSpaceSpinEdit.Value:=-1 - else - TopBorderSpaceSpinEdit.Value:=CurSide.BorderSpace; - TopBorderSpaceSpinEdit.ValueEmpty:=CurSide.AmbigiousBorderSpace; - Sibling:=CurSide.Sibling; - TopSiblingComboBox.Text:=Sibling; - FillComboBoxWithSiblings(TopSiblingComboBox); - TopRefBottomSpeedButton.Enabled:=Sibling<>''; - TopRefBottomSpeedButton.Down:=(CurSide.Side=asrBottom); - TopRefCenterSpeedButton.Enabled:=Sibling<>''; - TopRefCenterSpeedButton.Down:=(CurSide.Side=asrCenter); - TopRefTopSpeedButton.Enabled:=Sibling<>''; - TopRefTopSpeedButton.Down:=(CurSide.Side=asrTop); + // Top + TopGroupBox.Enabled:=true; + CurSide:=Values.Sides[akTop]; + TopAnchoredCheckBox.AllowGrayed:=CurSide.AmbigiousEnabled; + if CurSide.AmbigiousEnabled then + TopAnchoredCheckBox.State:=cbGrayed + else + TopAnchoredCheckBox.Checked:=CurSide.Enabled; + if CurSide.AmbigiousBorderSpace then + TopBorderSpaceSpinEdit.Value:=-1 + else + TopBorderSpaceSpinEdit.Value:=CurSide.BorderSpace; + TopBorderSpaceSpinEdit.ValueEmpty:=CurSide.AmbigiousBorderSpace; + Sibling:=CurSide.Sibling; + TopSiblingComboBox.Text:=Sibling; + FillComboBoxWithSiblings(TopSiblingComboBox); + TopRefBottomSpeedButton.Enabled:=Sibling<>''; + TopRefBottomSpeedButton.Down:=(CurSide.Side=asrBottom); + TopRefCenterSpeedButton.Enabled:=Sibling<>''; + TopRefCenterSpeedButton.Down:=(CurSide.Side=asrCenter); + TopRefTopSpeedButton.Enabled:=Sibling<>''; + TopRefTopSpeedButton.Down:=(CurSide.Side=asrTop); - // Bottom - BottomGroupBox.Enabled:=true; - CurSide:=Values.Sides[akBottom]; - BottomAnchoredCheckBox.AllowGrayed:=CurSide.AmbigiousEnabled; - if CurSide.AmbigiousEnabled then - BottomAnchoredCheckBox.State:=cbGrayed - else - BottomAnchoredCheckBox.Checked:=CurSide.Enabled; - if CurSide.AmbigiousBorderSpace then - BottomBorderSpaceSpinEdit.Value:=-1 - else - BottomBorderSpaceSpinEdit.Value:=CurSide.BorderSpace; - BottomBorderSpaceSpinEdit.ValueEmpty:=CurSide.AmbigiousBorderSpace; - Sibling:=CurSide.Sibling; - BottomSiblingComboBox.Text:=Sibling; - FillComboBoxWithSiblings(BottomSiblingComboBox); - BottomRefBottomSpeedButton.Enabled:=Sibling<>''; - BottomRefBottomSpeedButton.Down:=(CurSide.Side=asrBottom); - BottomRefCenterSpeedButton.Enabled:=Sibling<>''; - BottomRefCenterSpeedButton.Down:=(CurSide.Side=asrCenter); - BottomRefTopSpeedButton.Enabled:=Sibling<>''; - BottomRefTopSpeedButton.Down:=(CurSide.Side=asrTop); + // Bottom + BottomGroupBox.Enabled:=true; + CurSide:=Values.Sides[akBottom]; + BottomAnchoredCheckBox.AllowGrayed:=CurSide.AmbigiousEnabled; + if CurSide.AmbigiousEnabled then + BottomAnchoredCheckBox.State:=cbGrayed + else + BottomAnchoredCheckBox.Checked:=CurSide.Enabled; + if CurSide.AmbigiousBorderSpace then + BottomBorderSpaceSpinEdit.Value:=-1 + else + BottomBorderSpaceSpinEdit.Value:=CurSide.BorderSpace; + BottomBorderSpaceSpinEdit.ValueEmpty:=CurSide.AmbigiousBorderSpace; + Sibling:=CurSide.Sibling; + BottomSiblingComboBox.Text:=Sibling; + FillComboBoxWithSiblings(BottomSiblingComboBox); + BottomRefBottomSpeedButton.Enabled:=Sibling<>''; + BottomRefBottomSpeedButton.Down:=(CurSide.Side=asrBottom); + BottomRefCenterSpeedButton.Enabled:=Sibling<>''; + BottomRefCenterSpeedButton.Down:=(CurSide.Side=asrCenter); + BottomRefTopSpeedButton.Enabled:=Sibling<>''; + BottomRefTopSpeedButton.Down:=(CurSide.Side=asrTop); - // Left - LeftGroupBox.Enabled:=true; - CurSide:=Values.Sides[akLeft]; - LeftAnchoredCheckBox.AllowGrayed:=CurSide.AmbigiousEnabled; - if CurSide.AmbigiousEnabled then - LeftAnchoredCheckBox.State:=cbGrayed - else - LeftAnchoredCheckBox.Checked:=CurSide.Enabled; - if CurSide.AmbigiousBorderSpace then - LeftBorderSpaceSpinEdit.Value:=-1 - else - LeftBorderSpaceSpinEdit.Value:=CurSide.BorderSpace; - LeftBorderSpaceSpinEdit.ValueEmpty:=CurSide.AmbigiousBorderSpace; - Sibling:=CurSide.Sibling; - LeftSiblingComboBox.Text:=Sibling; - FillComboBoxWithSiblings(LeftSiblingComboBox); - LeftRefRightSpeedButton.Enabled:=Sibling<>''; - LeftRefRightSpeedButton.Down:=(CurSide.Side=asrBottom); - LeftRefCenterSpeedButton.Enabled:=Sibling<>''; - LeftRefCenterSpeedButton.Down:=(CurSide.Side=asrCenter); - LeftRefLeftSpeedButton.Enabled:=Sibling<>''; - LeftRefLeftSpeedButton.Down:=(CurSide.Side=asrTop); + // Left + LeftGroupBox.Enabled:=true; + CurSide:=Values.Sides[akLeft]; + LeftAnchoredCheckBox.AllowGrayed:=CurSide.AmbigiousEnabled; + if CurSide.AmbigiousEnabled then + LeftAnchoredCheckBox.State:=cbGrayed + else + LeftAnchoredCheckBox.Checked:=CurSide.Enabled; + if CurSide.AmbigiousBorderSpace then + LeftBorderSpaceSpinEdit.Value:=-1 + else + LeftBorderSpaceSpinEdit.Value:=CurSide.BorderSpace; + LeftBorderSpaceSpinEdit.ValueEmpty:=CurSide.AmbigiousBorderSpace; + Sibling:=CurSide.Sibling; + LeftSiblingComboBox.Text:=Sibling; + FillComboBoxWithSiblings(LeftSiblingComboBox); + LeftRefRightSpeedButton.Enabled:=Sibling<>''; + LeftRefRightSpeedButton.Down:=(CurSide.Side=asrBottom); + LeftRefCenterSpeedButton.Enabled:=Sibling<>''; + LeftRefCenterSpeedButton.Down:=(CurSide.Side=asrCenter); + LeftRefLeftSpeedButton.Enabled:=Sibling<>''; + LeftRefLeftSpeedButton.Down:=(CurSide.Side=asrTop); - // Right - RightGroupBox.Enabled:=true; - CurSide:=Values.Sides[akRight]; - RightAnchoredCheckBox.AllowGrayed:=CurSide.AmbigiousEnabled; - if CurSide.AmbigiousEnabled then - RightAnchoredCheckBox.State:=cbGrayed - else - RightAnchoredCheckBox.Checked:=CurSide.Enabled; - if CurSide.AmbigiousBorderSpace then - RightBorderSpaceSpinEdit.Value:=-1 - else - RightBorderSpaceSpinEdit.Value:=CurSide.BorderSpace; - RightBorderSpaceSpinEdit.ValueEmpty:=CurSide.AmbigiousBorderSpace; - Sibling:=CurSide.Sibling; - RightSiblingComboBox.Text:=Sibling; - FillComboBoxWithSiblings(RightSiblingComboBox); - RightRefRightSpeedButton.Enabled:=Sibling<>''; - RightRefRightSpeedButton.Down:=(CurSide.Side=asrBottom); - RightRefCenterSpeedButton.Enabled:=Sibling<>''; - RightRefCenterSpeedButton.Down:=(CurSide.Side=asrCenter); - RightRefLeftSpeedButton.Enabled:=Sibling<>''; - RightRefLeftSpeedButton.Down:=(CurSide.Side=asrTop); - end; - finally - Values.Free; + // Right + RightGroupBox.Enabled:=true; + CurSide:=Values.Sides[akRight]; + RightAnchoredCheckBox.AllowGrayed:=CurSide.AmbigiousEnabled; + if CurSide.AmbigiousEnabled then + RightAnchoredCheckBox.State:=cbGrayed + else + RightAnchoredCheckBox.Checked:=CurSide.Enabled; + if CurSide.AmbigiousBorderSpace then + RightBorderSpaceSpinEdit.Value:=-1 + else + RightBorderSpaceSpinEdit.Value:=CurSide.BorderSpace; + RightBorderSpaceSpinEdit.ValueEmpty:=CurSide.AmbigiousBorderSpace; + Sibling:=CurSide.Sibling; + RightSiblingComboBox.Text:=Sibling; + FillComboBoxWithSiblings(RightSiblingComboBox); + RightRefRightSpeedButton.Enabled:=Sibling<>''; + RightRefRightSpeedButton.Down:=(CurSide.Side=asrBottom); + RightRefCenterSpeedButton.Enabled:=Sibling<>''; + RightRefCenterSpeedButton.Down:=(CurSide.Side=asrCenter); + RightRefLeftSpeedButton.Enabled:=Sibling<>''; + RightRefLeftSpeedButton.Down:=(CurSide.Side=asrTop); end; end; @@ -446,6 +488,26 @@ begin Refresh(false); end; +function TAnchorDesigner.GetSelectedControls: TList; +var + CurPersistent: TPersistent; + AControl: TControl; + i: Integer; +begin + Result:=nil; + GlobalDesignHook.GetSelection(FSelection); + if FSelection=nil then exit; + // collect values of selected controls + for i:=0 to FSelection.Count-1 do begin + CurPersistent:=FSelection[i]; + if CurPersistent is TControl then begin + AControl:=TControl(CurPersistent); + if Result=nil then Result:=TList.Create; + Result.Add(AControl); + end; + end; +end; + function TAnchorDesigner.ControlToStr(AControl: TControl): string; begin if AControl=nil then @@ -455,28 +517,28 @@ begin end; procedure TAnchorDesigner.CollectValues( - const ASelection: TPersistentSelectionList; var Values: TAnchorDesignerValues; + const ASelection: TList; var TheValues: TAnchorDesignerValues; var SelectedControlCount: integer); var - CurPersistent: TPersistent; i: Integer; AControl: TControl; + CurObject: TObject; begin - Values:=nil; + TheValues:=nil; SelectedControlCount:=0; - debugln('TAnchorDesigner.CollectValues A '); + //debugln('TAnchorDesigner.CollectValues A '); if ASelection=nil then exit; // collect values of selected controls for i:=0 to ASelection.Count-1 do begin - CurPersistent:=ASelection[i]; - debugln('TAnchorDesigner.CollectValues B ',dbgs(i),' ',DbgSName(CurPersistent)); - if CurPersistent is TControl then begin - AControl:=TControl(CurPersistent); + CurObject:=TObject(ASelection[i]); + //debugln('TAnchorDesigner.CollectValues B ',dbgs(i),' ',DbgSName(CurObject)); + if CurObject is TControl then begin + AControl:=TControl(CurObject); if SelectedControlCount=0 then begin - Values:=TAnchorDesignerValues.Create; - Values.SetValues(AControl); + TheValues:=TAnchorDesignerValues.Create; + TheValues.SetValues(AControl); end else begin - Values.MergeValues(AControl); + TheValues.MergeValues(AControl); end; inc(SelectedControlCount); end;