]> git.saurik.com Git - wxWidgets.git/commitdiff
Revamped border handling.
authorJulian Smart <julian@anthemion.co.uk>
Tue, 6 May 2003 21:57:32 +0000 (21:57 +0000)
committerJulian Smart <julian@anthemion.co.uk>
Tue, 6 May 2003 21:57:32 +0000 (21:57 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@20511 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

16 files changed:
include/wx/msw/button.h
include/wx/msw/window.h
src/msw/choice.cpp
src/msw/combobox.cpp
src/msw/control.cpp
src/msw/gauge95.cpp
src/msw/glcanvas.cpp
src/msw/listbox.cpp
src/msw/listctrl.cpp
src/msw/scrolbar.cpp
src/msw/slider95.cpp
src/msw/slidrmsw.cpp
src/msw/spinctrl.cpp
src/msw/stattext.cpp
src/msw/tglbtn.cpp
src/msw/window.cpp

index 571024979335d69490bd912a6ac9d2e526d4d447..5caf45782a1f2c23d8a3f13845bc53f63d9c7225 100644 (file)
@@ -78,7 +78,7 @@ protected:
 
     // usually overridden base class virtuals
     virtual wxSize DoGetBestSize() const;
-    virtual WXDWORD MSWGetStyle(long style, WXDWORD *exstyle) const;
+    virtual WXDWORD MSWGetStyle(long style, WXDWORD *exstyle) const ;
 
 private:
     DECLARE_DYNAMIC_CLASS(wxButton)
index 2ffaa76e922ec3abe1565ac3ce201dcac203634d..a34ac1e2dd020261c756d8612957b29ddd03fd2e 100644 (file)
@@ -212,13 +212,6 @@ public:
     wxWindow *FindItem(long id) const;
     wxWindow *FindItemByHWND(WXHWND hWnd, bool controlOnly = FALSE) const;
 
-    // Make a Windows extended style from the given wxWindows window style
-    static WXDWORD MakeExtendedStyle(long style,
-                                     bool eliminateBorders = FALSE);
-
-    // Determine whether 3D effects are wanted
-    WXDWORD Determine3DEffects(WXDWORD defaultBorderStyle, bool *want3D) const;
-
     // MSW only: TRUE if this control is part of the main control
     virtual bool ContainsHWND(WXHWND WXUNUSED(hWnd)) const { return FALSE; };
 
@@ -227,7 +220,7 @@ public:
     //
     // this is the function that should be overridden in the derived classes,
     // but you will mostly use MSWGetCreateWindowFlags() below
-    virtual WXDWORD MSWGetStyle(long flags, WXDWORD *exstyle = NULL) const;
+    virtual WXDWORD MSWGetStyle(long flags, WXDWORD *exstyle = NULL) const ;
 
     // get the MSW window flags corresponding to wxWindows ones
     //
index 5493aedb24afe93152ea9ef7fc4869e518eb6237..f8620938f2a5651ab17803b637794c375473b123 100644 (file)
@@ -393,25 +393,11 @@ bool wxChoice::MSWCommand(WXUINT param, WXWORD WXUNUSED(id))
 }
 
 WXHBRUSH wxChoice::OnCtlColor(WXHDC pDC, WXHWND WXUNUSED(pWnd), WXUINT WXUNUSED(nCtlColor),
-#if wxUSE_CTL3D
-                               WXUINT message,
-                               WXWPARAM wParam,
-                               WXLPARAM lParam
-#else
                                WXUINT WXUNUSED(message),
                                WXWPARAM WXUNUSED(wParam),
                                WXLPARAM WXUNUSED(lParam)
-#endif
      )
 {
-#if wxUSE_CTL3D
-    if ( m_useCtl3D )
-    {
-        HBRUSH hbrush = Ctl3dCtlColorEx(message, wParam, lParam);
-        return (WXHBRUSH) hbrush;
-    }
-#endif // wxUSE_CTL3D
-
     HDC hdc = (HDC)pDC;
     if (GetParent()->GetTransparentBackground())
         SetBkMode(hdc, TRANSPARENT);
index a2a49d7f786bf7ef5837890eb87de90f8b2ddfd8..5082a9b72847d65aeed1e0dd7b30baa1d4542957 100644 (file)
@@ -156,25 +156,11 @@ LRESULT APIENTRY _EXPORT wxComboEditWndProc(HWND hWnd,
 }
 
 WXHBRUSH wxComboBox::OnCtlColor(WXHDC pDC, WXHWND WXUNUSED(pWnd), WXUINT WXUNUSED(nCtlColor),
-#if wxUSE_CTL3D
-                               WXUINT message,
-                               WXWPARAM wParam,
-                               WXLPARAM lParam
-#else
                                WXUINT WXUNUSED(message),
                                WXWPARAM WXUNUSED(wParam),
                                WXLPARAM WXUNUSED(lParam)
-#endif
     )
 {
-#if wxUSE_CTL3D
-    if ( m_useCtl3D )
-    {
-        HBRUSH hbrush = Ctl3dCtlColorEx(message, wParam, lParam);
-        return (WXHBRUSH) hbrush;
-    }
-#endif // wxUSE_CTL3D
-
     HDC hdc = (HDC)pDC;
     if (GetParent()->GetTransparentBackground())
         SetBkMode(hdc, TRANSPARENT);
index 4eb36ecd3a7fa85a9a2dd4e7a10d285ef5922aa8..e05ee6476d792b495c3e31d0f71008aebfd05bf5 100644 (file)
@@ -93,16 +93,12 @@ bool wxControl::MSWCreateControl(const wxChar *classname,
                                  const wxString& label,
                                  WXDWORD exstyle)
 {
-    // want3D tells us whether or not the style specified a 3D border.
-    // If so, under WIN16 we can use Ctl3D to give it an appropriate style.
-    // Sometimes want3D is used to indicate that the non-extended style should have
-    // WS_BORDER.
-    bool want3D = TRUE;
-
     // if no extended style given, determine it ourselves
     if ( exstyle == (WXDWORD)-1 )
     {
-        exstyle = Determine3DEffects(WS_EX_CLIENTEDGE, &want3D);
+//        exstyle = Determine3DEffects(WS_EX_CLIENTEDGE, &want3D);
+        exstyle = 0;
+        (void) MSWGetStyle(GetWindowStyle(), & exstyle) ;
     }
 
     // all controls should have this style
index 2d93312fc663643eda5b081ea7ee69d41b8023b8..0a13eb3e4b86e15170995e72de22b3db917a033c 100644 (file)
@@ -101,11 +101,13 @@ bool wxGauge95::Create(wxWindow *parent, wxWindowID id,
   int width = size.x;
   int height = size.y;
 
-  long msFlags = WS_CHILD | WS_VISIBLE /* | WS_CLIPSIBLINGS */;
+  WXDWORD exStyle = 0;
+  long msFlags = MSWGetStyle(style, & exStyle) ;
 
+/*
   if ( m_windowStyle & wxCLIP_SIBLINGS )
     msFlags |= WS_CLIPSIBLINGS;
-
+*/
 
   if (m_windowStyle & wxGA_VERTICAL)
     msFlags |= PBS_VERTICAL;
@@ -114,7 +116,7 @@ bool wxGauge95::Create(wxWindow *parent, wxWindowID id,
     msFlags |= PBS_SMOOTH;
 
   HWND wx_button =
-      CreateWindowEx(MakeExtendedStyle(m_windowStyle), PROGRESS_CLASS, NULL, msFlags,
+      CreateWindowEx(exStyle, PROGRESS_CLASS, NULL, msFlags,
                     0, 0, 0, 0, (HWND) parent->GetHWND(), (HMENU)m_windowId,
                     wxGetInstance(), NULL);
 
index 44ac48b0b96939d6e5879cb90a5238449719e8d7..2772f79ba40677bcd616aa58cb6f4aa66a09d980 100644 (file)
@@ -293,10 +293,6 @@ bool wxGLCanvas::Create(wxWindow *parent,
   parent->AddChild(this);
 
   DWORD msflags = 0;
-  if ( style & wxBORDER )
-    msflags |= WS_BORDER;
-  if ( style & wxTHICK_FRAME )
-    msflags |= WS_THICKFRAME;
 
   /*
   A general rule with OpenGL and Win32 is that any window that will have a
@@ -305,18 +301,9 @@ bool wxGLCanvas::Create(wxWindow *parent,
   books that contain the wgl function descriptions.
   */
 
+  WXDWORD exStyle = 0;
   msflags |= WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS | WS_CLIPCHILDREN;
-
-  bool want3D;
-  WXDWORD exStyle = Determine3DEffects(WS_EX_CLIENTEDGE, &want3D);
-
-  // Even with extended styles, need to combine with WS_BORDER
-  // for them to look right.
-  if ( want3D || (m_windowStyle & wxSIMPLE_BORDER) || (m_windowStyle & wxRAISED_BORDER ) ||
-       (m_windowStyle & wxSUNKEN_BORDER) || (m_windowStyle & wxDOUBLE_BORDER))
-  {
-    msflags |= WS_BORDER;
-  }
+  msflags |= MSWGetStyle(style, & exStyle) ;
 
   return MSWCreate(wxGLCanvasClassName, NULL, pos, size, msflags, exStyle);
 }
index ea6f4cf692e5586153d2c3da9ca909c4d9610921..655dea67220d5958f65c2bb76c92ce53f8ab5af9 100644 (file)
@@ -123,8 +123,8 @@ bool wxListBox::Create(wxWindow *parent,
     int height = size.y;
     m_windowStyle = style;
 
-    DWORD wstyle = WS_VISIBLE | WS_VSCROLL | WS_TABSTOP |
-                   LBS_NOTIFY | LBS_HASSTRINGS /* | WS_CLIPSIBLINGS */;
+    DWORD wstyle = WS_VISIBLE | WS_CHILD | WS_VSCROLL | WS_TABSTOP |
+                   LBS_NOTIFY | LBS_HASSTRINGS ;
 
     wxASSERT_MSG( !(style & wxLB_MULTIPLE) || !(style & wxLB_EXTENDED),
                   _T("only one of listbox selection modes can be specified") );
@@ -158,32 +158,17 @@ bool wxListBox::Create(wxWindow *parent,
     // doesn't work properly
     wstyle |= LBS_NOINTEGRALHEIGHT;
 
-    bool want3D;
-    WXDWORD exStyle = Determine3DEffects(WS_EX_CLIENTEDGE, &want3D);
-
-    // Even with extended styles, need to combine with WS_BORDER for them to
-    // look right.
-    if ( want3D || wxStyleHasBorder(m_windowStyle) )
-    {
-        wstyle |= WS_BORDER;
-    }
+    WXDWORD exStyle = 0;
+    (void) MSWGetStyle(style, & exStyle) ;
 
     m_hWnd = (WXHWND)::CreateWindowEx(exStyle, wxT("LISTBOX"), NULL,
-            wstyle | WS_CHILD,
+            wstyle ,
             0, 0, 0, 0,
             (HWND)parent->GetHWND(), (HMENU)m_windowId,
             wxGetInstance(), NULL);
 
     wxCHECK_MSG( m_hWnd, FALSE, wxT("Failed to create listbox") );
 
-#if wxUSE_CTL3D
-    if (want3D)
-    {
-        Ctl3dSubclassCtl(GetHwnd());
-        m_useCtl3D = TRUE;
-    }
-#endif
-
     // Subclass again to catch messages
     SubclassWin(m_hWnd);
 
index 64e1e6078573ebfc0ce2f145d18f20c8e528c28a..c369f92b0fc2e7aa0a3881e36eb77f06f4e28c23 100644 (file)
@@ -291,8 +291,11 @@ bool wxListCtrl::Create(wxWindow *parent,
     if ( m_windowStyle & wxCLIP_SIBLINGS )
         wstyle |= WS_CLIPSIBLINGS;
 
+/*
     if ( wxStyleHasBorder(m_windowStyle) )
         wstyle |= WS_BORDER;
+*/
+
     m_baseStyle = wstyle;
 
     if ( !DoCreateControl(x, y, width, height) )
@@ -308,13 +311,8 @@ bool wxListCtrl::DoCreateControl(int x, int y, int w, int h)
 {
     DWORD wstyle = m_baseStyle;
 
-    bool want3D;
-    WXDWORD exStyle = Determine3DEffects(WS_EX_CLIENTEDGE, &want3D);
-
-    // Even with extended styles, need to combine with WS_BORDER
-    // for them to look right.
-    if ( want3D )
-        wstyle |= WS_BORDER;
+    WXDWORD exStyle = 0;
+    (void) MSWGetStyle(GetWindowStyle(), & exStyle) ;
 
     long oldStyle = 0; // Dummy
     wstyle |= ConvertToMSWStyle(oldStyle, m_windowStyle);
index cd2530761147a589167aaa9bde09be2deefc20a6..63cc9f5d4030914412d75e16fa762d9f04e2e84d 100644 (file)
@@ -82,15 +82,18 @@ bool wxScrollBar::Create(wxWindow *parent, wxWindowID id,
         height = 14;
     }
 
-    DWORD wstyle = WS_VISIBLE | WS_CHILD;
+    WXDWORD exStyle = 0;
+    WXDWORD wstyle = MSWGetStyle(style, & exStyle) ;
 
+/*    
     if ( m_windowStyle & wxCLIP_SIBLINGS )
       wstyle |= WS_CLIPSIBLINGS;
+*/
 
     // Now create scrollbar
     DWORD _direction = (style & wxHORIZONTAL) ?
                         SBS_HORZ: SBS_VERT;
-    HWND scroll_bar = CreateWindowEx(MakeExtendedStyle(style), wxT("SCROLLBAR"), wxT("scrollbar"),
+    HWND scroll_bar = CreateWindowEx(exStyle, wxT("SCROLLBAR"), wxT("scrollbar"),
                          _direction | wstyle,
                          0, 0, 0, 0, (HWND) parent->GetHWND(), (HMENU)m_windowId,
                          wxGetInstance(), NULL);
index d818a6b3a2761cfd55be581843eda6cf16a9f1c2..ba25fe168717c5a9d604919944738eceb0cbaa24 100644 (file)
@@ -59,6 +59,9 @@ bool wxSlider95::Create(wxWindow *parent, wxWindowID id,
            const wxValidator& validator,
            const wxString& name)
 {
+    if ( (style & wxBORDER_MASK) == wxBORDER_DEFAULT )
+        style |= wxBORDER_NONE;
+
     SetName(name);
 #if wxUSE_VALIDATORS
     SetValidator(validator);
@@ -90,15 +93,12 @@ bool wxSlider95::Create(wxWindow *parent, wxWindowID id,
     long msStyle = 0;
     long wstyle = 0;
 
-    if ( m_windowStyle & wxCLIP_SIBLINGS )
-        msStyle |= WS_CLIPSIBLINGS;
-
     if ( m_windowStyle & wxSL_LABELS )
     {
-        msStyle |= WS_CHILD | WS_VISIBLE | WS_BORDER | SS_CENTER;
+        msStyle |= SS_CENTER;
 
-        bool want3D;
-        WXDWORD exStyle = Determine3DEffects(WS_EX_CLIENTEDGE, &want3D) ;
+        WXDWORD exStyle = 0;
+        msStyle |= MSWGetStyle(GetWindowStyle(), & exStyle) ;
 
         m_staticValue = (WXHWND) CreateWindowEx
             (
@@ -123,10 +123,9 @@ bool wxSlider95::Create(wxWindow *parent, wxWindowID id,
             );
     }
 
-    msStyle = 0;
+    WXDWORD exStyle = 0;
 
-    if ( m_windowStyle & wxCLIP_SIBLINGS )
-        msStyle |= WS_CLIPSIBLINGS;
+    msStyle = MSWGetStyle(GetWindowStyle(), & exStyle) ;    
 
     if (m_windowStyle & wxSL_VERTICAL)
         msStyle = TBS_VERT | WS_CHILD | WS_VISIBLE | WS_TABSTOP ;
@@ -154,7 +153,7 @@ bool wxSlider95::Create(wxWindow *parent, wxWindowID id,
 
     HWND scroll_bar = CreateWindowEx
         (
-            MakeExtendedStyle(m_windowStyle), TRACKBAR_CLASS, wxT(""),
+            exStyle, TRACKBAR_CLASS, wxT(""),
             msStyle,
             0, 0, 0, 0, (HWND) parent->GetHWND(), (HMENU)m_windowId,
             wxGetInstance(), NULL
index 79bfa0f06fc8527f45054b9d6e77dd4ed6303f9a..0aad8787d239f383c90c98cd15aa198a6a104c82 100644 (file)
@@ -78,13 +78,11 @@ bool wxSliderMSW::Create(wxWindow *parent, wxWindowID id,
 
   // non-Win95 implementation
   
-  long msStyle = WS_CHILD | WS_VISIBLE | WS_BORDER | SS_CENTER;
+  long msStyle = SS_CENTER;
 
-   if ( m_windowStyle & wxCLIP_SIBLINGS )
-        msStyle |= WS_CLIPSIBLINGS;
-
-  bool want3D;
-  WXDWORD exStyle = Determine3DEffects(WS_EX_CLIENTEDGE, &want3D) ;
+ // WXDWORD exStyle = Determine3DEffects(WS_EX_CLIENTEDGE, &want3D) ;
+  WXDWORD exStyle = 0;
+  msStyle |= MSWGetStyle(GetWindowStyle(), & exStyle) ;
 
   m_staticValue = (WXHWND) CreateWindowEx(exStyle, wxT("STATIC"), NULL,
                            msStyle,
@@ -108,7 +106,7 @@ bool wxSliderMSW::Create(wxWindow *parent, wxWindowID id,
   else
     msStyle = SBS_HORZ | WS_CHILD | WS_VISIBLE | WS_TABSTOP ;
 
-  HWND scroll_bar = CreateWindowEx(MakeExtendedStyle(m_windowStyle), wxT("SCROLLBAR"), wxT(""),
+  HWND scroll_bar = CreateWindowEx(exStyle, wxT("SCROLLBAR"), wxT(""),
                          msStyle,
                          0, 0, 0, 0, (HWND) parent->GetHWND(), (HMENU)m_windowId,
                          wxGetInstance(), NULL);
index 672b161c2b3144e6901f3f1addbcbe664a437b5d..2f3bdc7b118cb28b81f359383088f6386b31f726 100644 (file)
@@ -238,6 +238,9 @@ bool wxSpinCtrl::Create(wxWindow *parent,
 
     SetWindowStyle(style);
 
+    WXDWORD exStyle = 0;
+    WXDWORD msStyle = MSWGetStyle(GetWindowStyle(), & exStyle) ;
+
     // calculate the sizes: the size given is the toal size for both controls
     // and we need to fit them both in the given width (height is the same)
     wxSize sizeText(size), sizeBtn(size);
@@ -265,18 +268,6 @@ bool wxSpinCtrl::Create(wxWindow *parent,
 
     // create the text window
 
-    bool want3D;
-    WXDWORD exStyle = Determine3DEffects(WS_EX_CLIENTEDGE, &want3D);
-    int msStyle = WS_CHILD;
-
-    // Even with extended styles, need to combine with WS_BORDER for them to
-    // look right.
-    if ( want3D || wxStyleHasBorder(style) )
-        msStyle |= WS_BORDER;
-
-    if ( style & wxCLIP_SIBLINGS )
-        msStyle |= WS_CLIPSIBLINGS;
-
     m_hwndBuddy = (WXHWND)::CreateWindowEx
                     (
                      exStyle,                // sunken border
index 0da7ce60b3feec6ce3c08e1e2e322c6c54c1992f..5248292eeaff588b209df192e28bceab91bb3762 100644 (file)
@@ -42,6 +42,10 @@ bool wxStaticText::Create(wxWindow *parent,
                           long style,
                           const wxString& name)
 {
+    // By default, a static text should have no border.
+    if ((style & wxBORDER_MASK) == wxBORDER_DEFAULT)
+        style |= wxBORDER_NONE;
+
     if ( !CreateControl(parent, id, pos, size, style, wxDefaultValidator, name) )
         return FALSE;
 
index 58889e0fb962ac069b6a6d216f1c6ab7e5caf054..d98f6bced53a59c53db9fc7ebb105a41d179b135 100644 (file)
@@ -85,10 +85,15 @@ bool wxToggleButton::Create(wxWindow *parent, wxWindowID id,
 #define BS_PUSHLIKE 0x00001000L
 #endif
 
-   long msStyle = BS_AUTOCHECKBOX | BS_PUSHLIKE | WS_TABSTOP | WS_CHILD | WS_VISIBLE;
+   WXDWORD exStyle = 0;
+   long msStyle = MSWGetStyle(style, & exStyle) ;
+    
+   msStyle |= BS_AUTOCHECKBOX | BS_PUSHLIKE | WS_TABSTOP ;
 
+/*   
    if ( m_windowStyle & wxCLIP_SIBLINGS )
         msStyle |= WS_CLIPSIBLINGS;
+*/
 
 #ifdef __WIN32__
    if(m_windowStyle & wxBU_LEFT)
@@ -101,7 +106,7 @@ bool wxToggleButton::Create(wxWindow *parent, wxWindowID id,
       msStyle |= BS_BOTTOM;
 #endif
 
-   m_hWnd = (WXHWND)CreateWindowEx(MakeExtendedStyle(m_windowStyle),
+   m_hWnd = (WXHWND)CreateWindowEx(exStyle,
                                    wxT("BUTTON"), label,
                                    msStyle, 0, 0, 0, 0,
                                    (HWND)parent->GetHWND(),
index 7f48e64a461683cb770959c13b8bb5e1edcb7eec..a3e8a8332931ead757f9f7068622100b97fb640f 100644 (file)
@@ -1165,9 +1165,22 @@ WXDWORD wxWindowMSW::MSWGetStyle(long flags, WXDWORD *exstyle) const
         style |= WS_CLIPSIBLINGS;
 
     wxBorder border = (wxBorder)(flags & wxBORDER_MASK);
-    if ( border != wxBORDER_NONE && border != wxBORDER_DEFAULT )
+    
+    // Check if we want to automatically give it a sunken style.
+    // Note than because 'sunken' actually maps to WS_EX_CLIENTEDGE, which
+    // is a more neutral term, we don't necessarily get a sunken effect in
+    // Windows XP. Instead we get the appropriate style for the theme.
+
+    if (border == wxBORDER_DEFAULT && wxTheApp->GetAuto3D() && GetParent() &&
+        ((GetParent()->GetWindowStyleFlag() & wxUSER_COLOURS) != wxUSER_COLOURS))
+    {
+        border = (wxBorder)((flags & wxBORDER_MASK) | wxBORDER_SUNKEN);
+    }   
+    
+    // Only give it WS_BORDER for wxBORDER_SIMPLE
+    if (border & wxBORDER_SIMPLE)
         style |= WS_BORDER;
-
+    
     // now deal with ext style if the caller wants it
     if ( exstyle )
     {
@@ -1176,7 +1189,7 @@ WXDWORD wxWindowMSW::MSWGetStyle(long flags, WXDWORD *exstyle) const
         if ( flags & wxTRANSPARENT_WINDOW )
             *exstyle |= WS_EX_TRANSPARENT;
 
-        switch ( flags & wxBORDER_MASK )
+        switch ( border )
         {
             default:
                 wxFAIL_MSG( _T("unknown border style") );
@@ -1197,6 +1210,7 @@ WXDWORD wxWindowMSW::MSWGetStyle(long flags, WXDWORD *exstyle) const
 
             case wxBORDER_SUNKEN:
                 *exstyle |= WS_EX_CLIENTEDGE;
+                style &= ~WS_BORDER;
                 break;
 
             case wxBORDER_DOUBLE:
@@ -1218,94 +1232,6 @@ WXDWORD wxWindowMSW::MSWGetStyle(long flags, WXDWORD *exstyle) const
     return style;
 }
 
-// Make a Windows extended style from the given wxWindows window style
-WXDWORD wxWindowMSW::MakeExtendedStyle(long style, bool eliminateBorders)
-{
-    WXDWORD exStyle = 0;
-    if ( style & wxTRANSPARENT_WINDOW )
-        exStyle |= WS_EX_TRANSPARENT;
-
-    if ( !eliminateBorders )
-    {
-        if ( style & wxSUNKEN_BORDER )
-            exStyle |= WS_EX_CLIENTEDGE;
-        if ( style & wxDOUBLE_BORDER )
-            exStyle |= WS_EX_DLGMODALFRAME;
-#if defined(__WIN95__)
-        if ( style & wxRAISED_BORDER )
-            // It seems that WS_EX_WINDOWEDGE doesn't work, but WS_EX_DLGMODALFRAME does
-            exStyle |= WS_EX_DLGMODALFRAME; /* WS_EX_WINDOWEDGE */;
-        if ( style & wxSTATIC_BORDER )
-            exStyle |= WS_EX_STATICEDGE;
-#endif
-    }
-
-    return exStyle;
-}
-
-// Determines whether native 3D effects or CTL3D should be used,
-// applying a default border style if required, and returning an extended
-// style to pass to CreateWindowEx.
-WXDWORD wxWindowMSW::Determine3DEffects(WXDWORD defaultBorderStyle,
-                                        bool *want3D) const
-{
-    // If matches certain criteria, then assume no 3D effects
-    // unless specifically requested (dealt with in MakeExtendedStyle)
-    if ( !GetParent()
-#if wxUSE_CONTROLS
-            || !IsKindOf(CLASSINFO(wxControl))
-#endif // wxUSE_CONTROLS
-            || (m_windowStyle & wxNO_BORDER) )
-    {
-        *want3D = FALSE;
-        return MakeExtendedStyle(m_windowStyle);
-    }
-
-    // Determine whether we should be using 3D effects or not.
-    bool nativeBorder = FALSE; // by default, we don't want a Win95 effect
-
-    // 1) App can specify global 3D effects
-    *want3D = wxTheApp->GetAuto3D();
-
-    // 2) If the parent is being drawn with user colours, or simple border specified,
-    // switch effects off. TODO: replace wxUSER_COLOURS with wxNO_3D
-    if ( GetParent() && (GetParent()->GetWindowStyleFlag() & wxUSER_COLOURS) || (m_windowStyle & wxSIMPLE_BORDER) )
-        *want3D = FALSE;
-
-    // 3) Control can override this global setting by defining
-    // a border style, e.g. wxSUNKEN_BORDER
-    if ( m_windowStyle & wxSUNKEN_BORDER  )
-        *want3D = TRUE;
-
-    // 4) If it's a special border, CTL3D can't cope so we want a native border
-    if ( (m_windowStyle & wxDOUBLE_BORDER) || (m_windowStyle & wxRAISED_BORDER) ||
-        (m_windowStyle & wxSTATIC_BORDER) )
-    {
-        *want3D = TRUE;
-        nativeBorder = TRUE;
-    }
-
-    // 5) If this isn't a Win95 app, and we are using CTL3D, remove border
-    // effects from extended style
-#if wxUSE_CTL3D
-    if ( *want3D )
-        nativeBorder = FALSE;
-#endif
-
-    DWORD exStyle = MakeExtendedStyle(m_windowStyle, !nativeBorder);
-
-    // If we want 3D, but haven't specified a border here,
-    // apply the default border style specified.
-    // TODO what about non-Win95 WIN32? Does it have borders?
-#if defined(__WIN95__) && !wxUSE_CTL3D
-    if ( defaultBorderStyle && (*want3D) && ! ((m_windowStyle & wxDOUBLE_BORDER) || (m_windowStyle & wxRAISED_BORDER ) ||
-        (m_windowStyle & wxSTATIC_BORDER) || (m_windowStyle & wxSIMPLE_BORDER) ))
-        exStyle |= defaultBorderStyle; // WS_EX_CLIENTEDGE;
-#endif
-
-    return exStyle;
-}
-
 #if WXWIN_COMPATIBILITY
 // If nothing defined for this, try the parent.
 // E.g. we may be a button loaded from a resource, with no callback function