]> git.saurik.com Git - wxWidgets.git/commitdiff
use WS_CLIPSIBLINGS for wxStaticLine as well
authorVadim Zeitlin <vadim@wxwidgets.org>
Wed, 20 Feb 2002 00:25:54 +0000 (00:25 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Wed, 20 Feb 2002 00:25:54 +0000 (00:25 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@14316 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

include/wx/msw/statline.h
src/msw/statline.cpp

index 9fe6273bcbd393576608a028cceffcfd96351021..36d6a5897aa49d40c042ac4f10c243ed3ca91421 100644 (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_
index 2bf14042af379e9fe41b3e5bdcb51d9306abab97..7535fee4c4d71d7c00372015379be35efa2972b9 100644 (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) )
-        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