#pragma hdrstop
#endif
+#if wxUSE_SASH
+
#ifndef WX_PRECOMP
#include "wx/wx.h"
#endif
-#if wxUSE_SASH
-
#include <math.h>
#include <stdlib.h>
#include "wx/sashwin.h"
#include "wx/laywin.h"
+DEFINE_EVENT_TYPE(wxEVT_SASH_DRAGGED)
+
IMPLEMENT_DYNAMIC_CLASS(wxSashWindow, wxWindow)
IMPLEMENT_DYNAMIC_CLASS(wxSashEvent, wxCommandEvent)
m_maximumPaneSizeY = 10000;
m_sashCursorWE = new wxCursor(wxCURSOR_SIZEWE);
m_sashCursorNS = new wxCursor(wxCURSOR_SIZENS);
+ m_mouseCaptured = FALSE;
// Eventually, we'll respond to colour change messages
InitColours();
// reset the cursor
#if defined(__WXMOTIF__) || defined(__WXGTK__)
- SetCursor(* wxSTANDARD_CURSOR);
+ // Not necessary and in fact inhibits proper cursor setting (JACS 8/2000)
+ //SetCursor(* wxSTANDARD_CURSOR);
#endif
#ifdef __WXMSW__
SetCursor(wxNullCursor);
if (event.LeftDown())
{
CaptureMouse();
+ m_mouseCaptured = TRUE;
if ( sashHit != wxSASH_NONE )
{
else if ( event.LeftUp() && m_dragMode == wxSASH_DRAG_LEFT_DOWN )
{
// Wasn't a proper drag
- ReleaseMouse();
+ if (m_mouseCaptured)
+ ReleaseMouse();
+ m_mouseCaptured = FALSE;
+
wxScreenDC::EndDrawingOnTop();
m_dragMode = wxSASH_DRAG_NONE;
m_draggingEdge = wxSASH_NONE;
{
// We can stop dragging now and see what we've got.
m_dragMode = wxSASH_DRAG_NONE;
- ReleaseMouse();
+ if (m_mouseCaptured)
+ ReleaseMouse();
+ m_mouseCaptured = FALSE;
+
// Erase old tracker
DrawSashTracker(m_draggingEdge, m_oldX, m_oldY);
}
else if ( event.LeftUp() )
{
- ReleaseMouse();
+ if (m_mouseCaptured)
+ ReleaseMouse();
+ m_mouseCaptured = FALSE;
}
else if (event.Moving() && !event.Dragging())
{
void wxSashWindow::InitColours()
{
// Shadow colours
-#if defined(__WIN95__)
+#ifndef __WIN16__
m_faceColour = wxSystemSettings::GetSystemColour(wxSYS_COLOUR_3DFACE);
m_mediumShadowColour = wxSystemSettings::GetSystemColour(wxSYS_COLOUR_3DSHADOW);
m_darkShadowColour = wxSystemSettings::GetSystemColour(wxSYS_COLOUR_3DDKSHADOW);