- // default border for this control is none
- if ( (style & wxBORDER_MASK) == wxBORDER_DEFAULT )
- {
- style |= wxBORDER_NONE;
- }
-
- if (!CreateBase(parent, id, pos, size, style, validator, name))
- return FALSE;
-
- parent->AddChild(this);
-
- m_backgroundColour = parent->GetBackgroundColour();
- m_foregroundColour = parent->GetForegroundColour();
-
-#ifndef BS_PUSHLIKE
-#define BS_PUSHLIKE 0x00001000L
-#endif
+ if ( !CreateControl(parent, id, pos, size, style, validator, name) )
+ return false;
+
+ // if the label contains several lines we must explicitly tell the button
+ // about it or it wouldn't draw it correctly ("\n"s would just appear as
+ // black boxes)
+ //
+ // NB: we do it here and not in MSWGetStyle() because we need the label
+ // value and the label is not set yet when MSWGetStyle() is called
+ WXDWORD exstyle;
+ WXDWORD msStyle = MSWGetStyle(style, &exstyle);
+ msStyle |= wxMSWButton::GetMultilineStyle(label);
+
+ return MSWCreateControl(_T("BUTTON"), msStyle, pos, size, label, exstyle);
+}