From c767105ebbdbce893f3b546967692f29b81fed46 Mon Sep 17 00:00:00 2001 From: gambas Date: Mon, 4 Oct 2021 19:27:10 +0200 Subject: [PATCH] Form editor: When a container has "full" arrangement, keep the z-order of its children as defined by the user. [DEVELOPMENT ENVIRONMENT] * BUG: Form editor: When a container has "full" arrangement, keep the z-order of its children as defined by the user. --- app/src/gambas3/.src/Editor/Form/FForm.class | 58 +++++++++++--------- 1 file changed, 31 insertions(+), 27 deletions(-) diff --git a/app/src/gambas3/.src/Editor/Form/FForm.class b/app/src/gambas3/.src/Editor/Form/FForm.class index 87d747f01..40f5afbda 100644 --- a/app/src/gambas3/.src/Editor/Form/FForm.class +++ b/app/src/gambas3/.src/Editor/Form/FForm.class @@ -2098,38 +2098,42 @@ Private Sub ArrangeContainer(hParent As Container, sArr As String, Optional bInv $hUndo.Begin - For Each hCtrl In aCtrl - If bRec Then - Try hCont = hCtrl - If Not Error Then - ArrangeContainer(hCtrl, sArr, bInvert) - Endif - Endif - sKey = GetSortKey(hCtrl, sArr, bInvert) - cSortKey[hCtrl.Name] = sKey - aPos.Add(sKey) - If sLastKey And If sKey < sLastKey Then - bModify = True - Endif - sLastKey = sKey - Next + If sArr <> "F" Then - If aPos.Count Then - - aPos.Sort(gb.Descent) - - For Each sPos In aPos - For Each hCtrl In aCtrl - If cSortKey[hCtrl.Name] = sPos Then - hCtrl.Lower - Break + For Each hCtrl In aCtrl + If bRec Then + Try hCont = hCtrl + If Not Error Then + ArrangeContainer(hCtrl, sArr, bInvert) Endif - Next + Endif + sKey = GetSortKey(hCtrl, sArr, bInvert) + cSortKey[hCtrl.Name] = sKey + aPos.Add(sKey) + If sLastKey And If sKey < sLastKey Then + bModify = True + Endif + sLastKey = sKey Next - FFormStack.RefreshAll + If aPos.Count Then - If bModify Then Modify + aPos.Sort(gb.Descent) + + For Each sPos In aPos + For Each hCtrl In aCtrl + If cSortKey[hCtrl.Name] = sPos Then + hCtrl.Lower + Break + Endif + Next + Next + + FFormStack.RefreshAll + + If bModify Then Modify + + Endif Endif