松鼠的博客

导航

分隔条代码

void CSplitter::OnMouseMove(UINT nFlags, CPoint point) 
{
    
if(this->IsDraging)
    
{
        CWnd 
*parent = this->GetParent();
        CRect lRect;
        CRect rRect;
        CRect rect;
        CRect pRect;

        parent
->GetWindowRect(&pRect);
        
this->GetWindowRect(&rect);
        
if ()
        
{
            
this->LeftWnd->GetWindowRect(&lRect);
            
this->RightWnd->GetWindowRect(&rRect);
            

            parent
->ScreenToClient(&lRect);
            parent
->ScreenToClient(&rRect);
            parent
->ScreenToClient(&rect);

            lRect.left 
+= point.x - this->StartX;
            rRect.left 
+= point.x - this->StartX;

            
this->LeftWnd->MoveWindow(&lRect);
            
this->RightWnd->MoveWindow(&rRect);
            SetWindowPos(
0,rect.left + (point.x - this->StartX),rect.top,0,0,SWP_NOSIZE|SWP_NOZORDER);
        }

    }

    
else
    
{
        CWnd::OnMouseMove(nFlags, point);
    }

}

posted on 2008-12-08 18:06  Xproer-松鼠  阅读(232)  评论(0)    收藏  举报