From a1ab1d8a9a0b19fc2f75705c01ae88a05ef738df Mon Sep 17 00:00:00 2001 From: Ansgar Becker Date: Wed, 8 Jul 2009 20:11:01 +0000 Subject: [PATCH] Data type selector: Do not set tree width to the parent column's width, which is mostly too small. Rather do an autofit on the first column so it's as wide as the text needs space. --- source/grideditlinks.pas | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/source/grideditlinks.pas b/source/grideditlinks.pas index d1dfe58e..170c6cad 100644 --- a/source/grideditlinks.pas +++ b/source/grideditlinks.pas @@ -1472,8 +1472,6 @@ begin FTreeSelect.TreeOptions.SelectionOptions := FTreeSelect.TreeOptions.SelectionOptions + [toFullRowSelect]; FTreeSelect.Header.Columns.Add; - FTreeSelect.Header.AutoSizeIndex := 0; - FTreeSelect.Header.Options := FTreeSelect.Header.Options + [hoAutoResize]; FTreeSelect.Parent := ParentControl; FTreeSelect.TextMargin := 0; FTreeSelect.RootNodeCount := Length(DatatypeCategories); @@ -1542,6 +1540,7 @@ begin end; CatNode := FTreeSelect.GetNextSibling(CatNode); end; + FTreeSelect.Header.AutoFitColumns(False, smaUseColumnOption, 0, 0); if Assigned(FTreeSelect.FocusedNode) then FTreeSelect.ScrollIntoView(FTreeSelect.FocusedNode, True); FTreeSelect.OnFocusChanging := DoTreeSelectFocusChanging; @@ -1598,7 +1597,7 @@ begin // Set position of tree. As the tree's parent is mainform, not listcolumns, add listcolumn's x + y positions FTreeSelect.SetBounds(R.Left + FTree.ClientOrigin.X, R.Top + FTree.ClientOrigin.Y - FTreeSelect.Header.Height - GetSystemMetrics(SM_CYMENU), - R.Right-R.Left, + FTreeSelect.Header.Columns[0].Width + GetSystemMetrics(SM_CXVSCROLL) + 5, 250); end;