- wxString label = wxGetWindowText(GetHWND());
- if ( label.find(_T('\n')) != wxString::npos )
- {
- wxStringTokenizer tokens( label, wxT("\n") );
-
- // the button height is proportional to the height of the font used
- hBtn = BUTTON_HEIGHT_FROM_CHAR_HEIGHT(hChar);
- hBtn += hChar*(tokens.CountTokens()-1);
-
- while (tokens.HasMoreTokens())
- {
- wxString sub = tokens.GetNextToken();
- int w;
- GetTextExtent( sub, &w, NULL);
- if (w > wBtn)
- wBtn = w;
- }
- }
- else
- {
- GetTextExtent( label, &wBtn, NULL);