Hi all,
I'm currently facing the following problem:
I've added a wxGrid in Code::Blocks, set the column lables, etc.
Since some label values are bigger than the column width, these labels are "cut" at the beginning and the end.
So, I've added "AutoSizeColumns()" manually to the code, compiled it and it works - ok.
But every time I do some changes on this grid in Code::Blocks, it deletes the "AutoSizeColumns()" line and I have to add it, again... :-/
I figured out, that entering "Grid_MgUeb->AutoSizeColumns();" into the "Extra code" property will add this line of code when creating this object, but on the wrong place.
Manually I tried it that way (creating the grid, setting the column labels and AFTER this, resizing the columns):
Grid_MgUeb = new wxGrid(Panel4, ID_GRID1, wxDefaultPosition, wxSize(1050,344), 0, _T("ID_GRID1"));
Grid_MgUeb->CreateGrid(16,8);
Grid_MgUeb->Disable();
Grid_MgUeb->EnableEditing(false);
Grid_MgUeb->EnableGridLines(true);
Grid_MgUeb->SetDefaultRowSize(20, true);
Grid_MgUeb->SetColLabelValue(0, _("Nachname"));
Grid_MgUeb->SetColLabelValue(1, _("Vorname"));
[...]
Grid_MgUeb->SetDefaultCellFont( Grid_MgUeb->GetFont() );
Grid_MgUeb->SetDefaultCellTextColour( Grid_MgUeb->GetForegroundColour() );
Grid_MgUeb->AutoSizeColumns(); <- !!!
But Code::Blocks does it that way (creating the grid, THEN resizing the columns and at least setting the column labels):
Grid_MgUeb = new wxGrid(Panel4, ID_GRID1, wxDefaultPosition, wxSize(1050,344), 0, _T("ID_GRID1"));
Grid_MgUeb->CreateGrid(16,8);
Grid_MgUeb->Disable();
Grid_MgUeb->AutoSizeColumns(); <- !!!
Grid_MgUeb->EnableEditing(false);
Grid_MgUeb->EnableGridLines(true);
Grid_MgUeb->SetDefaultRowSize(20, true);
Grid_MgUeb->SetColLabelValue(0, _("Nachname"));
Grid_MgUeb->SetColLabelValue(1, _("Vorname"));
[...]
Grid_MgUeb->SetDefaultCellFont( Grid_MgUeb->GetFont() );
Grid_MgUeb->SetDefaultCellTextColour( Grid_MgUeb->GetForegroundColour() );
After this the column width is smaller than without any resizing!
Is there any option to tell Code::Blocks to add this code line at the END of the generated code?
Thanks in advance!
/T