mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-16 04:19:19 +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')
|
||||
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
|
||||
// move down (and others below us)
|
||||
for n := ANewPos downto 0 do
|
||||
begin
|
||||
child := TWinControlHack(AChildren[n]);
|
||||
if child.HandleAllocated then
|
||||
TGtkPrivateWidgetClass(
|
||||
child.WidgetSetClass.WSPrivate).SetZPosition(child, wszpBack);
|
||||
end;
|
||||
// simple
|
||||
Child := TWinControlHack(AChild);
|
||||
if ANewPos <= 0 then // bottom
|
||||
TGtkPrivateWidgetClass(
|
||||
Child.WidgetSetClass.WSPrivate).SetZPosition(Child, wszpBack)
|
||||
else
|
||||
TGtkPrivateWidgetClass(
|
||||
Child.WidgetSetClass.WSPrivate).SetZPosition(Child, wszpFront);
|
||||
end else
|
||||
begin
|
||||
// move up (and others above us)
|
||||
for n := ANewPos to AChildren.Count - 1 do
|
||||
for n := 1 to AChildren.Count - 1 do
|
||||
begin
|
||||
child := TWinControlHack(AChildren[n]);
|
||||
if child.HandleAllocated then
|
||||
Child := TWinControlHack(AChildren[n]);
|
||||
if Child.HandleAllocated then
|
||||
TGtkPrivateWidgetClass(
|
||||
child.WidgetSetClass.WSPrivate).SetZPosition(child, wszpFront);
|
||||
Child.WidgetSetClass.WSPrivate).SetZPosition(Child, wszpBack);
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
Loading…
Reference in New Issue
Block a user