Home || Architecture || Video Search || Visual Search || Scripts || Applications || Important Messages || OGL || Src

virtual void OglGui::Graph::WndMouseFunc ( int  msg,
int  btn,
int  state,
int  x,
int  y 
) [inline, virtual]

Definition at line 390 of file Graph.h.

References OglGui::SizableWindow::ClampMinMax(), DoScaling(), OglGui::OglWindow::GetDimensions(), OglGui::OglWindow::GetOGLWND(), OglGui::Window::GetParent(), OglGui::OglWindow::H(), mLastX, OglGui::SizableWindow::mMaxH, OglGui::SizableWindow::mMaxW, OglGui::SizableWindow::mMinH, OglGui::SizableWindow::mMinW, mNormX, mNormY, OglGui::OglWindow::mOglWnd, OglGui::SizableWindow::MouseFunc(), mStartTopX, mStartTopY, mZoomable, mZooming, OglGui::OglWindow::SetDimensions(), StartScalers(), and OglGui::OglWindow::W().

Referenced by MouseFunc().

00391     {
00392         bool zoomState = (state==(oglLeftButton|oglControl|oglShift));
00393         if (!zoomState)
00394             mZooming = false;
00395         if (!mZooming && !zoomState)
00396             SizableWindow::MouseFunc(msg, btn, state, x, y);
00397         if (msg == oglMouseDown && btn == oglLeftButton && zoomState)
00398         {
00399             mZooming    = mZoomable ? true : false;
00400             mStartTopX  = x;
00401             mStartTopY  = y;
00402             oglSys.VPToTopWndI(mOglWnd, &mStartTopX, &mStartTopY);
00403             mLastX = mStartTopX;
00404             mNormX = x / (float) W();
00405             mNormY = y / (float) H();
00406             if (mZooming)
00407                 StartScalers();
00408         }
00409         if (msg == oglMouseMove && mZooming)
00410         {
00411             int topX = x, topY = y;
00412             oglSys.VPToTopWndI(mOglWnd,&topX, &topY);
00413             int difX = mLastX-topX;
00414             int nX, nY, nW, nH;
00415             GetDimensions(nX,nY,nW,nH);
00416             int nnW = (1.0-(difX/100.0)) * nW;
00417             if (nnW==nW && difX) // If rounding stops size difference
00418                 nnW -= difX;
00419             if (nnW >= mMinW && nnW <= mMaxW)
00420                 nW = nnW;
00421             int nnH = (1.0-(difX/100.0)) * nH;
00422             if (nnH==nH && difX) // If rounding stops size difference
00423                 nnH -= difX;
00424             if (nnH >= mMinH && nnH <= mMaxH)
00425                 nH = nnH;
00426             nX = mStartTopX - mNormX * nW;
00427             nY = mStartTopY - mNormY * nH;
00428             oglSys.TopWndToVPI(GetParent()->GetOGLWND(), &nX, &nY);
00429             ClampMinMax(nX, nY, nW, nH);
00430             SetDimensions(nX, nY, nW, nH);
00431             DoScaling();
00432             mLastX = topX;
00433         }
00434     }

Here is the call graph for this function:


Generated on Fri Mar 19 12:01:42 2010 for ImpalaSrc by  doxygen 1.5.1