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

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

References OglGui::ScrollBar::ChangePos(), Impala::Application::VideoExcel::TableDataSource::DoUpdateSelectionEvent(), GetRowForY(), ILOG_DEBUG, OglGui::ScrollBar::LineIncrement(), Impala::Application::VideoExcel::TableDataSource::MarkRange(), Impala::Application::VideoExcel::TableDataSource::MarkRow(), mAutoZoom, mContext, mLastSelectedRow, mMouseX, mMouseXE, mMouseXS, mMouseY, mMouseYE, mMouseYS, mSelecting, mShowZoomView, mSource, mVertScrollBar, mZoomView, OglGui::Menu::Open(), OglGui::OglWindow::ToTopWindow(), UnZoomRows(), and ZoomRow().

00192     {
00193         mMouseX = x; mMouseY = y;
00194 
00195         int nLine = ((state&oglShift) ? 5 : 1);
00196         if (msg == oglMouseWheelUp)
00197             mVertScrollBar->ChangePos(-mVertScrollBar->LineIncrement() * nLine);
00198         if (msg == oglMouseWheelDown)
00199             mVertScrollBar->ChangePos(mVertScrollBar->LineIncrement() * nLine);
00200 
00201         if (!mAutoZoom)
00202             UnZoomRows();
00203         else if (!mSelecting)
00204             ZoomRow(GetRowForY(y));
00205 
00206         if (msg == oglMouseEnter && mShowZoomView && mZoomView)
00207             viewSys.SetTags(mZoomView, visibleTag);
00208         if (msg == oglMouseLeave && mShowZoomView && mZoomView)
00209             viewSys.ClearTags(mZoomView, visibleTag);
00210 
00211         if (msg == oglMouseDown && but == oglLeftButton)
00212         {
00213             int row = GetRowForY(y);
00214             if (row >= 0)
00215             {
00216                 if (state & oglShift && mLastSelectedRow != -1)
00217                 {
00218                     ILOG_DEBUG("shift-select range " << mLastSelectedRow <<
00219                                " to " << row);
00220                     mSource->MarkRange(mLastSelectedRow, row, 1, true);
00221                     mLastSelectedRow = -1;
00222                 }
00223                 else
00224                 {
00225                     mSource->MarkRow(row, 1, true, true);
00226                     mLastSelectedRow = row;
00227                 }
00228             }
00229         }
00230         if (msg == oglMouseMove && (state & oglLeftButton))
00231         {
00232             mMouseXE = x;
00233             mMouseYE = y;
00234             if (!mSelecting)
00235             {
00236                 mMouseXS = x;
00237                 mMouseYS = y;
00238                 mSelecting = true;
00239             }
00240         }
00241         if (msg == oglMouseUp && but == oglLeftButton)
00242         {
00243             mSelecting = false;
00244             mSource->DoUpdateSelectionEvent();
00245         }
00246 
00247         if (msg == oglMouseDown && but == oglRightButton)
00248         {
00249             int rx=0, ry=0;
00250             ToTopWindow(this, rx, ry);
00251             mContext->Open(rx+x,ry+y);
00252         }
00253 
00254     }

Here is the call graph for this function:


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