Implement DoGetSizeFromTextSize() for wxMSW wx{Choice,Combobox,TextCtrl}.
Refactor and improve the existing DoGetBestSize() implementations to use DoGetBestSize(). Closes #14816. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@72954 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -661,4 +661,20 @@ bool wxComboBox::SetHint(const wxString& hintOrig)
|
||||
|
||||
#endif // wxUSE_UXTHEME
|
||||
|
||||
wxSize wxComboBox::DoGetSizeFromTextSize(int xlen, int ylen) const
|
||||
{
|
||||
wxSize tsize( wxChoice::DoGetSizeFromTextSize(xlen, ylen) );
|
||||
|
||||
if ( !HasFlag(wxCB_READONLY) )
|
||||
{
|
||||
// Add the margins we have previously set
|
||||
wxPoint marg( GetMargins() );
|
||||
marg.x = wxMax(0, marg.x);
|
||||
marg.y = wxMax(0, marg.y);
|
||||
tsize.IncBy( marg );
|
||||
}
|
||||
|
||||
return tsize;
|
||||
}
|
||||
|
||||
#endif // wxUSE_COMBOBOX
|
||||
|
Reference in New Issue
Block a user