cyracks Posted August 12, 2021 Share Posted August 12, 2021 Hello, what is the proper way to show form after all elements on the form are aligned. I do not want for user to see how elements of the form jump up/down left right when form is first shown. Ideally would be that mask is shown until all elements are aligned and only then user can interact with a form. Regards 1 Quote Link to comment Share on other sites More sharing options...
cyracks Posted August 13, 2021 Author Share Posted August 13, 2021 One way to do it is: 1) make most bottom component/s invisible (for example PanelMain), so that required(all) components are hidden, when form is shown 2) Add timer and set interval to something small, for example 50 3) On event FormShow activate timer 4) OnTimer set bottom (PanelMain) component visible - components are aligned when form is shown even if they are invisible. Quote Link to comment Share on other sites More sharing options...
mikromundo Posted August 14, 2021 Share Posted August 14, 2021 Organizacao Apos abrir formulario.mp4 @cyracks Is that what you're talking about? Quote Link to comment Share on other sites More sharing options...
Abaksoft Posted August 14, 2021 Share Posted August 14, 2021 On 8/13/2021 at 12:26 AM, cyracks said: Hello, what is the proper way to show form after all elements on the form are aligned. I do not want for user to see how elements of the form jump up/down left right when form is first shown. Ideally would be that mask is shown until all elements are aligned and only then user can interact with a form. Regards Did you try : SuspendLayouts http://forums.unigui.com/index.php?/topic/5715-performance-when-creating-controls-dynamically/&do=findComment&comment=81823 See doc : http://www.unigui.com/doc/online_help/creating--destroying-many-cont.htm Quote Link to comment Share on other sites More sharing options...
Sherzod Posted August 15, 2021 Share Posted August 15, 2021 On 8/14/2021 at 12:45 AM, cyracks said: One way to do it is: 1) make most bottom component/s invisible (for example PanelMain), so that required(all) components are hidden, when form is shown 2) Add timer and set interval to something small, for example 50 3) On event FormShow activate timer 4) OnTimer set bottom (PanelMain) component visible - components are aligned when form is shown even if they are invisible. Another trick: 1. MainForm -> ClientEvents -> UniEvents -> Ext.container.Viewport[viewport] -> function viewport.beforeInit(sender, config) { config.style='opacity: 0'; } 2. MainForm -> OnReady event -> procedure TMainForm.UniFormReady(Sender: TObject); begin UniSession.AddJS('Ext.defer(function(){'+ Self.Name +'.viewport.animate({to: {opacity: 1}, duration:1000})}, 1000)'); end; Quote Link to comment Share on other sites More sharing options...
cyracks Posted August 15, 2021 Author Share Posted August 15, 2021 3 hours ago, Sherzod said: Another trick: 1. MainForm -> ClientEvents -> UniEvents -> Ext.container.Viewport[viewport] -> function viewport.beforeInit(sender, config) { config.style='opacity: 0'; } 2. MainForm -> OnReady event -> procedure TMainForm.UniFormReady(Sender: TObject); begin UniSession.AddJS('Ext.defer(function(){'+ Self.Name +'.viewport.animate({to: {opacity: 1}, duration:1000})}, 1000)'); end; Good option, do you maybe know how to add this globally so it applies to all forms ? 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.