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

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

References OglGui::ScrollBar::ChangePos(), Impala::Application::MediaTable::TableDataView::DoUpdateSelectionEvent(), GetRowForXY(), Impala::Application::MediaTable::TableDataViewController::GetTableDataView(), ILOG_USER, OglGui::ScrollBar::LineIncrement(), Impala::Application::MediaTable::TableDataView::MarkRange(), Impala::Application::MediaTable::TableDataView::MarkRow(), mLastSelectedRow, mMouseXE, mMouseXS, mMouseYE, mMouseYS, mSelecting, mShowZoomView, mVertScrollBar, mZoomView, Impala::Application::MediaTable::TableDataViewController::OpenContextMenu(), OglGui::OglWindow::ToTopWindow(), and UpdateZoomView().

00200     {
00201         int nLine = ((state&oglShift) ? 5 : 1);
00202         if (msg == oglMouseWheelUp)
00203         {
00204             mVertScrollBar->ChangePos(-mVertScrollBar->LineIncrement() * nLine);
00205             ILOG_USER("GridWindow mouse wheel up");
00206         }
00207         if (msg == oglMouseWheelDown)
00208         {
00209             mVertScrollBar->ChangePos(mVertScrollBar->LineIncrement() * nLine);
00210             ILOG_USER("GridWindow mouse wheel down");
00211         }
00212 
00213         int row = -1;
00214         if (mShowZoomView)
00215             UpdateZoomView(row, x,y);
00216 
00217         if (msg == oglMouseEnter && mShowZoomView && mZoomView)
00218             viewSys.SetTags(mZoomView, visibleTag);
00219         if (msg == oglMouseLeave && mShowZoomView && mZoomView)
00220             viewSys.ClearTags(mZoomView, visibleTag);
00221 
00222         if (msg == oglMouseDown && but == oglLeftButton)
00223         {
00224             if (row == -1)
00225                 row = GetRowForXY(x, y);
00226             if (row >= 0)
00227             {
00228                 if (state & oglShift && mLastSelectedRow != -1)
00229                 {
00230                     ILOG_USER("GridWindow mouse shift-select range " << mLastSelectedRow <<
00231                                " to " << row);
00232                     GetTableDataView()->MarkRange(mLastSelectedRow, row, 1, true);
00233                     mLastSelectedRow = -1;
00234                 }
00235                 else
00236                 {
00237                     ILOG_USER("GridWindow mouse click mark row " << row);
00238                     GetTableDataView()->MarkRow(row, 1, true, true);
00239                     mLastSelectedRow = row;
00240                 }
00241             }
00242         }
00243 
00244         if (msg == oglMouseMove && (state & oglLeftButton))
00245         {
00246             mMouseXE = x;
00247             mMouseYE = y;
00248             if (!mSelecting)
00249             {
00250                 mMouseXS = x;
00251                 mMouseYS = y;
00252                 mSelecting = true;
00253             }
00254         }
00255         if (msg == oglMouseUp && but == oglLeftButton)
00256         {
00257                         if (mSelecting)
00258                                 ILOG_USER("grid mouse drag select completed");
00259             mSelecting = false;
00260             GetTableDataView()->DoUpdateSelectionEvent();
00261             ILOG_USER("GridWindow drag select finished");
00262         }
00263         if (msg == oglMouseDown && but == oglRightButton)
00264         {
00265                         ILOG_USER("mouse open right context menu");
00266             int rx=0, ry=0;
00267             ToTopWindow(this, rx, ry);
00268             OpenContextMenu(rx+x,ry+y);
00269         }
00270     }

Here is the call graph for this function:


Generated on Fri Mar 19 10:42:44 2010 for ImpalaSrc by  doxygen 1.5.1