X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/ac6bdf4056e08575f4d27b2e451a9dcdbe9742f8..7cc5a448dc310ace36a4d5ef47121d86cee131e5:/src/generic/splitter.cpp?ds=sidebyside diff --git a/src/generic/splitter.cpp b/src/generic/splitter.cpp index 65fc2e4f30..8205ca5e24 100644 --- a/src/generic/splitter.cpp +++ b/src/generic/splitter.cpp @@ -33,6 +33,7 @@ #include "wx/dcscreen.h" #include "wx/settings.h" #include "wx/log.h" +#include "wx/utils.h" DEFINE_EVENT_TYPE(wxEVT_COMMAND_SPLITTER_SASH_POS_CHANGED) DEFINE_EVENT_TYPE(wxEVT_COMMAND_SPLITTER_SASH_POS_CHANGING) @@ -87,6 +88,13 @@ bool wxSplitterWindow::Create(wxWindow *parent, wxWindowID id, m_borderSize = 1; else m_borderSize = 0; + +#ifdef __WXMAC__ + int major,minor; + wxGetOsVersion( &major, &minor ); + if (major >= 10) + m_windowStyle |= wxSP_SASH_AQUA; +#endif return TRUE; } @@ -508,12 +516,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 +532,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 +559,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 +573,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 @@ -872,20 +874,20 @@ void wxSplitterWindow::InitColours() // Shadow colours #ifndef __WIN16__ - wxColour faceColour(wxSystemSettings::GetSystemColour(wxSYS_COLOUR_3DFACE)); + wxColour faceColour(wxSystemSettings::GetColour(wxSYS_COLOUR_3DFACE)); m_facePen = new wxPen(faceColour, 1, wxSOLID); m_faceBrush = new wxBrush(faceColour, wxSOLID); - wxColour mediumShadowColour(wxSystemSettings::GetSystemColour(wxSYS_COLOUR_3DSHADOW)); + wxColour mediumShadowColour(wxSystemSettings::GetColour(wxSYS_COLOUR_3DSHADOW)); m_mediumShadowPen = new wxPen(mediumShadowColour, 1, wxSOLID); - wxColour darkShadowColour(wxSystemSettings::GetSystemColour(wxSYS_COLOUR_3DDKSHADOW)); + wxColour darkShadowColour(wxSystemSettings::GetColour(wxSYS_COLOUR_3DDKSHADOW)); m_darkShadowPen = new wxPen(darkShadowColour, 1, wxSOLID); - wxColour lightShadowColour(wxSystemSettings::GetSystemColour(wxSYS_COLOUR_3DLIGHT)); + wxColour lightShadowColour(wxSystemSettings::GetColour(wxSYS_COLOUR_3DLIGHT)); m_lightShadowPen = new wxPen(lightShadowColour, 1, wxSOLID); - wxColour hilightColour(wxSystemSettings::GetSystemColour(wxSYS_COLOUR_3DHILIGHT)); + wxColour hilightColour(wxSystemSettings::GetColour(wxSYS_COLOUR_3DHILIGHT)); m_hilightPen = new wxPen(hilightColour, 1, wxSOLID); #else m_facePen = new wxPen("LIGHT GREY", 1, wxSOLID);