mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-19 22:49:30 +02:00
- fixed doubling of columns if ListView handle had been created during load process (report 0008794)
git-svn-id: trunk@11056 -
This commit is contained in:
parent
32a03c1212
commit
ecd9cd39c7
@ -728,6 +728,7 @@ type
|
||||
FTag: Integer;
|
||||
function GetWidth: TWidth;
|
||||
procedure WSCreateColumn;
|
||||
procedure WSDestroyColumn;
|
||||
function WSUpdateAllowed: Boolean;
|
||||
procedure SetVisible(const AValue: Boolean);
|
||||
procedure SetAutoSize(const AValue: Boolean);
|
||||
|
@ -101,6 +101,16 @@ begin
|
||||
WSC.ColumnSetVisible(LV, Index, Self, FVisible);
|
||||
end;
|
||||
|
||||
procedure TListColumn.WSDestroyColumn;
|
||||
var
|
||||
LV: TCustomListView;
|
||||
WSC: TWSCustomListViewClass;
|
||||
begin
|
||||
LV := TListColumns(Collection).FOwner;
|
||||
WSC := TWSCustomListViewClass(LV.WidgetSetClass);
|
||||
WSC.ColumnDelete(LV, Index);
|
||||
end;
|
||||
|
||||
function TListColumn.WSUpdateAllowed: Boolean;
|
||||
begin
|
||||
Result := (Collection <> nil)
|
||||
|
@ -98,7 +98,11 @@ procedure TListColumns.WSCreateColumns;
|
||||
var
|
||||
n: Integer;
|
||||
begin
|
||||
for n :=0 to Count - 1 do
|
||||
// remove columns at first if exists to prevent doubling them
|
||||
for n := Count - 1 downto 0 do
|
||||
GetItem(n).WSDestroyColumn;
|
||||
|
||||
for n := 0 to Count - 1 do
|
||||
GetItem(n).WSCreateColumn;
|
||||
end;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user