Implement GetMinSize for wxMotif wxButton. Helps solfing sizing
problems in generic common dialogs. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@35326 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
parent
3e81caa51b
commit
4e025aa206
@ -49,7 +49,9 @@ public:
|
|||||||
// Implementation
|
// Implementation
|
||||||
private:
|
private:
|
||||||
virtual wxSize DoGetBestSize() const;
|
virtual wxSize DoGetBestSize() const;
|
||||||
|
virtual wxSize GetMinSize() const;
|
||||||
wxSize OldGetBestSize() const;
|
wxSize OldGetBestSize() const;
|
||||||
|
wxSize OldGetMinSize() const;
|
||||||
void SetDefaultShadowThicknessAndResize();
|
void SetDefaultShadowThicknessAndResize();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -123,6 +123,7 @@ void wxButton::SetDefaultShadowThicknessAndResize()
|
|||||||
if( best != actual )
|
if( best != actual )
|
||||||
SetSize( best );
|
SetSize( best );
|
||||||
#endif
|
#endif
|
||||||
|
InvalidateBestSize();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -182,6 +183,19 @@ wxSize wxButton::DoGetBestSize() const
|
|||||||
return best;
|
return best;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
wxSize wxButton::GetMinSize() const
|
||||||
|
{
|
||||||
|
if( wxMotifLargeButtons() )
|
||||||
|
return OldGetMinSize();
|
||||||
|
|
||||||
|
return DoGetBestSize();
|
||||||
|
}
|
||||||
|
|
||||||
|
wxSize wxButton::OldGetMinSize() const
|
||||||
|
{
|
||||||
|
return OldGetBestSize();
|
||||||
|
}
|
||||||
|
|
||||||
wxSize wxButton::OldGetBestSize() const
|
wxSize wxButton::OldGetBestSize() const
|
||||||
{
|
{
|
||||||
Dimension xmargin, ymargin, highlight, shadow, defThickness;
|
Dimension xmargin, ymargin, highlight, shadow, defThickness;
|
||||||
@ -199,6 +213,7 @@ wxSize wxButton::OldGetBestSize() const
|
|||||||
|
|
||||||
int margin = highlight * 2 +
|
int margin = highlight * 2 +
|
||||||
( defThickness ? ( ( shadow + defThickness ) * 4 ) : ( shadow * 2 ) );
|
( defThickness ? ( ( shadow + defThickness ) * 4 ) : ( shadow * 2 ) );
|
||||||
|
|
||||||
wxSize best( x + xmargin * 2 + margin,
|
wxSize best( x + xmargin * 2 + margin,
|
||||||
y + ymargin * 2 + margin );
|
y + ymargin * 2 + margin );
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user