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

virtual void Impala::Application::SDash::TimeSlider::MouseFunc ( int  msg,
int  btn,
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 103 of file TimeSlider.h.

References mCurrentTime, mMargin, mStartTime, mTimeSpan, SetTime(), and OglGui::OglWindow::W().

00104     {
00105         int w = W();
00106         if (msg == oglMouseDown || msg == oglMouseMove)
00107         {
00108             if (x<mMargin)
00109                 x = mMargin;
00110             if (x>w-mMargin)
00111                 x = w-mMargin;
00112             float lW = w-2*mMargin;
00113             float fact = (x-mMargin)/lW;
00114             SetTime(mStartTime + (int) (fact * mTimeSpan+1));
00115         }
00116         if (msg == oglMouseWheelUp)
00117             SetTime(mCurrentTime-1); 
00118         if (msg == oglMouseWheelDown)
00119             SetTime(mCurrentTime+2); 
00120     }

Here is the call graph for this function:


Generated on Thu Jan 13 09:16:14 2011 for ImpalaSrc by  doxygen 1.5.1