fix top margin for static box sizer when wxDIALOG_UNIT_COMPATIBILITY == 0
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@32655 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -39,13 +39,14 @@ public:
|
|||||||
long style = 0,
|
long style = 0,
|
||||||
const wxString& name = wxStaticBoxNameStr);
|
const wxString& name = wxStaticBoxNameStr);
|
||||||
|
|
||||||
/// Implementation
|
/// Implementation only
|
||||||
virtual WXLRESULT MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam);
|
virtual void GetBordersForSizer(int *borderTop, int *borderOther) const;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual wxSize DoGetBestSize() const;
|
virtual wxSize DoGetBestSize() const;
|
||||||
|
|
||||||
virtual WXDWORD MSWGetStyle(long style, WXDWORD *exstyle) const;
|
virtual WXDWORD MSWGetStyle(long style, WXDWORD *exstyle) const;
|
||||||
|
virtual WXLRESULT MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam);
|
||||||
|
|
||||||
|
|
||||||
DECLARE_DYNAMIC_CLASS_NO_COPY(wxStaticBox)
|
DECLARE_DYNAMIC_CLASS_NO_COPY(wxStaticBox)
|
||||||
|
@@ -155,9 +155,7 @@ wxSize wxStaticBox::DoGetBestSize() const
|
|||||||
WXLRESULT wxStaticBox::MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam)
|
WXLRESULT wxStaticBox::MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam)
|
||||||
{
|
{
|
||||||
#ifndef __WXWINCE__
|
#ifndef __WXWINCE__
|
||||||
switch ( nMsg )
|
if ( nMsg == WM_NCHITTEST )
|
||||||
{
|
|
||||||
case WM_NCHITTEST:
|
|
||||||
{
|
{
|
||||||
// This code breaks some other processing such as enter/leave tracking
|
// This code breaks some other processing such as enter/leave tracking
|
||||||
// so it's off by default.
|
// so it's off by default.
|
||||||
@@ -178,12 +176,23 @@ WXLRESULT wxStaticBox::MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lPar
|
|||||||
return (long)HTCLIENT;
|
return (long)HTCLIENT;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
|
||||||
}
|
|
||||||
#endif // !__WXWINCE__
|
#endif // !__WXWINCE__
|
||||||
|
|
||||||
return wxControl::MSWWindowProc(nMsg, wParam, lParam);
|
return wxControl::MSWWindowProc(nMsg, wParam, lParam);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void wxStaticBox::GetBordersForSizer(int *borderTop, int *borderOther) const
|
||||||
|
{
|
||||||
|
wxStaticBoxBase::GetBordersForSizer(borderTop, borderOther);
|
||||||
|
|
||||||
|
// if not using correct (but backwards cojmpatible) text metrics
|
||||||
|
// calculations, we need to add some extra margin or otherwise static box
|
||||||
|
// title is clipped
|
||||||
|
#if !wxDIALOG_UNIT_COMPATIBILITY
|
||||||
|
if ( !GetLabel().empty() )
|
||||||
|
*borderTop += GetCharHeight()/3;
|
||||||
|
#endif // !wxDIALOG_UNIT_COMPATIBILITY
|
||||||
|
}
|
||||||
|
|
||||||
#endif // wxUSE_STATBOX
|
#endif // wxUSE_STATBOX
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user