From 8b5fdfc0d42da35f2913efc88482dec0d7fd2273 Mon Sep 17 00:00:00 2001 From: paul Date: Mon, 23 Nov 2009 07:15:32 +0000 Subject: [PATCH] lcl: ShellListView, don't use OnResize event, override Resize method git-svn-id: trunk@22718 - --- lcl/shellctrls.pas | 53 ++++++++++++++++++++++------------------------ 1 file changed, 25 insertions(+), 28 deletions(-) diff --git a/lcl/shellctrls.pas b/lcl/shellctrls.pas index 4641af6019..5ba8dfd7cc 100644 --- a/lcl/shellctrls.pas +++ b/lcl/shellctrls.pas @@ -144,11 +144,10 @@ type procedure SetMask(const AValue: string); procedure SetShellTreeView(const Value: TCustomShellTreeView); procedure SetRoot(const Value: string); - { Other internal methods } - procedure HandleResize(Sender: TObject); protected { Methods specific to Lazarus } procedure PopulateWithRoot(); + procedure Resize; override; public { Basic methods } constructor Create(AOwner: TComponent); override; @@ -536,28 +535,6 @@ begin end; end; -procedure TCustomShellListView.HandleResize(Sender: TObject); -begin - {$ifdef DEBUG_SHELLCTRLS} - WriteLn(':>TCustomShellListView.HandleResize'); - {$endif} - - // The correct check is with count, - // if Column[0] <> nil then - // will raise an exception - if Self.Columns.Count < 3 then Exit; - - Column[0].Width := (70 * Width) div 100; - Column[1].Width := (15 * Width) div 100; - Column[2].Width := (15 * Width) div 100; - - {$ifdef DEBUG_SHELLCTRLS} - WriteLn(':TCustomShellListView.HandleResize'); + {$endif} + + // The correct check is with count, + // if Column[0] <> nil then + // will raise an exception + if Self.Columns.Count < 3 then Exit; + + Column[0].Width := (70 * Width) div 100; + Column[1].Width := (15 * Width) div 100; + Column[2].Width := (15 * Width) div 100; + + {$ifdef DEBUG_SHELLCTRLS} + WriteLn(':