From: Erik B. <eb...@us...> - 2006-07-28 02:53:25
|
Update of /cvsroot/gexperts/gexperts/unstable/Src In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv15228/Src Modified Files: GX_TabOrder.pas Log Message: Make tab ordering consider BiDiMode // Get the BiDiMode property for a VCL form function GxOtaGetFormBiDiMode(Form: IOTAFormEditor): TBiDiMode; Index: GX_TabOrder.pas =================================================================== RCS file: /cvsroot/gexperts/gexperts/unstable/Src/GX_TabOrder.pas,v retrieving revision 1.28 retrieving revision 1.29 diff -u -d -r1.28 -r1.29 --- GX_TabOrder.pas 14 Jul 2004 15:39:26 -0000 1.28 +++ GX_TabOrder.pas 28 Jul 2006 02:52:55 -0000 1.29 @@ -28,6 +28,7 @@ procedure btnResetOrderClick(Sender: TObject); private FormEditor: IOTAFormEditor; + FBiDiMode: TBiDiMode; procedure ChildComponentCallback(Param: Pointer; Component: IOTAComponent; var Result: Boolean); procedure SelectCurrentComponent; procedure FillTreeView(FromComponent: IOTAComponent); @@ -126,27 +127,30 @@ function CustomSortProcByPos(Node1, Node2: TTreeNode; Data: Integer): Integer; stdcall; begin Result := 0; - if Assigned(Node1) and Assigned(Node2) and Assigned(Node1.Data) and Assigned(Node2.Data)then + if Assigned(Node1) and Assigned(Node2) and Assigned(Node1.Data) and Assigned(Node2.Data) then begin Result := TComponentData(Node1.Data).Y - TComponentData(Node2.Data).Y; if Result = 0 then - Result := TComponentData(Node1.Data).X - TComponentData(Node2.Data).X; + begin + if TBiDiMode(Data) in [bdRightToLeft, bdRightToLeftNoAlign, bdRightToLeftReadingOnly] then + Result := TComponentData(Node2.Data).X - TComponentData(Node1.Data).X + else + Result := TComponentData(Node1.Data).X - TComponentData(Node2.Data).X; + end; end; end; function CustomSortProcByTabOrder(Node1, Node2: TTreeNode; Data: Integer): Integer; stdcall; begin Result := 0; - if Assigned(Node1) and Assigned(Node2) and Assigned(Node1.Data) and Assigned(Node2.Data)then - begin + if Assigned(Node1) and Assigned(Node2) and Assigned(Node1.Data) and Assigned(Node2.Data) then Result := TComponentData(Node1.Data).TabOrder - TComponentData(Node2.Data).TabOrder; - end; end; procedure TfmTabOrder.SortTreeViewComponentsByXYPosition; begin {$T-} - tvComps.CustomSort(@CustomSortProcByPos, 0); + tvComps.CustomSort(@CustomSortProcByPos, Ord(FBiDiMode)); {$T+} end; @@ -373,6 +377,7 @@ end else begin + TabOrderForm.FBiDiMode := GxOtaGetFormBiDiMode(FormEditor); TabOrderForm.FillTreeView(AComponent); TabOrderForm.SortTreeViewComponentsByXYPosition; end; |