I'm not sure if this belongs to "platform related", but I experience different behaviour on Windows and Linux, therefore I'll post this here.
I've got some troubles with centering a wxGrid in a wxFlexGridSizer.
The code fragment below successfully centers the grid with wxGTK 2.6.2, but fails to do so with wxMSW 2.6.2 -- the grid is horizontally aligned to the left.
Code: Select all
//generated by wxDevCpp: wxFlexGridSizer* WxFlexGridSizer1 = new wxFlexGridSizer(5,1,0,0); this->SetSizer(WxFlexGridSizer1); this->SetAutoLayout(TRUE); //adding some other controls here to the sizer, wxALIGN_CENTER works // for those. grid = new wxGrid(this, ID_GRID, wxPoint(9,179), wxSize(408,125),wxHSCROLL|wxVSCROLL|wxWANTS_CHARS); grid->SetDefaultColSize(75); grid->SetDefaultRowSize(18); grid->SetRowLabelSize(1); grid->SetColLabelSize(18); grid->CreateGrid(0,5,wxGrid::wxGridSelectCells); WxFlexGridSizer1->Add(grid,0, wxALIGN_CENTER|wxALL,0);
Windows: Visual C++ 7.1, unicode static lib
Linux: GCC 4.02, unicode shared lib