Page 2 of 2

Posted: Thu Sep 17, 2009 2:14 pm
by catalin
Ha!
I think I finaly understood what you want :)

Try this:

Code: Select all

        wxGrid* grid = new wxGrid( this, wxID_ANY );
        grid->CreateGrid( 20, 10 );
        // populate it or whatever
        grid->Fit();
        grid->SetMaxSize( grid->ClientToWindowSize( grid->GetVirtualSize() ) );
        // [...]
        verticalBoxSizer->Add( grid, 1, wxEXPAND );
        // [...]

Posted: Mon Sep 21, 2009 12:27 pm
by Dobias
It seems like the verticalBoxSizer->Add( grid, 1, wxEXPAND ) overwrites the grid->SetMaxSize when resizing the window. The grid is stretched so that the white Space is still there.
Unfortunately, there is no "wxFIXED_MAXSIZE" that i could use instead of wxEXPAND. There only is a wxFIXED_MINSIZE, but that does not help me much.
My furthers attempts also did not show good result.
It seems to me like there is no possibility to do what i want without catching the resizing event and doing everything on my own.