* fix crash when setting MainColumn with handle not allocated. Issue 20228

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@2192 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
blikblum
2011-12-23 16:59:29 +00:00
parent 61ddb7a453
commit 1a2ef6e2ed

View File

@ -9218,12 +9218,17 @@ begin
if Value <> FMainColumn then
begin
FMainColumn := Value;
if not (csLoading in Treeview.ComponentState) then
if Treeview.HandleAllocated then
begin
Treeview.MainColumnChanged;
if not (toExtendedFocus in Treeview.FOptions.FSelectionOptions) then
Treeview.FocusedColumn := FMainColumn;
Treeview.FocusedColumn := Value;
Treeview.Invalidate;
end
else
begin
if not (toExtendedFocus in Treeview.FOptions.FSelectionOptions) then
Treeview.FFocusedColumn := Value;
end;
end;
end;