I use the following method to automatically adjust the size of a tabpanel on a form to the current window size:
var width = application.getWindowWidth()
var height = application.getWindowHeight()
//set Tab Panel Size
elements.tabs_70.setSize(width -200,height-225)
// set top bar width
elements.topbar.setSize(width-180, 32)
// set header size
elements.formHeader.setSize(width-200, 40)
However, when the user re-sizes the window after it is displayed, the window is not re-drawn. Is there now, or will there be in the future an event such as
onWindowReSize
that can be used to fire a method and adjust the tabpanel to the new size.
Am I going about this in the right way to begin with?
I’ve tried them, and have given up in despair! I have been able to set the tabpanel to grow to the re-sized window, but when you reduce the size of the window the tabpanel will not shrink- it is truncated. Perhaps I’m not doing it properly:
I’ve set the anchors to Top,right,bottom,left and
print sliding to allow shrink and grow both horizontal and vertical (although I don’t think this has any effect on the display)
When I set the size of the tab panel by method, both horizontal and vertical are correct, just not re-drawn automatically after re-sizing.
Another problem when using anchors is: I have a label 850x40 that I use as a heading at the top of the form. When I re-size the window, the size increases in both directions. How do I use anchors to only allow the width to grow, but the height to remain the same?
DFehrenbach:
I’ve tried them, and have given up in despair! I have been able to set the tabpanel to grow to the re-sized window, but when you reduce the size of the window the tabpanel will not shrink- it is truncated. Perhaps I’m not doing it properly:
An object will not get smaller then it’s initial size (the one you set in Designer mode). So if you want it to get smaller you have to make it smaller in designer mode. This also applies on forms (width/height).
DFehrenbach:
I’ve set the anchors to Top,right,bottom,left and
print sliding to allow shrink and grow both horizontal and vertical (although I don’t think this has any effect on the display)
When I set the size of the tab panel by method, both horizontal and vertical are correct, just not re-drawn automatically after re-sizing.
Print sliding has only effect on, like the name implies, printing.
When the screen doesn’t update with your method then you can always force a redraw with Application.updateUI.
DFehrenbach:
Another problem when using anchors is: I have a label 850x40 that I use as a heading at the top of the form. When I re-size the window, the size increases in both directions. How do I use anchors to only allow the width to grow, but the height to remain the same?
Just don’t use an anchor on the bottom. Then the height will stay the same.