From cfa822b8f1736a137a4189470ec90f4b95095381 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Wed, 20 Feb 2002 00:25:54 +0000 Subject: [PATCH] use WS_CLIPSIBLINGS for wxStaticLine as well git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@14316 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/msw/statline.h | 4 +++ src/msw/statline.cpp | 53 ++++++++++++--------------------------- 2 files changed, 20 insertions(+), 37 deletions(-) diff --git a/include/wx/msw/statline.h b/include/wx/msw/statline.h index 9fe6273bcb..36d6a5897a 100644 --- a/include/wx/msw/statline.h +++ b/include/wx/msw/statline.h @@ -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_ diff --git a/src/msw/statline.cpp b/src/msw/statline.cpp index 2bf14042af..7535fee4c4 100644 --- a/src/msw/statline.cpp +++ b/src/msw/statline.cpp @@ -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) ) - return FALSE; - - parent->AddChild(this); - - wxSize sizeReal = AdjustSize(size); - - 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")); + wxSize size = AdjustSize(sizeOrig); + if ( !CreateControl(parent, id, pos, size, style, wxDefaultValidator, name) ) return FALSE; - } - SubclassWin(m_hWnd); + return MSWCreateControl(_T("STATIC"), _T(""), pos, size, style); +} + +WXDWORD wxStaticLine::MSWGetStyle(long style, WXDWORD *exstyle) const +{ + WXDWORD msStyle = wxControl::MSWGetStyle(style, exstyle); - return TRUE; + // add our default styles + return msStyle | SS_GRAYRECT | SS_SUNKEN | SS_NOTIFY | WS_CLIPSIBLINGS; } #endif // wxUSE_STATLINE -- 2.45.2