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

virtual void OglGui::IntervalChooser::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 100 of file IntervalChooser.h.

References OglGui::Window::GetState(), mDragDiffX, mDragging, mEndThumb, mMinSizePix, mOldMinSizePix, OglGui::Window::MouseFunc(), mStartThumb, NeedleX(), and SetNeedleX().

00101     {
00102         if (!GetState()) return;
00103 
00104         Window::MouseFunc(msg, but, state, x, y);
00105 
00106         if (mDragging && !(state & oglLeftButton))
00107         {
00108             mDragging = false;
00109             mMinSizePix = mOldMinSizePix;
00110         }
00111         if (msg==oglMouseDown && state==oglLeftButton)
00112         {
00113             mDragging = true;
00114             int sX = NeedleX(mStartThumb);
00115             int eX = NeedleX(mEndThumb);
00116             mDragDiffX = x - sX; 
00117             mOldMinSizePix = mMinSizePix;
00118             mMinSizePix = eX - sX;
00119         }
00120         if (msg == oglMouseMove && state==oglLeftButton)
00121         {
00122             int nX = SetNeedleX(mStartThumb, x - mDragDiffX);
00123             SetNeedleX(mEndThumb,nX + mMinSizePix);
00124         }
00125     }

Here is the call graph for this function:


Generated on Fri Mar 19 12:02:09 2010 for ImpalaSrc by  doxygen 1.5.1