Jump to content


Photo

Form Create is Showing Form

Form Create Show

  • Please log in to reply
9 replies to this topic

#1 Mauricio Naozuka

Mauricio Naozuka

    Newbie

  • Members
  • Pip
  • 8 posts

Posted 19 December 2017 - 05:48 PM

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;
 
 

  • 0

#2 Stefano Monterisi

Stefano Monterisi

    Advanced Member

  • uniGUI Subscriber
  • PipPipPipPip
  • 121 posts

Posted 19 December 2017 - 06:07 PM

... and using a free datamodule?


  • 0

#3 Mauricio Naozuka

Mauricio Naozuka

    Newbie

  • Members
  • Pip
  • 8 posts

Posted 19 December 2017 - 06:13 PM

... and using a free datamodule?

 

There is not datamodule only a MainForm and a FreeForm for testing. 


  • 0

#4 Gustavo Déo

Gustavo Déo

    Member

  • Members
  • PipPip
  • 34 posts

Posted 19 December 2017 - 07:41 PM

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.


  • 0

#5 Mauricio Naozuka

Mauricio Naozuka

    Newbie

  • Members
  • Pip
  • 8 posts

Posted 20 December 2017 - 12:37 AM

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. 


  • 0

#6 Abaksoft

Abaksoft

    Advanced Member

  • uniGUI Subscriber
  • PipPipPipPip
  • 508 posts
  • LocationAlgeria

Posted 20 December 2017 - 02:59 PM

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.co...-at-runtime.htm

Edited :
Also, see the Reporting section :
http://www.unigui.co...rting-tools.htm
Regards
  • 0

#7 Mauricio Naozuka

Mauricio Naozuka

    Newbie

  • Members
  • Pip
  • 8 posts

Posted 21 December 2017 - 03:11 PM

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.co...-at-runtime.htm

Edited :
Also, see the Reporting section :
http://www.unigui.co...rting-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);
}

  • 0

#8 RafaelW

RafaelW

    Newbie

  • Members
  • Pip
  • 8 posts
  • LocationBrazil, PR

Posted 27 December 2017 - 01:14 PM

I think, using css

display: none;

 is better to hide forms


  • 0

#9 Mauricio Naozuka

Mauricio Naozuka

    Newbie

  • Members
  • Pip
  • 8 posts

Posted 27 December 2017 - 04:15 PM

I think, using css

display: none;

 is better to hide forms

 

How to do in Unigui? 


  • 0

#10 Mauricio Naozuka

Mauricio Naozuka

    Newbie

  • Members
  • Pip
  • 8 posts

Posted 08 January 2018 - 05:18 PM

The best solution 
 
On Form -> ClientEvents -> ExtEvents -> Add event window.afterrender: 
 
function window.afterrender(sender, eOpts)
{
   Ext.get(sender.id).setStyle('display', 'none');
}

  • 0




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users