wxGrid + wxButton in wxFlexGridSizer

Are you writing your own components and need help with how to set them up or have questions about the components you are deriving from ? Ask them here.
catalin
Moderator
Moderator
Posts: 1521
Joined: Wed Nov 12, 2008 7:23 am
Location: Romania

Post by catalin » Thu Sep 17, 2009 2:14 pm

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 );
        // [...]

Dobias
In need of some credit
In need of some credit
Posts: 9
Joined: Tue Sep 15, 2009 9:29 am

Post by Dobias » Mon Sep 21, 2009 12:27 pm

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.

Post Reply