Jump to content
uniGUI Discussion Forums
naozuka

Form Create is Showing Form

Recommended Posts

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;
 
 

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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. 

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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.  :wacko:

 

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);
}

Share this post


Link to post
Share on other sites
The best solution 

 

On Form -> ClientEvents -> ExtEvents -> Add event window.afterrender: 

 

function window.afterrender(sender, eOpts)

{

   Ext.get(sender.id).setStyle('display', 'none');

}

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×