designer: don't skip controls with TabStop=False when writing TabOrder. Such controls can have another controls and skipping them can break desired order.

git-svn-id: trunk@18226 -
This commit is contained in:
paul 2009-01-09 17:35:02 +00:00
parent 84b988a827
commit e70dbcf2b1
3 changed files with 51 additions and 52 deletions

View File

@ -10,7 +10,6 @@ object TabOrderDialog: TTabOrderDialog
ClientWidth = 310 ClientWidth = 310
OnClose = TabOrderDialogCLOSE OnClose = TabOrderDialogCLOSE
OnCreate = TabOrderDialogCREATE OnCreate = TabOrderDialogCREATE
ParentFont = False
Position = poScreenCenter Position = poScreenCenter
LCLVersion = '0.9.27' LCLVersion = '0.9.27'
object ArrowUp: TSpeedButton object ArrowUp: TSpeedButton
@ -44,11 +43,12 @@ object TabOrderDialog: TTabOrderDialog
AnchorSideTop.Control = Owner AnchorSideTop.Control = Owner
AnchorSideBottom.Control = ShowOldValuesCheckbox AnchorSideBottom.Control = ShowOldValuesCheckbox
Left = 6 Left = 6
Height = 318 Height = 320
Top = 6 Top = 6
Width = 267 Width = 267
Anchors = [akTop, akLeft, akRight, akBottom] Anchors = [akTop, akLeft, akRight, akBottom]
BorderSpacing.Around = 6 BorderSpacing.Around = 6
Ctl3D = False
DefaultItemHeight = 15 DefaultItemHeight = 15
HideSelection = False HideSelection = False
ParentCtl3D = False ParentCtl3D = False
@ -60,9 +60,9 @@ object TabOrderDialog: TTabOrderDialog
AnchorSideLeft.Control = Owner AnchorSideLeft.Control = Owner
AnchorSideBottom.Control = CancelButton AnchorSideBottom.Control = CancelButton
Left = 6 Left = 6
Height = 19 Height = 17
Top = 330 Top = 332
Width = 146 Width = 141
Anchors = [akLeft, akBottom] Anchors = [akLeft, akBottom]
BorderSpacing.Around = 6 BorderSpacing.Around = 6
Caption = 'ShowOldValuesCheckbox' Caption = 'ShowOldValuesCheckbox'

View File

@ -5,38 +5,38 @@ LazarusResources.Add('TTabOrderDialog','FORMDATA',[
+#3'Top'#3#167#0#5'Width'#3'6'#1#13'ActiveControl'#7#12'ItemTreeview'#11'Bord' +#3'Top'#3#167#0#5'Width'#3'6'#1#13'ActiveControl'#7#12'ItemTreeview'#11'Bord'
+'erStyle'#7#13'bsSizeToolWin'#7'Caption'#6#14'TabOrderDialog'#12'ClientHeigh' +'erStyle'#7#13'bsSizeToolWin'#7'Caption'#6#14'TabOrderDialog'#12'ClientHeigh'
+'t'#3#131#1#11'ClientWidth'#3'6'#1#7'OnClose'#7#19'TabOrderDialogCLOSE'#8'On' +'t'#3#131#1#11'ClientWidth'#3'6'#1#7'OnClose'#7#19'TabOrderDialogCLOSE'#8'On'
+'Create'#7#20'TabOrderDialogCREATE'#10'ParentFont'#8#8'Position'#7#14'poScre' +'Create'#7#20'TabOrderDialogCREATE'#8'Position'#7#14'poScreenCenter'#10'LCLV'
+'enCenter'#10'LCLVersion'#6#6'0.9.27'#0#12'TSpeedButton'#7'ArrowUp'#23'Ancho' +'ersion'#6#6'0.9.27'#0#12'TSpeedButton'#7'ArrowUp'#23'AnchorSideRight.Contro'
+'rSideRight.Control'#7#5'Owner'#20'AnchorSideRight.Side'#7#9'asrBottom'#4'Le' +'l'#7#5'Owner'#20'AnchorSideRight.Side'#7#9'asrBottom'#4'Left'#3#23#1#6'Heig'
+'ft'#3#23#1#6'Height'#2#25#3'Top'#2'x'#5'Width'#2#25#7'Anchors'#11#5'akTop'#7 +'ht'#2#25#3'Top'#2'x'#5'Width'#2#25#7'Anchors'#11#5'akTop'#7'akRight'#0#20'B'
+'akRight'#0#20'BorderSpacing.Around'#2#6#5'Color'#7#9'clBtnFace'#9'NumGlyphs' +'orderSpacing.Around'#2#6#5'Color'#7#9'clBtnFace'#9'NumGlyphs'#2#0#7'OnClick'
+#2#0#7'OnClick'#7#18'UpSpeedbuttonCLICK'#0#0#12'TSpeedButton'#9'ArrowDown'#23 +#7#18'UpSpeedbuttonCLICK'#0#0#12'TSpeedButton'#9'ArrowDown'#23'AnchorSideRig'
+'AnchorSideRight.Control'#7#5'Owner'#20'AnchorSideRight.Side'#7#9'asrBottom' +'ht.Control'#7#5'Owner'#20'AnchorSideRight.Side'#7#9'asrBottom'#4'Left'#3#23
+#4'Left'#3#23#1#6'Height'#2#25#3'Top'#3#176#0#5'Width'#2#25#7'Anchors'#11#5 +#1#6'Height'#2#25#3'Top'#3#176#0#5'Width'#2#25#7'Anchors'#11#5'akTop'#7'akRi'
+'akTop'#7'akRight'#0#20'BorderSpacing.Around'#2#6#5'Color'#7#9'clBtnFace'#9 +'ght'#0#20'BorderSpacing.Around'#2#6#5'Color'#7#9'clBtnFace'#9'NumGlyphs'#2#0
+'NumGlyphs'#2#0#7'OnClick'#7#20'DownSpeedbuttonCLICK'#0#0#9'TTreeView'#12'It' +#7'OnClick'#7#20'DownSpeedbuttonCLICK'#0#0#9'TTreeView'#12'ItemTreeview'#22
+'emTreeview'#22'AnchorSideLeft.Control'#7#5'Owner'#21'AnchorSideTop.Control' +'AnchorSideLeft.Control'#7#5'Owner'#21'AnchorSideTop.Control'#7#5'Owner'#24
+#7#5'Owner'#24'AnchorSideBottom.Control'#7#21'ShowOldValuesCheckbox'#4'Left' +'AnchorSideBottom.Control'#7#21'ShowOldValuesCheckbox'#4'Left'#2#6#6'Height'
+#2#6#6'Height'#3'>'#1#3'Top'#2#6#5'Width'#3#11#1#7'Anchors'#11#5'akTop'#6'ak' +#3'@'#1#3'Top'#2#6#5'Width'#3#11#1#7'Anchors'#11#5'akTop'#6'akLeft'#7'akRigh'
+'Left'#7'akRight'#8'akBottom'#0#20'BorderSpacing.Around'#2#6#17'DefaultItemH' +'t'#8'akBottom'#0#20'BorderSpacing.Around'#2#6#5'Ctl3D'#8#17'DefaultItemHeig'
+'eight'#2#15#13'HideSelection'#8#11'ParentCtl3D'#8#16'RightClickSelect'#9#8 +'ht'#2#15#13'HideSelection'#8#11'ParentCtl3D'#8#16'RightClickSelect'#9#8'Tab'
+'TabOrder'#2#0#7'Options'#11#17'tvoAutoItemHeight'#21'tvoKeepCollapsedNodes' +'Order'#2#0#7'Options'#11#17'tvoAutoItemHeight'#21'tvoKeepCollapsedNodes'#19
+#19'tvoRightClickSelect'#14'tvoShowButtons'#12'tvoShowLines'#11'tvoShowRoot' +'tvoRightClickSelect'#14'tvoShowButtons'#12'tvoShowLines'#11'tvoShowRoot'#11
+#11'tvoToolTips'#0#0#0#9'TCheckBox'#21'ShowOldValuesCheckbox'#22'AnchorSideL' +'tvoToolTips'#0#0#0#9'TCheckBox'#21'ShowOldValuesCheckbox'#22'AnchorSideLeft'
+'eft.Control'#7#5'Owner'#24'AnchorSideBottom.Control'#7#12'CancelButton'#4'L' +'.Control'#7#5'Owner'#24'AnchorSideBottom.Control'#7#12'CancelButton'#4'Left'
+'eft'#2#6#6'Height'#2#19#3'Top'#3'J'#1#5'Width'#3#146#0#7'Anchors'#11#6'akLe' +#2#6#6'Height'#2#17#3'Top'#3'L'#1#5'Width'#3#141#0#7'Anchors'#11#6'akLeft'#8
+'ft'#8'akBottom'#0#20'BorderSpacing.Around'#2#6#7'Caption'#6#21'ShowOldValue' +'akBottom'#0#20'BorderSpacing.Around'#2#6#7'Caption'#6#21'ShowOldValuesCheck'
+'sCheckbox'#7'OnClick'#7#26'ShowOldValuesCheckboxCLICK'#8'TabOrder'#2#1#0#0#7 +'box'#7'OnClick'#7#26'ShowOldValuesCheckboxCLICK'#8'TabOrder'#2#1#0#0#7'TBit'
+'TBitBtn'#8'OkButton'#23'AnchorSideRight.Control'#7#12'CancelButton'#24'Anch' +'Btn'#8'OkButton'#23'AnchorSideRight.Control'#7#12'CancelButton'#24'AnchorSi'
+'orSideBottom.Control'#7#5'Owner'#21'AnchorSideBottom.Side'#7#9'asrBottom'#4 +'deBottom.Control'#7#5'Owner'#21'AnchorSideBottom.Side'#7#9'asrBottom'#4'Lef'
+'Left'#3#162#0#6'Height'#2#26#3'Top'#3'c'#1#5'Width'#2';'#7'Anchors'#11#7'ak' +'t'#3#162#0#6'Height'#2#26#3'Top'#3'c'#1#5'Width'#2';'#7'Anchors'#11#7'akRig'
+'Right'#8'akBottom'#0#8'AutoSize'#9#20'BorderSpacing.Around'#2#6#7'Caption'#6 +'ht'#8'akBottom'#0#8'AutoSize'#9#20'BorderSpacing.Around'#2#6#7'Caption'#6#3
+#3'&OK'#4'Kind'#7#4'bkOK'#11'ModalResult'#2#1#9'NumGlyphs'#2#0#7'OnClick'#7 +'&OK'#4'Kind'#7#4'bkOK'#11'ModalResult'#2#1#9'NumGlyphs'#2#0#7'OnClick'#7#13
+#13'OkButtonCLICK'#8'TabOrder'#2#2#0#0#7'TBitBtn'#12'CancelButton'#23'Anchor' +'OkButtonCLICK'#8'TabOrder'#2#2#0#0#7'TBitBtn'#12'CancelButton'#23'AnchorSid'
+'SideRight.Control'#7#5'Owner'#20'AnchorSideRight.Side'#7#9'asrBottom'#24'An' +'eRight.Control'#7#5'Owner'#20'AnchorSideRight.Side'#7#9'asrBottom'#24'Ancho'
+'chorSideBottom.Control'#7#5'Owner'#21'AnchorSideBottom.Side'#7#9'asrBottom' +'rSideBottom.Control'#7#5'Owner'#21'AnchorSideBottom.Side'#7#9'asrBottom'#4
+#4'Left'#3#227#0#6'Height'#2#26#3'Top'#3'c'#1#5'Width'#2'M'#7'Anchors'#11#7 +'Left'#3#227#0#6'Height'#2#26#3'Top'#3'c'#1#5'Width'#2'M'#7'Anchors'#11#7'ak'
+'akRight'#8'akBottom'#0#8'AutoSize'#9#20'BorderSpacing.Around'#2#6#6'Cancel' +'Right'#8'akBottom'#0#8'AutoSize'#9#20'BorderSpacing.Around'#2#6#6'Cancel'#9
+#9#7'Caption'#6#6'Cancel'#4'Kind'#7#8'bkCancel'#11'ModalResult'#2#2#9'NumGly' +#7'Caption'#6#6'Cancel'#4'Kind'#7#8'bkCancel'#11'ModalResult'#2#2#9'NumGlyph'
+'phs'#2#0#8'TabOrder'#2#3#0#0#0 +'s'#2#0#8'TabOrder'#2#3#0#0#0
]); ]);

View File

@ -161,19 +161,18 @@ var
AControl: TWinControl; AControl: TWinControl;
CurTabOrder: Integer; CurTabOrder: Integer;
begin begin
CurTabOrder:=0; CurTabOrder := 0;
while ANode<>nil do begin while ANode <> nil do
AControl:=TWinControl(ANode.Data); begin
if AControl.TabStop then begin AControl := TWinControl(ANode.Data);
if AControl.TabOrder<>CurTabOrder then if AControl.TabOrder <> CurTabOrder then
TabChanged:=true; TabChanged := True;
AControl.TabOrder:=TTabOrder(CurTabOrder); AControl.TabOrder := TTabOrder(CurTabOrder);
DebugLn('TTabOrderDialog.CommitNodes A ',AControl.Name,' ', //DebugLn('TTabOrderDialog.CommitNodes A ',AControl.Name,' ',
IntToStr(AControl.TabOrder),' ',IntToStr(CurTabOrder)); // IntToStr(AControl.TabOrder),' ',IntToStr(CurTabOrder));
inc(CurTabOrder); inc(CurTabOrder);
end; CommitNodes(ANode.GetFirstChild, TabChanged);
CommitNodes(ANode.GetFirstChild,TabChanged); ANode := ANode.GetNextSibling;
ANode:=ANode.GetNextSibling;
end; end;
end; end;