mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-24 12:00:42 +02:00
Gtk2: fixed TGtk2WSWinControl.SetChildZPosition(). fixes #17298
git-svn-id: trunk@27269 -
This commit is contained in:
parent
4cc5ab25bf
commit
f2e1d9f50b
@ -617,25 +617,27 @@ begin
|
|||||||
if not WSCheckHandleAllocated(AWincontrol, 'SetChildZPosition')
|
if not WSCheckHandleAllocated(AWincontrol, 'SetChildZPosition')
|
||||||
then Exit;
|
then Exit;
|
||||||
|
|
||||||
if ANewPos < AChildren.Count div 2 then
|
if not WSCheckHandleAllocated(AChild, 'SetChildZPosition (child)') then
|
||||||
|
Exit;
|
||||||
|
|
||||||
|
if (ANewPos <= 0) or (ANewPos >= AChildren.Count - 1) then
|
||||||
begin
|
begin
|
||||||
// move down (and others below us)
|
// simple
|
||||||
for n := ANewPos downto 0 do
|
Child := TWinControlHack(AChild);
|
||||||
begin
|
if ANewPos <= 0 then // bottom
|
||||||
child := TWinControlHack(AChildren[n]);
|
TGtkPrivateWidgetClass(
|
||||||
if child.HandleAllocated then
|
Child.WidgetSetClass.WSPrivate).SetZPosition(Child, wszpBack)
|
||||||
TGtkPrivateWidgetClass(
|
else
|
||||||
child.WidgetSetClass.WSPrivate).SetZPosition(child, wszpBack);
|
TGtkPrivateWidgetClass(
|
||||||
end;
|
Child.WidgetSetClass.WSPrivate).SetZPosition(Child, wszpFront);
|
||||||
end else
|
end else
|
||||||
begin
|
begin
|
||||||
// move up (and others above us)
|
for n := 1 to AChildren.Count - 1 do
|
||||||
for n := ANewPos to AChildren.Count - 1 do
|
|
||||||
begin
|
begin
|
||||||
child := TWinControlHack(AChildren[n]);
|
Child := TWinControlHack(AChildren[n]);
|
||||||
if child.HandleAllocated then
|
if Child.HandleAllocated then
|
||||||
TGtkPrivateWidgetClass(
|
TGtkPrivateWidgetClass(
|
||||||
child.WidgetSetClass.WSPrivate).SetZPosition(child, wszpFront);
|
Child.WidgetSetClass.WSPrivate).SetZPosition(Child, wszpBack);
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
Loading…
Reference in New Issue
Block a user