Re: set different initial and minimum dimensions for sizer item?

21 views
Skip to first unread message
Message has been deleted

Vadim Zeitlin

unread,
Oct 30, 2009, 9:21:48 PM10/30/09
to wx-u...@googlegroups.com
On Fri, 30 Oct 2009 15:36:56 -0700 (PDT) bht <to...@anl.gov> wrote:

b> I would like to set an initial size for a grid that is larger than the
b> grid's minimum size. I would prefer that the initial size also be
b> smaller than the full size of the object. This would allow the user to
b> use more or less screen real-estate, depending on what they prefer,
b> but start the app with a good compromise. If I set the size for the
b> grid (either when I create it or using the sizer's SetItemMinSize
b> method) that is both the initial and minimum size. If I do not set a
b> size, the grid starts out fully expanded, but has no minimum.
b>
b> Is there a simple way to do this?

Any initial size you set explicitly will always be taken as the minimal
size too. But nothing prevents you from sizing the top level window
containing the grid to be larger than its minimal size. E.g. you can set up
everything as you do now but at the end do something like this:

SetSizer(sizer);
wxSize minSize = GetMinSize();
SetSizeHints(minSize);
SetSize(minSize*2);

instead of just doing

SetSizerAndFit(sizer);

as usual.

Regards,
VZ

--
TT-Solutions: wxWidgets consultancy and technical support
http://www.tt-solutions.com/

Reply all
Reply to author
Forward
0 new messages