/////////////////////////////////////////////////////////////////////////////
-// Name: No names yet.
-// Purpose: Contrib. demo
+// Name: bardragpl.cpp
+// Purpose: cbBarDragPlugin implementation
// Author: Aleksandras Gluchovas
// Modified by:
// Created: 23/09/98
// RCS-ID: $Id$
// Copyright: (c) Aleksandras Gluchovas
-// Licence: wxWindows license
+// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifdef __GNUG__
: mousePos.x > bounds.x;
// NOTE:: about all the below min/max things: they are meant to ensure
- // that mouse pointer doesn't overrun (leave) the hint-rectangle
- // when dimensions it's are recalculated upon sticking it to the pane
+ // that the mouse pointer doesn't overrun (leave) the hint-rectangle
+ // when its dimensions are recalculated upon sticking it to the pane
if ( pPane->IsHorizontal() && fromLowerEdge )
{
void cbBarDragPlugin::UnstickFromPane( cbDockPane* pPane, wxPoint& mousePos )
{
- // unsticking causes rectangle to get the shape, in which
+ // unsticking causes rectangle to get the shape in which
// dragged control-bar would be when floated
-
int newWidth = mpDraggedBar->mDimInfo.mSizes[wxCBAR_FLOATING].x;
int newHeight = mpDraggedBar->mDimInfo.mSizes[wxCBAR_FLOATING].y;
{
bool wasDocked = FALSE;
- if ( mpDraggedBar->mState != wxCBAR_FLOATING && !mpCurPane )
- {
- mpLayout->SetBarState( mpDraggedBar, wxCBAR_FLOATING, TRUE );
- }
- else
- if ( mpDraggedBar->mState == wxCBAR_FLOATING && mpCurPane )
- {
- mpLayout->SetBarState( mpDraggedBar, wxCBAR_DOCKED_HORIZONTALLY, FALSE );
-
- wasDocked = TRUE;
- }
if ( mpSrcPane->mProps.mRealTimeUpdatesOn == FALSE )
{
- // do hevy calculations first
+ // do heavy calculations first
wxRect actualRect = mHintRect; // will be adjusted depending on drag-settings
if ( mpSrcPane->mProps.mExactDockPredictionOn && mpCurPane )
{
- bool success = mpLayout->RedockBar( mpDraggedBar, mHintRect, mpCurPane, FALSE );
+ #ifdef __WXDEBUG__
+ bool success =
+ #endif
+ mpLayout->RedockBar( mpDraggedBar, mHintRect, mpCurPane, FALSE );
wxASSERT( success ); // DBG::
{
// otherwise, if real-time updates option is ON
+ if ( mpDraggedBar->mState != wxCBAR_FLOATING && !mpCurPane )
+ {
+ mpLayout->SetBarState( mpDraggedBar, wxCBAR_FLOATING, TRUE );
+ }
+ else
+ if ( mpDraggedBar->mState == wxCBAR_FLOATING && mpCurPane )
+ {
+ mpLayout->SetBarState( mpDraggedBar, wxCBAR_DOCKED_HORIZONTALLY, FALSE );
+
+ wasDocked = TRUE;
+ }
+
if ( mpCurPane )
{
mpLayout->GetUpdatesManager().OnStartChanges();
mpDraggedBar->mUMgrData.SetDirty( TRUE );
- bool success = mpLayout->RedockBar( mpDraggedBar, mHintRect, mpCurPane, FALSE );
+ #ifdef __WXDEBUG__
+ bool success =
+ #endif
+ mpLayout->RedockBar( mpDraggedBar, mHintRect, mpCurPane, FALSE );
wxASSERT( success ); // DBG ::
wxCursor* pPrevCurs = mpCurCursor;
if ( mpCurPane )
-
- mpCurCursor = mpLayout->mpDragCursor;
+ {
+ mpCurCursor = mpLayout->mpNormalCursor;
+ }
else
{
- if ( mpLayout->mFloatingOn && mpSrcPane->mProps.mRealTimeUpdatesOn )
+ // if floating is off, and we are in the client
+ // area, the cursor will be invalid, otherwise
+ // it will be the normal cursor
- mpCurCursor = mpLayout->mpDragCursor;
+ if (mpLayout->mFloatingOn)
+ {
+ mpCurCursor = mpLayout->mpNormalCursor;
+ }
else
+ {
mpCurCursor = mpLayout->mpNECursor;
}
+ }
if ( pPrevCurs != mpCurCursor )
-
mpLayout->GetParentFrame().SetCursor( *mpCurCursor );
}
{
if ( mBarDragStarted )
{
- wxMessageBox("DblClick!");
+ wxMessageBox(wxT("DblClick!"));
}
event.Skip();
mpLayout->GetUpdatesManager().UpdateNow();
}
else
+ {
+ if (mpDraggedBar->mState == wxCBAR_FLOATING)
+ {
+ mpLayout->SetBarState( mpDraggedBar, wxCBAR_DOCKED_HORIZONTALLY, TRUE);
+ }
+
mpLayout->RedockBar( mpDraggedBar, mHintRect, mpCurPane );
}
}
+ else
+ {
+ if (mpDraggedBar->mState != wxCBAR_FLOATING)
+ {
+ mpLayout->SetBarState(mpDraggedBar, wxCBAR_FLOATING, true);
+ }
+
+ mpDraggedBar->mDimInfo.mBounds[ wxCBAR_FLOATING ] = mHintRect;
+ mpLayout->ApplyBarProperties( mpDraggedBar );
+ }
+ }
mHintRect.width = -1;
- mpLayout->GetParentFrame().SetCursor( *mpLayout->mpNormalCursor );
+ // In Windows, at least, the frame needs to have a null cursor
+ // else child windows (such as text windows) inherit the cursor
+#if 1
+ mpLayout->GetParentFrame().SetCursor( wxNullCursor );
+#else
+ mpLayout->GetParentFrame().SetCursor( *mpLayout->mpNormalCursor );
+#endif
mpLayout->ReleaseEventsFromPane( event.mpPane );
mpLayout->ReleaseEventsFromPlugin( this );
mpLayout->CaptureEventsForPane( event.mpPane );
mpLayout->CaptureEventsForPlugin( this );
- mpLayout->GetParentFrame().SetCursor( *mpLayout->mpDragCursor );
+ mpLayout->GetParentFrame().SetCursor( *mpLayout->mpNormalCursor );
mBarDragStarted = TRUE;