use WS_CLIPSIBLINGS for wxStaticLine as well
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@14316 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -46,6 +46,10 @@ public:
|
|||||||
|
|
||||||
// overriden base class virtuals
|
// overriden base class virtuals
|
||||||
virtual bool AcceptsFocus() const { return FALSE; }
|
virtual bool AcceptsFocus() const { return FALSE; }
|
||||||
|
|
||||||
|
protected:
|
||||||
|
// usually overridden base class virtuals
|
||||||
|
virtual WXDWORD MSWGetStyle(long style, WXDWORD *exstyle) const;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // _WX_MSW_STATLINE_H_
|
#endif // _WX_MSW_STATLINE_H_
|
||||||
|
@@ -52,48 +52,27 @@ IMPLEMENT_DYNAMIC_CLASS(wxStaticLine, wxControl)
|
|||||||
// wxStaticLine
|
// wxStaticLine
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
|
|
||||||
bool wxStaticLine::Create( wxWindow *parent,
|
bool wxStaticLine::Create(wxWindow *parent,
|
||||||
wxWindowID id,
|
wxWindowID id,
|
||||||
const wxPoint &pos,
|
const wxPoint& pos,
|
||||||
const wxSize &size,
|
const wxSize& sizeOrig,
|
||||||
long style,
|
long style,
|
||||||
const wxString &name)
|
const wxString &name)
|
||||||
{
|
{
|
||||||
if ( !CreateBase(parent, id, pos, size, style, wxDefaultValidator, name) )
|
wxSize size = AdjustSize(sizeOrig);
|
||||||
|
|
||||||
|
if ( !CreateControl(parent, id, pos, size, style, wxDefaultValidator, name) )
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
parent->AddChild(this);
|
return MSWCreateControl(_T("STATIC"), _T(""), pos, size, style);
|
||||||
|
}
|
||||||
|
|
||||||
wxSize sizeReal = AdjustSize(size);
|
WXDWORD wxStaticLine::MSWGetStyle(long style, WXDWORD *exstyle) const
|
||||||
|
{
|
||||||
|
WXDWORD msStyle = wxControl::MSWGetStyle(style, exstyle);
|
||||||
|
|
||||||
DWORD wstyle = WS_CHILD | WS_VISIBLE | SS_GRAYRECT | SS_SUNKEN | SS_NOTIFY;
|
// add our default styles
|
||||||
|
return msStyle | SS_GRAYRECT | SS_SUNKEN | SS_NOTIFY | WS_CLIPSIBLINGS;
|
||||||
if ( style & wxCLIP_SIBLINGS )
|
|
||||||
wstyle |= WS_CLIPSIBLINGS;
|
|
||||||
|
|
||||||
|
|
||||||
m_hWnd = (WXHWND)::CreateWindow
|
|
||||||
(
|
|
||||||
wxT("STATIC"),
|
|
||||||
wxT(""),
|
|
||||||
wstyle,
|
|
||||||
pos.x, pos.y, sizeReal.x, sizeReal.y,
|
|
||||||
GetWinHwnd(parent),
|
|
||||||
(HMENU)m_windowId,
|
|
||||||
wxGetInstance(),
|
|
||||||
NULL
|
|
||||||
);
|
|
||||||
|
|
||||||
if ( !m_hWnd )
|
|
||||||
{
|
|
||||||
wxLogDebug(wxT("Failed to create static control"));
|
|
||||||
|
|
||||||
return FALSE;
|
|
||||||
}
|
|
||||||
|
|
||||||
SubclassWin(m_hWnd);
|
|
||||||
|
|
||||||
return TRUE;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // wxUSE_STATLINE
|
#endif // wxUSE_STATLINE
|
||||||
|
Reference in New Issue
Block a user