Form pack

Started by Nuno G., May 06, 2014, 11:11:55 AM

Previous topic - Next topic

Nuno G.

I wonder if it would possible to implement an equivalent to the Java JFrame.pack.
Sometimes one has the need to hide or show form elements depending on several conditions and it, now and then, it results on a very ugly form with lots of unnecessary empty spaces.
TIA

Leo S.

Hi Nuno, could you please post sample code of what you mean ?
Are you hiding/showing things at run time ?
Regards, Leo

Nuno G.

Hi Leo.
   I don't have any specific code sample to send you but the idea is the one you guessed: hide and show items at runtime. When you do so (and we do it a lot) forms get quite "empty" after hidding something and you would be nice to have a way to "repack" the interface after changes.
   But I must tell you I was not expecting a quick response to this subject, since, like we say around here, we can live quite nicely with it. It was just an idea to present to Fourjs in the hope that somewhere in the future we could see this features included in a new version.
   This said, thank you very much for you answer, but, I repeat, this is not an urgent matter.
   Best regards
   Nuno

Reuben B.

Nuno,

Neither of these match your requirement 100% but might be able to help ...

https://4js.com/online_documentation/fjs-gdc-manual-html/#c_gdc_NewFeatures221_save_restore_current_window_size.html

https://4js.com/online_documentation/fjs-gdc-manual-html/#c_gdc_NewFeatures230_adapt_window_to_new_form_size.html

... also how you design the form initially can influence what happens when you hide/show elements

Reuben
Product Consultant (Asia Pacific)
Developer Relations Manager (Worldwide)
Author of https://4js.com/ask-reuben
Contributor to https://github.com/FourjsGenero

Nuno G.

Thank you Leo!