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:
@@ -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 );
|
||||
|
Reference in New Issue
Block a user