Fernando Silva Posted March 8 Share Posted March 8 I have a simple case of creating panels at runtime. The creation of the components works perfectly, the problem is in the ordering in which the unigui leaves them. Code: procedure TMainForm.UniButton1Click(Sender: TObject); var PnP: TUniPanel; I: integer; begin for I := 0 to 10 do begin PnP := TUniPanel.Create(self); PnP.Name := 'PnProg_' + I.ToString; PnP.Parent := SBPrincipal; PnP.Width := 232; PnP.Caption := 'Panel_' + I.ToString; PnP.CreateOrder := I; PnP.Align := alRight; PnP.Align := alLeft; end; end; Result: I've already tried to reorder them after they were created but I wasn't successful. Has anyone experienced this problem? PS: I tried the topic below and it didn't work: Attached the unigui project. The same code in a desktop application works normally. PanelsRT_Unigui.rar Quote Link to comment Share on other sites More sharing options...
mikromundo Posted March 9 Share Posted March 9 Take a test: Comment the lines with alLeft and alRight and check if it persists. Then comment only the line with alright. Quote Link to comment Share on other sites More sharing options...
Fernando Silva Posted March 9 Author Share Posted March 9 Hello @mikromundo. I don't understand your suggestion, if I comment on the alignment the panels will overlap. If I leave just the left one the problem is the same. Have you tried the example I shared? I know it seems like a simple problem, but it's not, I spent a lot of time testing the properties. A desktop Delphi project with the same code behaves correctly, it's some detail in unigui. Thanks. Quote Link to comment Share on other sites More sharing options...
mikromundo Posted March 10 Share Posted March 10 the suggestion was precisely to observe whether there really is a problem with the unigui or just an "unwanted effect" of the alignment. Quote Link to comment Share on other sites More sharing options...
mikromundo Posted March 10 Share Posted March 10 Put this: PnP.Left := i * PnP.width; PnP.Align := alRight; PnP.Align := alLeft; It will also be very useful for you to study Unigui's own alignment resources (see the demos). Unfortunately, I do not use them, because I needed to apply responsiveness (far beyond what exists natively) in Unigui and then I created "Radcore Project" to solve this and several other inconveniences. Quote Link to comment Share on other sites More sharing options...
Fernando Silva Posted March 11 Author Share Posted March 11 Hi @mikromundo, it worked using i *PnP.width; I was intrigued by the solution, thank you very much for the tip, it solved my problem. Congratulations on the Radcore project, I didn't know it, I was delighted with its practicality. I'll study a little more. Congratulations indeed!! 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.