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

virtual void Impala::Application::VideoExcel::GridWindow::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 194 of file GridWindow.h.

References OglGui::ScrollBar::ChangePos(), Impala::Application::VideoExcel::TableDataSource::DoUpdateSelectionEvent(), GetRowForXY(), ILOG_DEBUG, OglGui::ScrollBar::LineIncrement(), Impala::Application::VideoExcel::TableDataSource::MarkRange(), Impala::Application::VideoExcel::TableDataSource::MarkRow(), mLastSelectedRow, mMouseXE, mMouseXS, mMouseYE, mMouseYS, mSelecting, mShowZoomView, mSource, mVertScrollBar, and UpdateZoomView().

00195     {
00196         int nLine = ((state&oglShift) ? 5 : 1);
00197         if (msg == oglMouseWheelUp)
00198             mVertScrollBar->ChangePos(-mVertScrollBar->LineIncrement() * nLine);
00199         if (msg == oglMouseWheelDown)
00200             mVertScrollBar->ChangePos(mVertScrollBar->LineIncrement() * nLine);
00201 
00202         int row = -1;
00203         if (mShowZoomView)
00204             UpdateZoomView(row, x,y);
00205         
00206         if (msg == oglMouseDown && but == oglLeftButton)
00207         {
00208             if (row == -1)
00209                 row = GetRowForXY(x, y);
00210             if (row >= 0)
00211             {
00212                 if (state & oglShift && mLastSelectedRow != -1)
00213                 {
00214                     ILOG_DEBUG("shift-select range " << mLastSelectedRow <<
00215                                " to " << row);
00216                     mSource->MarkRange(mLastSelectedRow, row, 1, true);
00217                     mLastSelectedRow = -1;
00218                 }
00219                 else
00220                 {
00221                     mSource->MarkRow(row, 1, true, true);
00222                     mLastSelectedRow = row;
00223                 }
00224             }
00225         }
00226 
00227         if (msg == oglMouseMove && (state & oglLeftButton))
00228         {
00229             mMouseXE = x;
00230             mMouseYE = y;
00231             if (!mSelecting)
00232             {
00233                 mMouseXS = x;
00234                 mMouseYS = y;
00235                 mSelecting = true;
00236             }
00237         }
00238         if (msg == oglMouseUp && but == oglLeftButton)
00239         {
00240             mSelecting = false;
00241             mSource->DoUpdateSelectionEvent();
00242         }
00243     }

Here is the call graph for this function:


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