+ // If there is a sizer then the base best size is the sizer's minimum
+ if (GetSizer() != NULL)
+ {
+ wxSize cm(GetSizer()->CalcMin());
+ best = ClientToWindowSize(cm);
+ // adjust for a long label if needed
+ best.x = wxMax(best.x, wBox);
+ }
+ // otherwise the best size falls back to the label size
+ else
+ {
+ best = wxSize(wBox, hBox);
+ }