Improve wxGrid cell wrapping in wxGridCellAutoWrapStringRenderer.

Wrap the words too long to be shown on one line on several lines.

Also take the line breaks and TABs into account.

Closes #15249.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74245 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2013-06-16 10:50:54 +00:00
parent 7ddb154164
commit 0ec98fd6c9
4 changed files with 154 additions and 37 deletions

View File

@@ -450,6 +450,21 @@ GridFrame::GridFrame()
grid->SetCellValue( 0, 4, wxT("Can veto edit this cell") );
grid->SetColSize(10, 150);
wxString longtext = wxT("abcdefghijklmnopqrstuvwxyz0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ\n\n");
longtext += wxT("With tabs :\n");
longtext += wxT("Home,\t\thome\t\t\tagain\n");
longtext += wxT("Long word at start :\n");
longtext += wxT("ILikeToBeHereWhen I can\n");
longtext += wxT("Long word in the middle :\n");
longtext += wxT("When IComeHome,ColdAnd tired\n");
longtext += wxT("Long last word :\n");
longtext += wxT("It's GoodToWarmMyBonesBesideTheFire");
grid->SetCellValue( 0, 10, longtext );
grid->SetCellRenderer(0 , 10, new wxGridCellAutoWrapStringRenderer);
grid->SetCellEditor( 0, 10 , new wxGridCellAutoWrapStringEditor);
grid->SetCellValue( 0, 11, wxT("K1 cell editor blocker") );
grid->SetCellValue( 0, 5, wxT("Press\nCtrl+arrow\nto skip over\ncells") );
grid->SetRowSize( 99, 60 );