-
- wxSize new_size = size;
- new_size.x = 16;
- if (new_size.y == -1) new_size.y = 30;
-
- PreCreation( parent, id, pos, new_size, style, name );
-
-// SetValidator( validator );
+
+ wxSize new_size = size,
+ sizeBest = DoGetBestSize();
+ new_size.x = sizeBest.x; // override width always
+ if (new_size.y == -1)
+ new_size.y = sizeBest.y;
+
+ if (!PreCreation( parent, pos, new_size ) ||
+ !CreateBase( parent, id, pos, new_size, style, wxDefaultValidator, name ))
+ {
+ wxFAIL_MSG( wxT("wxXX creation failed") );
+ return FALSE;
+ }