formwidth not working correct

Discuss all feature requests you have for a new Servoy versions here. Make sure to be clear about what you want, provide an example and indicate how important the feature is for you

formwidth not working correct

Postby Boudewijn » Sun Feb 13, 2011 11:52 am

When resizing a form the formwidth stops adjusting itself when the form becomes smaller (in runtime) than the original design.
eg, I create a form with a width of 500.
On the form I have a textbox

in the form resize event I have some code like:
Code: Select all
forms["testform"].elements["lblFrmWidth"].text = "form: " + forms.testform.controller.getFormWidth()

//preferred code would be this.lblfrmWidth.text = ...
:D

the label shows the formwidth, unless the form is smaller than the original design.
EXTENDING the form beyond its original width gives the correct values.
I guess that is an omission.
Boudewijn
 
Posts: 41
Joined: Sun Sep 26, 2010 8:35 am

Re: formwidth not working correct

Postby Boudewijn » Sun Feb 13, 2011 11:59 am

Correction, the textbox is not a textbox but a label (duuuhhh) :)
Boudewijn
 
Posts: 41
Joined: Sun Sep 26, 2010 8:35 am

Re: formwidth not working correct

Postby ROCLASI » Sun Feb 13, 2011 12:38 pm

Hi Boudewijn,

A form will only grow when you resize a window/tabpanel. When you make the window/tabpanel smaller than the original size of the form at design time then you end up with scrollbars (unless you disabled those on the form).
If you don't want that then you have 2 options:
1) you make the form really small at design time
2) you add an onResize() event where you dynamically adjust the size of the form using the SolutionModel.

Hope this helps.
Robert Ivens
SAN Developer / Servoy Valued Professional / Servoy Certified Developer

ROCLASI Software Solutions / JBS Group, Partner
Mastodon: @roclasi
--
ServoyForge - Building Open Source Software.
PostgreSQL - The world's most advanced open source database.
User avatar
ROCLASI
Servoy Expert
 
Posts: 5438
Joined: Thu Oct 02, 2003 9:49 am
Location: Netherlands/Belgium

Re: formwidth not working correct

Postby Boudewijn » Sun Feb 13, 2011 11:32 pm

All in all, it does NOT show the correct size. and resizing means exactly that. the form is resized, no matter whether the form is bigger or smaller than its designed width.
so it IS an omission.

BL
Boudewijn
 
Posts: 41
Joined: Sun Sep 26, 2010 8:35 am

Re: formwidth not working correct

Postby ROCLASI » Sun Feb 13, 2011 11:54 pm

Hi Boudewijn,

When you resize your window the form shrinks up to the size of the size you designed it for, after this the window will show a scrollbar (since the form isn't getting smaller). So it's showing the correct size alright.
The only thing is that you expect that the form will resize to a smaller size than you designed it at.
Consider the width of the form at design time the minimum width of the form. It will never (automatically) get smaller than that.

Hope this helps.
Robert Ivens
SAN Developer / Servoy Valued Professional / Servoy Certified Developer

ROCLASI Software Solutions / JBS Group, Partner
Mastodon: @roclasi
--
ServoyForge - Building Open Source Software.
PostgreSQL - The world's most advanced open source database.
User avatar
ROCLASI
Servoy Expert
 
Posts: 5438
Joined: Thu Oct 02, 2003 9:49 am
Location: Netherlands/Belgium

Re: formwidth not working correct

Postby Boudewijn » Mon Feb 14, 2011 12:09 am

Seems like we will never agree on this. formwidth should show just that. the form's width, because that is what the name of the property says "form width. no matter what it was designed for first. so even if the form, @ runtime, is made smaller than its original design "formwidth" shoul;d show the actual width, and not the design time width. that is of no matter at all.
Boudewijn
 
Posts: 41
Joined: Sun Sep 26, 2010 8:35 am

Re: formwidth not working correct

Postby pbakker » Mon Feb 14, 2011 11:25 am

Boudewijn,

Robert is 100% correct: the form width is reported 100% correct, because the form is NEVER going to become smaller as you designed it, it will only become bigger.

When you show the form in a "container", the container the form is shown in might become smaller, but the form will not become smaller. Based on the settings, there will be scrollbars or not.

Paul
pbakker
 
Posts: 2822
Joined: Wed Oct 01, 2003 8:12 pm
Location: Amsterdam, the Netherlands

Re: formwidth not working correct

Postby Boudewijn » Mon Feb 28, 2011 10:18 am

hey Paul,

You state: because the form is NEVER going to become smaller as you designed it

and what If I want to automatically adjust the form to the screen settings of the user?
Should I telll them to buy new screens so they match my screens (2*24")

I think that would not make me very popular... Much like MS telling people to buy a new PC if they want to switch from XP to WIn 7
What I mean is that if the USER wants to make the form smaller (because they have smaller screen attached to the computer) than the original layout I want all controls on it adjusted accordingly (using anchors) and not bother the user with scrollbars.
Last edited by Boudewijn on Mon Feb 28, 2011 10:38 am, edited 1 time in total.
Boudewijn
 
Posts: 41
Joined: Sun Sep 26, 2010 8:35 am

Re: formwidth not working correct

Postby pbakker » Mon Feb 28, 2011 10:27 am

No Boudewijn,

You design for the minimal resolution you want your application to support and let it grow from there.

You see this in any application: when you make the window smaller and smaller, at a certain point you'll get scrollbars (or the content just goes off screen and the user cannot access it anymore, without making it bigger).

Of course you can always do your own layout in the onResize event and through the solutionModel you can change every aspect of the Form and it's elements. So you have complete freedom to do things as you like.

Paul
pbakker
 
Posts: 2822
Joined: Wed Oct 01, 2003 8:12 pm
Location: Amsterdam, the Netherlands


Return to Discuss Feature Requests

Who is online

Users browsing this forum: No registered users and 10 guests