Esempio n. 1
0
cbDockPane* cbBarDragPlugin::HitTestPanes( wxRect& rect )
{
    //wxRect clipped = rect;

    //ClipRectInFrame( clipped );

    cbDockPane** pPanes = mpLayout->GetPanesArray();

    for( int i = 0; i != MAX_PANES; ++i )
        if ( rect_hits_rect( pPanes[i]->mBoundsInParent, rect ) )
            return pPanes[i];

    return NULL;
}
Esempio n. 2
0
void cbGCUpdatesMgr::DoRepositionItems( wxList& items )
{
    wxNode* pNode1 = items.GetFirst();

    while( pNode1 )
    {
        cbRectInfo& info = node_to_rect_info( pNode1 );

        wxNode* pNode2 = items.GetFirst();

        // and node itself

        mGC.AddObject( &info );

        while( pNode2 )
        {
            if ( pNode2 != pNode1 ) // node should not depend on itself
            {
                // Add references to objects on which this object
                // depends. Dependency here indicates intersection of current
                // bounds of this object with the initial bounds of the
                // other object.

                cbRectInfo& otherInfo = node_to_rect_info( pNode2 );

                if ( rect_hits_rect( *info.mpCurBounds, *otherInfo.mpPrevBounds ) )
                
                                    // the node    depends on node
                    mGC.AddDependency( &info,      &otherInfo      );
            }

            pNode2 = pNode2->GetNext();
        }

        pNode1 = pNode1->GetNext();
    }

    mGC.ArrangeCollection(); // order nodes according "least-dependency" rule,
                             // and find out cycled chains

    // Regular item nodes need to be resized, but not repainted (since
    // they stand in linear (not cyclic) dependency with other
    // regular nodes).

    wxNode* pNode = mGC.GetRegularObjects().GetFirst();

    while ( pNode )
    {
        cbRectInfo& info = *((cbRectInfo*)gc_node_to_obj(pNode));

        if ( info.mpBar == NULL ) 
            
            mpLayout->PositionClientWindow();
        else
            info.mpPane->SizeBar( info.mpBar );

        pNode = pNode->GetNext();
    }

    // cycled item nodes, need to be both resized and repainted

    pNode = mGC.GetCycledObjects().GetFirst();

    while ( pNode )
    {
        cbRectInfo& info = *((cbRectInfo*)gc_node_to_obj(pNode));

        if ( info.mpBar == NULL ) 
        {
            wxWindow* pClntWnd = mpLayout->GetFrameClient();

            mpLayout->PositionClientWindow();

            // FIXME FIXME:: excessive!

            pClntWnd->Show( false );
            pClntWnd->Show( true  );

            // OLD STUFF:: mpLayout->PositionClientWindow();
        }
        else
        if ( info.mpBar->mpBarWnd )
        {
            wxWindow* pWnd = info.mpBar->mpBarWnd;

            // resize
            info.mpPane->SizeBar( info.mpBar );

            // repaint

            /* OLD STUFF:: bool isChoice = info.mpBar->IsKindOf( CLASSINFO( wxChoice ) );

            //#ifdef __WINDOWS__
            //int result = ::SendMessage( (HWND)pWnd->m_hWnd, WM_NCPAINT, 0, 0 );
            //#endif
            */

            // FIXME FIXME:: there's no other way to repaint non-client area of the wxWindow!!
            //                 so we do *excessive* "hide 'n show"

            pWnd->Show(false);
            pWnd->Show(true);
                
            pWnd->Refresh();
        }

        pNode = pNode->GetNext();
    }

    // release data prepared for GC alg.

    pNode = items.GetFirst();

    while( pNode )
    {
        cbRectInfo* pInfo = (cbRectInfo*)(pNode->GetData());

        delete pInfo;

        pNode = pNode->GetNext();
    }

    mGC.Reset(); // reinit GC

    // FIXME:: this is a dirty-workaround for messy client-area,
    //         as a result of docking bar out of floated-container window

    if ( mpLayout->mClientWndRefreshPending )
    {
        mpLayout->PositionClientWindow();
        mpLayout->GetFrameClient()->Refresh();
    }
}
Esempio n. 3
0
bool cbBarDragPlugin::HitsPane( cbDockPane* pPane, wxRect& rect )
{
    return rect_hits_rect( pPane->mBoundsInParent, rect );
}