In the designer, if I change the size of a container either by dragging the border or typing the new value in the dialog box, the container changes size and its components change size as well with everything remaining in prespective (layout set to relative).
But if I change the size of the container programatically (using fpmi.gui.resizeComponent(…)), then the container changes size but not the contents. If I also add code to loop through the contents and change the componets size at the same time, then I lose the relative positioning. What am I doing wrong?
Related to this, I found another anomaly: If I programatically disable a container (but not the components in the container), all of the components get disabled too. No big deal, even though that wasn’t my intention. But, when I enable the container again, all of the components stay disabled. The only way to get them enabled again is via the designer.
Yes, this is by design, its because of how security works. First of all, “enabled” means nothing for a container itself - it only affects the children.
When you set enabled=false, it disables all children. This is so that you can set security settings on a container and have it affect all children. The opposite is not true, however, because otherwise everything would always be enabled, because after all, the container above the container you disabled is probably enabled, and your container is a child of that container… I think you see the problem.
One technique I sometimes use is to toggle the Visible property of the container instead of the Enabled property. It avoids your original issue as all contained objects retain their original Visible property. This may or may not work for your particular case because you may want the objects to remain visible. You can graphically mimic the containers disabled status with a graphically identical but disabled container whose Visible property is opposite the original container.
I was making it both disabled and invisible, but making it just invisible should suffice. I remember once having a problem with an invisible button that was still enabled which is why I was disabling my container in this case, but I was probably doing something wrong back then.
Carl, I’ll replicate my test and get the exact conditions. Stay tuned…