]> git.saurik.com Git - wxWidgets.git/commitdiff
Applied recent FL patches from Benjamin Williams <biwilliajsb@yahoo.com>.
authorJulian Smart <julian@anthemion.co.uk>
Wed, 12 Jun 2002 08:29:12 +0000 (08:29 +0000)
committerJulian Smart <julian@anthemion.co.uk>
Wed, 12 Jun 2002 08:29:12 +0000 (08:29 +0000)
1) There is a problem
in that floating frames are not currently supported
with !mRealTimeUpdates.  We wrote a patch to correct
this problem.  You will find it attached to this
posting.

Here is a description of what was changed and why.  In
cbBarDragPlugin::ShowHint(), SetBarState is called
every time mpCurPane changes.  This is correct.
However, this also happens every time, even if
mRealTimeUpdates is false.  The state should not be
changed during the drag operation if mRealTimeUpdates
is off.  This is corrected in this patch.  Code was
also added in cbBarDragPlugin::OnLButtonUp() to
actually do the state changing, only if
mRealTimeUpdates is off.  Normally, this is performed
in ShowHint if mRealTimeUpdates is on.

I also took the liberty of changing the drag cursor
back to an arrow.  This is the way it is in MS Visual
C++, and it looks way better.  The MoveWindow cursor
looks terrible, IMHO.  When FL gets the embedded
cursor code working, we can switch back to a hand or
something else.

2) This time we have
discovered a crash bug in FL.  The steps to reproduce this
bug are as follows:

1. Open up a pane, dock it.
2. Click the Expand button (arrow button) in the
   frame hints portion
3. Click it again to Collapse the pane.
4. Now click the close button of the pane. Crash.

We investigated what was causing this problem, and it turns
out that the button state never gets unset.  Once a button
is pressed, it is always pressed.  Thus, when the expand/
collapse button is pressed, and then the close button is
pressed, the pane will close, but then FL will also try to
expand or collapse the pane as well, because it thinks that
the expand/collapse button was set.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@15802 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

contrib/src/fl/bardragpl.cpp
contrib/src/fl/barhintspl.cpp
contrib/src/fl/toolwnd.cpp

index 50ee1a43afd14ebc789440b116173129f95d81d3..4e35ae422e53ab98490d6be34a26f5ad06f85d4c 100644 (file)
@@ -456,17 +456,6 @@ void cbBarDragPlugin::ShowHint( bool prevWasInClient )
 {
        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 )
        {
@@ -510,6 +499,18 @@ void cbBarDragPlugin::ShowHint( bool prevWasInClient )
        {
                // 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();
@@ -641,16 +642,25 @@ void cbBarDragPlugin::OnMouseMove( cbMotionEvent& event )
        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 );
 }
@@ -687,9 +697,26 @@ void cbBarDragPlugin::OnLButtonUp( cbLeftUpEvent& event )
                                        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;
 
@@ -753,7 +780,7 @@ void cbBarDragPlugin::OnStartBarDragging( cbStartBarDraggingEvent& event )
        mpLayout->CaptureEventsForPane( event.mpPane );
        mpLayout->CaptureEventsForPlugin( this );
 
-       mpLayout->GetParentFrame().SetCursor( *mpLayout->mpDragCursor );
+       mpLayout->GetParentFrame().SetCursor( *mpLayout->mpNormalCursor );
 
        mBarDragStarted = TRUE;
 
index eb1f67168508b0927896c15a2dead45bff92f1da..241a98dea44dfc4e2dffc15ae8d57ab4bd76421f 100644 (file)
@@ -467,6 +467,11 @@ void cbBarHintsPlugin::OnLeftDown( cbLeftDownEvent& event )
         {
             int i;
             for ( i = 0; i != BOXES_IN_HINT; ++i )
+            {
+                mBoxes[i]->mPressed = FALSE;
+                mBoxes[i]->mWasClicked = FALSE;
+            }
+            for ( i = 0; i != BOXES_IN_HINT; ++i )
             {
                 mBoxes[i]->OnLeftDown( inFrame );
 
index a018ce3c5c15292177629530557b9b693d0080b0..3f9824bf9f349bb6d26904ebe69a4b750efcbb24 100644 (file)
@@ -571,6 +571,8 @@ void wxToolWindow::OnMotion( wxMouseEvent& event )
                {
                        DrawHintRect( mPrevHintRect );
                        DrawHintRect( finalRect );
+
+            ::wxLogTrace("%d,%d / %d,%d\n", finalRect.x, finalRect.y, finalRect.width, finalRect.height);
                }
 
                mPrevHintRect = finalRect;