mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-31 17:20:37 +02:00
parent
11f880e78a
commit
9ae2f80938
@ -183,7 +183,8 @@ var
|
||||
n: Integer;
|
||||
begin
|
||||
nm := PNMListView(AMessage.NMHdr);
|
||||
if nm^.iItem>=Items.Count then exit;
|
||||
// ignore any notifications while initializing items
|
||||
if (nm^.iItem>=Items.Count) or not (lisfWSItemsCreated in FListItems.Flags) then exit;
|
||||
//remark: NMHdr^.code is normally unhanged by the win32 interface, so the others
|
||||
// maps there codes to the of win32
|
||||
case AMessage.NMHdr^.code of
|
||||
@ -230,7 +231,6 @@ begin
|
||||
end;
|
||||
LVN_ITEMCHANGED: begin
|
||||
Item := Items[nm^.iItem];
|
||||
if not (lisfWSItemsCreated in FListItems.Flags) then Exit;
|
||||
//DebugLn('TCustomListView.CNNotify Count=',dbgs(Items.Count),' nm^.iItem=',dbgs(nm^.iItem),' destroying=',dbgs(lifDestroying in Item.FFlags));
|
||||
if (Item <> nil) and (not OwnerData) and (lifDestroying in Item.FFlags) then begin
|
||||
if Item=FFocused then
|
||||
|
@ -916,14 +916,17 @@ begin
|
||||
end;
|
||||
|
||||
procedure TCarbonDataBrowser.UpdateItems;
|
||||
var
|
||||
i : Integer;
|
||||
begin
|
||||
// removes all and adds new count of items starting with index 1
|
||||
{// removes all and adds new count of items starting with index 1
|
||||
OSError(RemoveDataBrowserItems(Widget, kDataBrowserNoItem, 0, nil, kDataBrowserItemNoProperty),
|
||||
Self, 'UpdateItems', 'RemoveDataBrowserItems');
|
||||
|
||||
if GetItemsCount <> 0 then
|
||||
OSError(AddDataBrowserItems(Widget, kDataBrowserNoItem, GetItemsCount, nil, kDataBrowserItemNoProperty),
|
||||
Self, 'UpdateItems', 'AddDataBrowserItems');
|
||||
Self, 'UpdateItems', 'AddDataBrowserItems');}
|
||||
for i:=0 to GetItemsCount-1 do UpdateItem(i);
|
||||
|
||||
CheckNeedsScrollBars;
|
||||
end;
|
||||
@ -1467,10 +1470,15 @@ begin
|
||||
end;
|
||||
|
||||
procedure TCarbonDataBrowser.InsertItem(AIndex: Integer);
|
||||
var
|
||||
Item : DataBrowserItemID;
|
||||
i : Integer;
|
||||
begin
|
||||
Item := GetItemsCount+1;
|
||||
FItemsCheck.Insert(AIndex, Pointer(False));
|
||||
|
||||
UpdateItems;
|
||||
OSError( AddDataBrowserItems(Widget, kDataBrowserNoItem, 1, @Item, kDataBrowserItemNoProperty),
|
||||
Self, 'InsertItem', 'AddDataBrowserItems');
|
||||
for i := AIndex to GetItemsCount-1 do UpdateItem(i);
|
||||
end;
|
||||
|
||||
procedure TCarbonDataBrowser.UpdateItem(AIndex: Integer);
|
||||
@ -1478,7 +1486,6 @@ var
|
||||
Item: DataBrowserItemID;
|
||||
begin
|
||||
Item := AIndex + 1;
|
||||
|
||||
OSError(UpdateDataBrowserItems(Widget, kDataBrowserNoItem, 1, @Item,
|
||||
kDataBrowserItemNoProperty, kDataBrowserNoItem),
|
||||
Self, 'UpdateItem', 'UpdateDataBrowserItems');
|
||||
|
Loading…
Reference in New Issue
Block a user