From d30f0930060a3091d7326dff8c4e5fa09f638e99 Mon Sep 17 00:00:00 2001
From: Robert Roebling <robert@roebling.de>
Date: Thu, 6 Dec 2001 17:01:00 +0000
Subject: [PATCH] Added wxSP_SASH_AQUA style

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@12889 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
---
 docs/latex/wx/splitter.tex |  6 +++--
 include/wx/defs.h          |  1 +
 src/generic/splitter.cpp   | 52 +++++++++++++++++---------------------
 3 files changed, 28 insertions(+), 31 deletions(-)

diff --git a/docs/latex/wx/splitter.tex b/docs/latex/wx/splitter.tex
index bd311fcabc..9283b69008 100644
--- a/docs/latex/wx/splitter.tex
+++ b/docs/latex/wx/splitter.tex
@@ -6,8 +6,9 @@ This class manages up to two subwindows. The current view can be
 split into two programmatically (perhaps from a menu command), and unsplit
 either programmatically or via the wxSplitterWindow user interface.
 
-Appropriate 3D shading for the Windows 95 user interface is an option.
-This is also recommended for GTK.
+Appropriate 3D shading for the Windows 95 user interface is an option -
+this is also recommended for GTK. Optionally, the sash can be made to
+look more like the native control under MacOS X.
 
 \wxheading{Window styles}
 
@@ -16,6 +17,7 @@ This is also recommended for GTK.
 \twocolitem{\windowstyle{wxSP\_3DSASH}}{Draws a 3D effect sash.}
 \twocolitem{\windowstyle{wxSP\_3DBORDER}}{Draws a 3D effect border.}
 \twocolitem{\windowstyle{wxSP\_FULLSASH}}{Draws the ends of the sash (so the window can be used without a border).}
+\twocolitem{\windowstyle{wxSP\_SASH\_AQUA}}{Draws a sash with an Aqua-like appearance.}
 \twocolitem{\windowstyle{wxSP\_BORDER}}{Draws a thin black border around the window.}
 \twocolitem{\windowstyle{wxSP\_NOBORDER}}{No border, and a black sash.}
 \twocolitem{\windowstyle{wxSP\_PERMIT\_UNSPLIT}}{Always allow to
diff --git a/include/wx/defs.h b/include/wx/defs.h
index aadb798c3c..07d0e93c09 100644
--- a/include/wx/defs.h
+++ b/include/wx/defs.h
@@ -1040,6 +1040,7 @@ enum wxBorder
 #define wxSP_3DBORDER         0x0200
 #define wxSP_FULLSASH         0x0400
 #define wxSP_3D               (wxSP_3DBORDER | wxSP_3DSASH)
+#define wxSP_SASH_AQUA        0x0800
 
 /*
  * wxNotebook flags
diff --git a/src/generic/splitter.cpp b/src/generic/splitter.cpp
index 65fc2e4f30..4aad72698c 100644
--- a/src/generic/splitter.cpp
+++ b/src/generic/splitter.cpp
@@ -508,12 +508,11 @@ void wxSplitterWindow::DrawSash(wxDC& dc)
         if ( m_splitMode == wxSPLIT_VERTICAL )
         {
             dc.SetPen(*m_facePen);
-            // How to test for Aqua?
-#ifdef __DARWIN__
-            dc.SetBrush(*wxWHITE_BRUSH);
-#else
-            dc.SetBrush(*m_faceBrush);
-#endif
+
+            if (HasFlag( wxSP_SASH_AQUA ))
+                dc.SetBrush(*wxWHITE_BRUSH);
+            else
+                dc.SetBrush(*m_faceBrush);
             dc.DrawRectangle(m_sashPosition + 2, 0 , m_sashSize - 4, h );
 
             dc.SetBrush(*wxTRANSPARENT_BRUSH);
@@ -525,17 +524,16 @@ void wxSplitterWindow::DrawSash(wxDC& dc)
             dc.SetPen(*m_hilightPen);
             dc.DrawLine(m_sashPosition+1, m_borderSize - 2, m_sashPosition+1, h - m_borderSize+2);
 
-#ifndef __DARWIN__
-            dc.SetPen(*m_mediumShadowPen);
-#endif
-                        int yMedium = m_borderSize ? h-m_borderSize+1 : h ;
+            if (!HasFlag( wxSP_SASH_AQUA ))
+                dc.SetPen(*m_mediumShadowPen);
+
+            int yMedium = m_borderSize ? h-m_borderSize+1 : h ;
             dc.DrawLine(m_sashPosition+m_sashSize-2, xShadow, m_sashPosition+m_sashSize-2, yMedium);
 
-#ifdef __DARWIN__
-            dc.SetPen(*m_lightShadowPen);
-#else
-            dc.SetPen(*m_darkShadowPen);
-#endif
+            if (HasFlag( wxSP_SASH_AQUA ))
+                dc.SetPen(*m_lightShadowPen);
+            else
+                dc.SetPen(*m_darkShadowPen);
             dc.DrawLine(m_sashPosition+m_sashSize-1, m_borderSize, m_sashPosition+m_sashSize-1, h-m_borderSize );
             
             // Draw the top and bottom edges of the sash, if requested
@@ -553,12 +551,10 @@ void wxSplitterWindow::DrawSash(wxDC& dc)
         else
         {
             dc.SetPen(*m_facePen);
-            // How to test for Aqua?
-#ifdef __DARWIN__
-            dc.SetBrush(*wxWHITE_BRUSH);
-#else
-            dc.SetBrush(*m_faceBrush);
-#endif
+            if (HasFlag( wxSP_SASH_AQUA ))
+                dc.SetBrush(*wxWHITE_BRUSH);
+            else
+                dc.SetBrush(*m_faceBrush);
             dc.DrawRectangle( m_borderSize-2, m_sashPosition + 2, w-m_borderSize+2, m_sashSize - 4);
 
             dc.SetBrush(*wxTRANSPARENT_BRUSH);
@@ -569,16 +565,14 @@ void wxSplitterWindow::DrawSash(wxDC& dc)
             dc.SetPen(*m_hilightPen);
             dc.DrawLine(m_borderSize-2, m_sashPosition+1, w-m_borderSize+1, m_sashPosition+1);
 
-#ifndef __DARWIN__
-            dc.SetPen(*m_mediumShadowPen);
-#endif
+            if (!HasFlag( wxSP_SASH_AQUA ))
+                dc.SetPen(*m_mediumShadowPen);
             dc.DrawLine(m_borderSize-1, m_sashPosition+m_sashSize-2, w-m_borderSize+1, m_sashPosition+m_sashSize-2);
 
-#ifdef __DARWIN__
-            dc.SetPen(*m_lightShadowPen);
-#else
-            dc.SetPen(*m_darkShadowPen);
-#endif
+            if (HasFlag( wxSP_SASH_AQUA ))
+                dc.SetPen(*m_lightShadowPen);
+            else
+                dc.SetPen(*m_darkShadowPen);
             dc.DrawLine(m_borderSize, m_sashPosition+m_sashSize-1, w-m_borderSize, m_sashPosition+m_sashSize-1);
 
             // Draw the left and right edges of the sash, if requested
-- 
2.50.0

