Applied recent FL patches from Benjamin Williams <biwilliajsb@yahoo.com>.

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
This commit is contained in:
Julian Smart 2002-06-12 08:29:12 +00:00
parent 93692400d0
commit 879da8c81b
3 changed files with 50 additions and 16 deletions

View 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;

View 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 );

View 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;