MarcoC Posted May 1, 2023 Share Posted May 1, 2023 Hi all. I have an application with a form in which there is a TUniScrollBox (scrListaProdotti) the uses 90% of that form. When I create the form at runtime I populate the TUniScollbox with a number of TUniPanel's, using this code: aPnl := TUniPanel.Create(self); aPnl.Parent := scrListaProdotti; aPnl.Name := 'pnlLista' + aindex.tostring; aPnl.Align := TAlign.alTop; aPnl.AlwaysOnTop := FALSE; aPnl.Margins.Right := 15; aPnl.Height := 208; aPnl.Tag := aindex - 1; ...... Inside those panels I put a uniframe (TfrmGestOrdineList) per panel, using this code: aFrame := TfrmGestOrdineList.Create(self); aFrame.Parent := aPnl; aFrame.Name := 'frmPnlOrdine' + aindex.tostring; aFrame.Align := alClient; aFrame.lblTitoloAutore.Tag := aindex - 1; aFrame.Tag := aindex - 1; ...... This frame has ten labels, one combobox, two edits and a little image, that I initialize, all, immediatly after having created the frame inside the panel. The problem is: the application takes 2-3 minutes to show my form when I add 400 panels to the scrollbox: 0,3 - 0,4 seconds for the creation of a single panel seems to me a signal that something is not going as expected. I use Delphi 10.4.2 and, i think, the second last version of Unigui. May you help me? Thanks! Marco Quote Link to comment Share on other sites More sharing options...
Sherzod Posted May 1, 2023 Share Posted May 1, 2023 Hello, 30 minutes ago, cirirex said: I add 400 panels to the scrollbox Could you tell us why you have such logic? Quote Link to comment Share on other sites More sharing options...
MarcoC Posted May 1, 2023 Author Share Posted May 1, 2023 Hi Sherzod. I thought that creating panels and put inside each one a frame was a good choice, also for the speed of the creation of the whole form. And the scrollbox was the right choice, too, as container of a list of panels. I need from 2-5 to 400-500 items inside the scollbox because I need a list on that summary form for a selection of products (a cart for an online order), in particular a books list made by users of the website of one of my customers. I'm aware that is my first big project with Unigui, maybe there is an original sin in my logic (beacuse of my little experience with Unigui)? Hope to have answered to your question.. Thanks for your help. Marco Quote Link to comment Share on other sites More sharing options...
Sherzod Posted May 1, 2023 Share Posted May 1, 2023 Hi Marco, I think you can use UniDBGrid instead. Quote Link to comment Share on other sites More sharing options...
MarcoC Posted May 1, 2023 Author Share Posted May 1, 2023 Hi Sherzod. Attached is what my customer asked to see in his online order system, may you confirm if this is achievable with a UniDbGrid? Thanks! Marco Quote Link to comment Share on other sites More sharing options...
Sherzod Posted May 1, 2023 Share Posted May 1, 2023 Yes, it's possible, for example using custom XTemplate... Quote Link to comment Share on other sites More sharing options...
MarcoC Posted May 1, 2023 Author Share Posted May 1, 2023 Ok, I do not know what is a XTemplate: may you please point me to it? The subject of my post was also: what to do to speed up things if I'd have necessarily to use a TUniScrollList, so someone can send me tips or best practices if I'ìl have to fall back to that component? Thanks again. Marco Quote Link to comment Share on other sites More sharing options...
Sherzod Posted May 2, 2023 Share Posted May 2, 2023 10 hours ago, cirirex said: Ok, I do not know what is a XTemplate: may you please point me to it? Hello, There are solutions on the forum. Here is one of them, try it: Quote Link to comment Share on other sites More sharing options...
MarcoC Posted May 2, 2023 Author Share Posted May 2, 2023 Thank you Sherzod, I'm digging more in the Forum on the argument. Anyway, the video doesn't seem to be available at the moment. Marco Quote Link to comment Share on other sites More sharing options...
Sherzod Posted May 3, 2023 Share Posted May 3, 2023 Hi Marco, Yes, I know the video is not available. Take a look at the attached files at the end of the post. 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.