wxUniv use wxBU flags [bug #1040584]
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@30531 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
parent
fa9ad408a1
commit
041ae20237
@ -25,7 +25,7 @@
|
||||
#define wxBU_TOP 0x0080
|
||||
#define wxBU_RIGHT 0x0100
|
||||
#define wxBU_BOTTOM 0x0200
|
||||
|
||||
#define wxBU_ALIGN_MASK ( wxBU_LEFT | wxBU_TOP | wxBU_RIGHT | wxBU_BOTTOM )
|
||||
#endif
|
||||
|
||||
#if wxUSE_BUTTON
|
||||
|
@ -81,13 +81,26 @@ bool wxButton::Create(wxWindow *parent,
|
||||
if (label.empty() && wxIsStockID(id))
|
||||
label = wxGetStockLabel(id);
|
||||
|
||||
// center label by default
|
||||
if ( !(style & wxALIGN_MASK) )
|
||||
{
|
||||
style |= wxALIGN_CENTRE_HORIZONTAL | wxALIGN_CENTRE_VERTICAL;
|
||||
}
|
||||
long ctrl_style = style & !wxBU_ALIGN_MASK;
|
||||
|
||||
if ( !wxControl::Create(parent, id, pos, size, style, validator, name) )
|
||||
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;
|
||||
|
||||
if ( !wxControl::Create(parent, id, pos, size, ctrl_style, validator, name) )
|
||||
return false;
|
||||
|
||||
SetLabel(label);
|
||||
|
Loading…
Reference in New Issue
Block a user