]> git.saurik.com Git - wxWidgets.git/blobdiff - src/generic/sashwin.cpp
don't set virtual size of the window to (0, 0) if scrollbars are removed from it
[wxWidgets.git] / src / generic / sashwin.cpp
index 5bff2ebf1ee179faa86f3dcfef92f863a25a4453..b2cd42c75979c77e7954acaa5e530d043fae5423 100644 (file)
@@ -8,7 +8,7 @@
 // Created:     01/02/97
 // RCS-ID:      $Id$
 // Copyright:   (c) Julian Smart
 // Created:     01/02/97
 // RCS-ID:      $Id$
 // Copyright:   (c) Julian Smart
-// Licence:     wxWidgets licence
+// Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
 #if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
 /////////////////////////////////////////////////////////////////////////////
 
 #if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
@@ -30,7 +30,8 @@
     #include "wx/settings.h"
 #endif
 
     #include "wx/settings.h"
 #endif
 
-#include <math.h>
+#include "wx/math.h"
+
 #include <stdlib.h>
 
 #include "wx/dcscreen.h"
 #include <stdlib.h>
 
 #include "wx/dcscreen.h"
@@ -80,7 +81,7 @@ void wxSashWindow::Init()
     m_maximumPaneSizeY = 10000;
     m_sashCursorWE = new wxCursor(wxCURSOR_SIZEWE);
     m_sashCursorNS = new wxCursor(wxCURSOR_SIZENS);
     m_maximumPaneSizeY = 10000;
     m_sashCursorWE = new wxCursor(wxCURSOR_SIZEWE);
     m_sashCursorNS = new wxCursor(wxCURSOR_SIZENS);
-    m_mouseCaptured = FALSE;
+    m_mouseCaptured = false;
     m_currentCursor = NULL;
 
     // Eventually, we'll respond to colour change messages
     m_currentCursor = NULL;
 
     // Eventually, we'll respond to colour change messages
@@ -105,7 +106,7 @@ void wxSashWindow::OnMouseEvent(wxMouseEvent& event)
     if (event.LeftDown())
     {
         CaptureMouse();
     if (event.LeftDown())
     {
         CaptureMouse();
-        m_mouseCaptured = TRUE;
+        m_mouseCaptured = true;
 
         if ( sashHit != wxSASH_NONE )
         {
 
         if ( sashHit != wxSASH_NONE )
         {
@@ -154,7 +155,7 @@ void wxSashWindow::OnMouseEvent(wxMouseEvent& event)
         // Wasn't a proper drag
         if (m_mouseCaptured)
             ReleaseMouse();
         // Wasn't a proper drag
         if (m_mouseCaptured)
             ReleaseMouse();
-        m_mouseCaptured = FALSE;
+        m_mouseCaptured = false;
 
         wxScreenDC::EndDrawingOnTop();
         m_dragMode = wxSASH_DRAG_NONE;
 
         wxScreenDC::EndDrawingOnTop();
         m_dragMode = wxSASH_DRAG_NONE;
@@ -166,7 +167,7 @@ void wxSashWindow::OnMouseEvent(wxMouseEvent& event)
         m_dragMode = wxSASH_DRAG_NONE;
         if (m_mouseCaptured)
             ReleaseMouse();
         m_dragMode = wxSASH_DRAG_NONE;
         if (m_mouseCaptured)
             ReleaseMouse();
-        m_mouseCaptured = FALSE;
+        m_mouseCaptured = false;
 
         // Erase old tracker
         DrawSashTracker(m_draggingEdge, m_oldX, m_oldY);
 
         // Erase old tracker
         DrawSashTracker(m_draggingEdge, m_oldX, m_oldY);
@@ -187,8 +188,8 @@ void wxSashWindow::OnMouseEvent(wxMouseEvent& event)
         wxSashDragStatus status = wxSASH_STATUS_OK;
 
         // the new height and width of the window - if -1, it didn't change
         wxSashDragStatus status = wxSASH_STATUS_OK;
 
         // the new height and width of the window - if -1, it didn't change
-        int newHeight = -1,
-            newWidth = -1;
+        int newHeight = wxDefaultCoord,
+            newWidth = wxDefaultCoord;
 
         // NB: x and y may be negative and they're relative to the sash window
         //     upper left corner, while xp and yp are expressed in the parent
 
         // NB: x and y may be negative and they're relative to the sash window
         //     upper left corner, while xp and yp are expressed in the parent
@@ -253,7 +254,7 @@ void wxSashWindow::OnMouseEvent(wxMouseEvent& event)
                 break;
         }
 
                 break;
         }
 
-        if ( newHeight == -1 )
+        if ( newHeight == wxDefaultCoord )
         {
             // didn't change
             newHeight = h;
         {
             // didn't change
             newHeight = h;
@@ -265,7 +266,7 @@ void wxSashWindow::OnMouseEvent(wxMouseEvent& event)
             newHeight = wxMin(newHeight, m_maximumPaneSizeY);
         }
 
             newHeight = wxMin(newHeight, m_maximumPaneSizeY);
         }
 
-        if ( newWidth == -1 )
+        if ( newWidth == wxDefaultCoord )
         {
             // didn't change
             newWidth = w;
         {
             // didn't change
             newWidth = w;
@@ -289,7 +290,7 @@ void wxSashWindow::OnMouseEvent(wxMouseEvent& event)
     {
         if (m_mouseCaptured)
            ReleaseMouse();
     {
         if (m_mouseCaptured)
            ReleaseMouse();
-        m_mouseCaptured = FALSE;
+        m_mouseCaptured = false;
     }
     else if (event.Moving() && !event.Dragging())
     {
     }
     else if (event.Moving() && !event.Dragging())
     {
@@ -483,8 +484,10 @@ void wxSashWindow::DrawSash(wxSashEdgePosition edge, wxDC& dc)
     wxPen darkShadowPen(m_darkShadowColour, 1, wxSOLID);
     wxPen lightShadowPen(m_lightShadowColour, 1, wxSOLID);
     wxPen hilightPen(m_hilightColour, 1, wxSOLID);
     wxPen darkShadowPen(m_darkShadowColour, 1, wxSOLID);
     wxPen lightShadowPen(m_lightShadowColour, 1, wxSOLID);
     wxPen hilightPen(m_hilightColour, 1, wxSOLID);
-    wxPen blackPen(wxColour(0, 0, 0), 1, wxSOLID);
-    wxPen whitePen(wxColour(255, 255, 255), 1, wxSOLID);
+    wxColour blackClr(0, 0, 0);
+    wxColour whiteClr(255, 255, 255);
+    wxPen blackPen(blackClr, 1, wxSOLID);
+    wxPen whitePen(whiteClr, 1, wxSOLID);
 
     if ( edge == wxSASH_LEFT || edge == wxSASH_RIGHT )
     {
 
     if ( edge == wxSASH_LEFT || edge == wxSASH_RIGHT )
     {