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

virtual void Impala::Visualization::Window::MouseFunc ( int  msg,
int  but,
int  state,
int  x,
int  y 
) [inline, virtual]

This function is called by the event handling system everytime the user has moved or clicked the mouse.

So if you want a window which reacts to the mouse in a specific way, you can inherit a class from Window. Another method to implement mouse behaviour is to use a window listener (in this case you have to inherit a class from WindowListener and attach it to this window, see WindowListener for more details)

Reimplemented from OglGui::Window.

Definition at line 403 of file Window.h.

References mInfoBox, mInfoBoxDraw, and OglGui::Window::MouseFunc().

00404     {
00405         if (mInfoBox) 
00406         {
00407             mInfoBox->x = x + 20;
00408             mInfoBox->y = y - 25;
00409             mInfoBoxDraw = false;
00410         }
00411        
00412         //if (msg == oglMouseUp)
00413         //    mPointerDrag = false;
00414 
00415         if (((msg==oglMouseDown && (but==oglLeftButton)) ||
00416              (state & oglLeftButton) && msg==oglMouseMove))
00417         {
00418             // RvB: Deze (FindView)is in 3D erg duur, vooral omdat view3DSys ook
00419             // nog eens op zoek gaat. Mischien moet in OGL C de OnViewer functies met
00420             // een OnMouse worden uitgebreid. Nadeel wel dat in 3D alleen goed
00421             // de mouse positie in image coordinaten om te zetten is wanneer de
00422             // viewer flat is en niet geroteerd is.
00423             /* todo : save InfoBox part
00424             mPointerView = FindView(x, y);
00425             if (mPointerView)
00426             {
00427                 Array2dVec3UInt8* disp;
00428                 mPointerView->WndToIm(x, y, mPointerX, mPointerY);
00429                 if( mInfoBoxActive && (disp = mPointerView->GetDispImage()) )
00430                 {
00431                     UInt8* ptr = disp->CPB(mPointerX, mPointerY);
00432                     std::ostrstream infoStream;
00433                     infoStream << mPointerX << "," << mPointerY << " = " 
00434                                << "(" << ptr[0] << "," << ptr[1] << ","
00435                                << ptr[2] << ")" << std::ends;
00436                     SetInfoBoxString(infoStream.str());
00437                     infoStream.freeze(false);
00438                     mInfoBoxDraw = true;
00439                 }
00440                 if ((msg == oglMouseDown) && (but == oglLeftButton))
00441                 {
00442                     mPointerDrag = true;
00443                     mPointerDragX = mPointerX;
00444                     mPointerDragY = mPointerY;
00445                 }
00446             }
00447             */
00448             //if (mListener)
00449             //    mListener->PointerEvent(this, mListenerData);
00450         }
00451         OglGui::Window::MouseFunc( msg, but, state, x, y );
00452     }

Here is the call graph for this function:


Generated on Fri Mar 19 11:51:38 2010 for ImpalaSrc by  doxygen 1.5.1