- // center label by default
- if ( !(style & wxALIGN_MASK) )
- {
- style |= wxALIGN_CENTRE_HORIZONTAL | wxALIGN_CENTRE_VERTICAL;
- }
+ wxString label(lbl);
+ if (label.empty() && wxIsStockID(id))
+ label = wxGetStockLabel(id);
+
+ long ctrl_style = style & !wxBU_ALIGN_MASK;
+
+ wxASSERT_MSG( (ctrl_style & wxALIGN_MASK) == 0,
+ _T("Some style conflicts with align flags") );
+
+ if((style & wxBU_RIGHT) == wxBU_RIGHT)
+ ctrl_style |= wxALIGN_RIGHT;
+ else if((style & wxBU_LEFT) == wxBU_LEFT)
+ ctrl_style |= wxALIGN_LEFT;
+ else
+ ctrl_style |= wxALIGN_CENTRE_HORIZONTAL;
+
+ if((style & wxBU_TOP) == wxBU_TOP)
+ ctrl_style |= wxALIGN_TOP;
+ else if((style & wxBU_BOTTOM) == wxBU_BOTTOM)
+ ctrl_style |= wxALIGN_BOTTOM;
+ else
+ ctrl_style |= wxALIGN_CENTRE_VERTICAL;