- // we set the widths only for 2 of them, otherwise let all the fields
- // have equal width (the default behaviour)
- const int *widths = NULL;
- if ( nFields == 2 )
+ static const int widthsFor2Fields[] = { 200, -1 };
+ static const int widthsFor3Fields[] = { -1, -2, -1 };
+ static const int widthsFor4Fields[] = { 100, -1, 100, -2, 100 };
+
+ static const int *widthsAll[] =
+ {
+ NULL, // 1 field: default
+ widthsFor2Fields, // 2 fields: 1 fixed, 1 var
+ widthsFor3Fields, // 3 fields: 3 var
+ widthsFor4Fields, // 4 fields: 3 fixed, 2 vars
+ NULL // 5 fields: default (all have same width)
+ };
+
+ const int * const widths = widthsAll[nFields - 1];
+ sb->SetFieldsCount(nFields, widths);
+
+ wxString s;
+ for ( long n = 0; n < nFields; n++ )