// the control unless it already has new lines in its label)
long styleOld = ::GetWindowLong(hwnd, GWL_STYLE),
styleNew;
- if ( label.find(_T('\n')) != wxString::npos )
+ if ( label.find(wxT('\n')) != wxString::npos )
styleNew = styleOld | BS_MULTILINE;
else
styleNew = styleOld & ~BS_MULTILINE;
// value and the label is not set yet when MSWGetStyle() is called
msStyle |= wxMSWButton::GetMultilineStyle(label);
- return MSWCreateControl(_T("BUTTON"), msStyle, pos, size, label, exstyle);
+ return MSWCreateControl(wxT("BUTTON"), msStyle, pos, size, label, exstyle);
}
wxButton::~wxButton()
win = parent;
}
- wxASSERT_MSG( win, _T("button without top level parent?") );
+ wxASSERT_MSG( win, wxT("button without top level parent?") );
wxTopLevelWindow * const tlw = wxDynamicCast(win, wxTopLevelWindow);
- wxASSERT_MSG( tlw, _T("logic error in GetTLWParentIfNotBeingDeleted()") );
+ wxASSERT_MSG( tlw, wxT("logic error in GetTLWParentIfNotBeingDeleted()") );
return tlw;
}
return;
wxWindow * const tlw = wxGetTopLevelParent(btn);
- wxCHECK_RET( tlw, _T("button without top level window?") );
+ wxCHECK_RET( tlw, wxT("button without top level window?") );
::SendMessage(GetHwndOf(tlw), DM_SETDEFID, btn->GetId(), 0L);
m_imageData = new wxODButtonImageData(this, bitmap);
MakeOwnerDrawn();
}
-
- // if a bitmap was assigned to the bitmap, its best size must be
- // changed to account for it
- InvalidateBestSize();
}
else
{
m_imageData->SetBitmap(bitmap, which);
}
+ // it should be enough to only invalidate the best size when the normal
+ // bitmap changes as all bitmaps assigned to the button should be of the
+ // same size anyhow
+ if ( which == State_Normal )
+ InvalidateBestSize();
+
Refresh();
}
// center text horizontally in any case
flags |= DT_CENTER;
- if ( text.find(_T('\n')) != wxString::npos )
+ if ( text.find(wxT('\n')) != wxString::npos )
{
// draw multiline label