This content has been marked as final. Show 8 replies
Try minwidth (all lower case).
Lower case didn't work Peter, and in the Extended Toolkit's reference, it's minWidth with a capital W.
Any other ideas? Is this even possible to size the Border Panel instead of the elements in it? I was just re-reading the help on it and it talks about boxes
Data Type: number
The width of the control. For an editbox or combobox, specifies the minimum width of the box.
Sizing depends on lots of things and there's lots of ways.
For containers, use preferredSize to set height and width to values. It will set the height and width to that setting as a minimum. If the contents of the container need to be larger, it will make the container larger.
If you want to have the container take up the available space (say there's another object not in the panel that makes the window wider/taller than the panel, you can set alignment = "fill";
And you can always use the window.onShow event to do final tweaks. One of my favorites is to replace the name of the panel with a checkbox. The panel is enabled if the checkbox is checked. To do that, use the onShow method to move the checkbox to the correct location.
I think Bob is talking about ScriptUI while Daniel is trying to use InDesign dialogs.
I'm not sure about the use of minWidth with Border Panels.
Ugh. "minwidth" should indeed be "minWidth": I consult3ed some code I have and the values I used with "minwidth" happened to be the default, so I never realised that JS ignored the values I gave it. It has been less than helpful in not producing an error. And Dave is right: minWidth works only as a specified value in textEditboxes.
You are right Dave, I am using InDesign dialogs since I must support CS2.
It's confusing since the help lists minWidth under BorderPanels and no error is generated, but it doesn't work. So far I've been using empty spaces in static texts to "space" things out and make them look nice, but because of font differences between Mac and PC, only one platform looks perfect, while the other doesn't. I hoped that sizing the borderPanel directly would allow both platforms to have things line up perfectly.
Maybe it's a bug that it doesn't work? Maybe it's not meant to? I surely can't figure it out
Thus, BorderPanel.minwidth = 6 won't cause an error, it'll just add a new property and give it the value 6.
That minWidth doesn't work for BorderPanels is a surprise to me. It's a long time since I did such a dialog though.
That's cool Dave, I didn't realize you could define your own properties like that. That explains the lack of an error and I'll have to keep that in mind for the future. Now if only we could get this built in minWidth property to work :)