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

virtual void Impala::Visualization::VideoNav::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 127 of file VideoNav.h.

References Impala::Core::Stream::RgbDataSrc::FrameNr(), Impala::Core::Stream::RgbDataSrc::LastFrame(), mAllowJump, mListenerData, OglGui::OglWindow::mOglWnd, OglGui::Window::MouseFunc(), mScrollDrag, mSrc, mVideoNavListener, and Impala::Visualization::VideoNavListener::NavFrameEvent().

00128     {
00129         Window::MouseFunc(msg, but, state, x, y);
00130 
00131         if (msg == oglMouseUp)
00132             mScrollDrag = false;
00133 
00134         if (((msg==oglMouseDown && but==oglLeftButton) || 
00135             (msg==oglMouseMove && state&oglLeftButton)) && y < 25)
00136         {
00137             if ((msg==oglMouseDown) && (but==oglLeftButton))
00138                 mScrollDrag = true;
00139             if (x < 0)
00140                 x = 0;
00141             int width = mOglWnd->width-1;
00142             if (x >= width)
00143                 x = width;
00144             int reqFr = ((double) x / width) * mSrc->LastFrame();
00145             if (reqFr >= mSrc->LastFrame() - 1)
00146                 reqFr = mSrc->LastFrame() - 1;
00147             if ((reqFr != mSrc->FrameNr()) && mVideoNavListener &&
00148                 mScrollDrag && mAllowJump)
00149             {
00150                 mVideoNavListener->NavFrameEvent(this, reqFr, mListenerData);
00151             }
00152         }
00153     }

Here is the call graph for this function:


Generated on Fri Mar 19 11:50:06 2010 for ImpalaSrc by  doxygen 1.5.1