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:
Vadim Zeitlin
2002-02-20 00:25:54 +00:00
parent 6c1285bb5b
commit cfa822b8f1
2 changed files with 20 additions and 37 deletions

View File

@@ -46,6 +46,10 @@ public:
// overriden base class virtuals
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_

View File

@@ -52,48 +52,27 @@ IMPLEMENT_DYNAMIC_CLASS(wxStaticLine, wxControl)
// wxStaticLine
// ----------------------------------------------------------------------------
bool wxStaticLine::Create( wxWindow *parent,
wxWindowID id,
const wxPoint &pos,
const wxSize &size,
long style,
const wxString &name)
bool wxStaticLine::Create(wxWindow *parent,
wxWindowID id,
const wxPoint& pos,
const wxSize& sizeOrig,
long style,
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;
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;
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;
// add our default styles
return msStyle | SS_GRAYRECT | SS_SUNKEN | SS_NOTIFY | WS_CLIPSIBLINGS;
}
#endif // wxUSE_STATLINE