On Mar 23, 2007, at 11:22 AM, Will Brady wrote:

> I am trying to create a form with a panel that is sized with a  
> specific
> width and height. I added a panel to the form and I am trying to  
> figure out
> how to resize it. I cannot manually change the width and height  
> properties
> of the panel from the properties window. I haven't found anyway to  
> drag the
> corners of the panel to the size I'm looking for either. All I have  
> figured
> out is that the expand property will make it fill the screen and  
> when the
> expand property is off it shrinks to this tiny column that I can't  
> figure
> out how to change either. I'm sure somebody knows the solution to this
> problem.

        Right now if you are using a form with sizers to control the layout,  
the Height and Width properties are disabled. Why? Because they were  
causing too much confusion among people who were new to sizers,  
expecting the sizer to then ignore that control. When I added non- 
sizer-based forms to the Designer, I thought about enabling those  
properties, but never got around to it.

        Here are the short-term solutions:

1) Save the design, open the .cdxml file in a text editor, and  
manually add the attributes to the panel. Be sure to add the double  
quotes around the values: Width="200" Height="100". Now re-open the  
design in the Class Designer.

2) while the design is running, press Ctrl-D to bring up the Command  
Window. Position it so that you can see the panel in the design  
surface. Without clicking, just place the mouse over the panel, and  
then type in the Command Window:
o = dabo.ui.getMouseObject()
o.Width = 200
o.Height = 100
# or just type:
o.Size = (200, 100)

        Either way, you will now have your panel with the desired size. Make  
sure that its sizer settings are Proportion=0, Expand=False so that  
the sizer doesn't try to resize it.

        Longer term, I'd be interested in hearing what people think about re- 
enabling manually setting size from the property sheet. Is it too  
confusing when using sizers, or should we just let them figure it out?

-- Ed Leafe
-- http://leafe.com
-- http://dabodev.com



_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-users

Reply via email to