naozuka Posted December 19, 2017 Share Posted December 19, 2017 I'm having a problem but I don't know if it's common on Unigui. When I call Create of a form, it's showing it but I don't want to. It's a form that have my report component (QuickReport) and it's just a container form. I already tried without any components and the same result. procedure TMainForm.UniButton1Click(Sender: TObject); var form: TUniForm; begin form := TUniForm.Create(UniApplication); // It's creating and showing the form here. end; Quote Link to comment Share on other sites More sharing options...
Stemon63 Posted December 19, 2017 Share Posted December 19, 2017 ... and using a free datamodule? Quote Link to comment Share on other sites More sharing options...
naozuka Posted December 19, 2017 Author Share Posted December 19, 2017 ... and using a free datamodule? There is not datamodule only a MainForm and a FreeForm for testing. Quote Link to comment Share on other sites More sharing options...
Gustavo.deo Posted December 19, 2017 Share Posted December 19, 2017 There is not datamodule only a MainForm and a FreeForm for testing. If you created a Unigui project, a MainModule is automatically created ... In this MainModule you must set to true the EnableSyncronousoperations property in the MainModule. Quote Link to comment Share on other sites More sharing options...
naozuka Posted December 20, 2017 Author Share Posted December 20, 2017 If you created a Unigui project, a MainModule is automatically created ... In this MainModule you must set to true the EnableSyncronousoperations property in the MainModule. Already tried that. Quote Link to comment Share on other sites More sharing options...
Abaksoft Posted December 20, 2017 Share Posted December 20, 2017 I'm having a problem but I don't know if it's common on Unigui. When I call Create of a form, it's showing it but I don't want to. It's a form that have my report component (QuickReport) and it's just a container form. I already tried without any components and the same result. procedure TMainForm.UniButton1Click(Sender: TObject); var form: TUniForm; begin form := TUniForm.Create(UniApplication); // It's creating and showing the form here. end; Yes, it's common behavior to unigui.On the online doc : "4.Forms must be shown after they are created. A form can not be created now and shown later." http://www.unigui.com/doc/online_help/creating-controls-at-runtime.htm Edited : Also, see the Reporting section : http://www.unigui.com/doc/online_help/reporting-tools.htm Regards Quote Link to comment Share on other sites More sharing options...
naozuka Posted December 21, 2017 Author Share Posted December 21, 2017 Yes, it's common behavior to unigui. On the online doc : "4.Forms must be shown after they are created. A form can not be created now and shown later." http://www.unigui.com/doc/online_help/creating-controls-at-runtime.htm Edited : Also, see the Reporting section : http://www.unigui.com/doc/online_help/reporting-tools.htm Regards Thank you Abaksoft. That is what I was afraid of. Maybe someone can help with some CSS to hide the form? I did one "McGyverism" but that was not elegant. On FormCreate: Self.Width := 1; Self.Height := 1; On ExtEvents: function window.afterrender(sender, eOpts) { Ext.get(sender.id).el.setStyle("padding", 0); Ext.get(sender.id).el.setStyle("border-width", 0); Ext.get(sender.id).el.setStyle("-webkit-border-radius", 0); Ext.get(sender.id).el.setStyle("-moz-border-radius", 0); Ext.get(sender.id).el.setStyle("border-radius", 0); Ext.get(sender.id).el.setStyle("height", 0); Ext.get(sender.id).el.setStyle("width", 0); } Quote Link to comment Share on other sites More sharing options...
RafaelW Posted December 27, 2017 Share Posted December 27, 2017 I think, using css display: none; is better to hide forms Quote Link to comment Share on other sites More sharing options...
naozuka Posted December 27, 2017 Author Share Posted December 27, 2017 I think, using css display: none; is better to hide forms How to do in Unigui? Quote Link to comment Share on other sites More sharing options...
naozuka Posted January 8, 2018 Author Share Posted January 8, 2018 The best solution On Form -> ClientEvents -> ExtEvents -> Add event window.afterrender: function window.afterrender(sender, eOpts) { Ext.get(sender.id).setStyle('display', 'none'); } 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.