mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-09-11 18:39:05 +02:00
Implements freeing the accessibility object of individual TTreeView items
git-svn-id: trunk@34891 -
This commit is contained in:
parent
2fb60ec76d
commit
371b050768
@ -165,9 +165,16 @@ end;
|
|||||||
|
|
||||||
procedure TLazAccessibleObject.RemoveChildAccessibleObject(
|
procedure TLazAccessibleObject.RemoveChildAccessibleObject(
|
||||||
AObject: TLazAccessibleObject);
|
AObject: TLazAccessibleObject);
|
||||||
|
var
|
||||||
|
lIndex: Integer;
|
||||||
begin
|
begin
|
||||||
if FChildren = nil then Exit;
|
if FChildren = nil then Exit;
|
||||||
FChildren.Remove(@AObject);
|
lIndex := FChildren.IndexOf(AObject);
|
||||||
|
if lIndex >= 0 then
|
||||||
|
begin
|
||||||
|
TLazAccessibleObject(FChildren.Items[lIndex]).Free;
|
||||||
|
FChildren.Delete(lIndex);
|
||||||
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TLazAccessibleObject.GetChildAccessibleObject(AIndex: Integer): TLazAccessibleObject;
|
function TLazAccessibleObject.GetChildAccessibleObject(AIndex: Integer): TLazAccessibleObject;
|
||||||
|
@ -305,6 +305,8 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
destructor TTreeNode.Destroy;
|
destructor TTreeNode.Destroy;
|
||||||
|
var
|
||||||
|
lOwnerAccessibleObject, lAccessibleObject: TLazAccessibleObject;
|
||||||
begin
|
begin
|
||||||
{$IFDEF TREEVIEW_DEBUG}
|
{$IFDEF TREEVIEW_DEBUG}
|
||||||
DebugLn('[TTreeNode.Destroy] Self=',DbgS(Self),' Self.Text=',Text);
|
DebugLn('[TTreeNode.Destroy] Self=',DbgS(Self),' Self.Text=',Text);
|
||||||
@ -316,6 +318,15 @@ begin
|
|||||||
if Assigned(Owner) and Assigned(Owner.Owner) then
|
if Assigned(Owner) and Assigned(Owner.Owner) then
|
||||||
Owner.Owner.Delete(Self);
|
Owner.Owner.Delete(Self);
|
||||||
|
|
||||||
|
// Remove the accessibility object too
|
||||||
|
if Assigned(Owner) and Assigned(Owner.Owner) then
|
||||||
|
begin
|
||||||
|
lOwnerAccessibleObject := Owner.Owner.GetAccessibleObject();
|
||||||
|
lAccessibleObject := lOwnerAccessibleObject.GetChildAccessibleObjectWithDataObject(Self);
|
||||||
|
if lAccessibleObject <> nil then
|
||||||
|
lOwnerAccessibleObject.RemoveChildAccessibleObject(lAccessibleObject);
|
||||||
|
end;
|
||||||
|
|
||||||
// delete children
|
// delete children
|
||||||
HasChildren := false;
|
HasChildren := false;
|
||||||
// unbind all references
|
// unbind all references
|
||||||
|
Loading…
Reference in New Issue
Block a user