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 256 of file BarPlot.h. References Impala::Application::MediaTable::TableDataView::GetNumberOfRows(), Impala::Application::MediaTable::TableDataViewController::GetTableDataView(), OglGui::Window::MouseFunc(), Impala::Application::MediaTable::TableDataView::SetNumberOfRows(), Impala::Application::MediaTable::TableDataView::SetStartRow(), and OglGui::OglWindow::UpdateScene(). 00257 { 00258 static bool isDragging = false; 00259 static int lastX; 00260 00261 Window::MouseFunc(msg, btn, state, x, y); 00262 if (msg == oglMouseDown && btn == oglLeftButton) 00263 { 00264 isDragging = true; 00265 lastX = x; 00266 } 00267 00268 if (msg == oglMouseUp) 00269 isDragging = false; 00270 00271 if (state&oglShift) 00272 { 00273 int nrOfRows = GetTableDataView()->GetNumberOfRows() * (1.f+((x - lastX)/50.f)); 00274 if(nrOfRows > 5) 00275 { 00276 GetTableDataView()->SetNumberOfRows(nrOfRows); 00277 UpdateScene(); 00278 } 00279 } 00280 else if (state&oglControl) 00281 { 00282 int dX = (x - lastX)/10.f; 00283 if(dX != 0) 00284 { 00285 GetTableDataView()->SetStartRow(GetTableDataView()->GetStartRow()+dX); 00286 UpdateScene(); 00287 } 00288 } 00289 lastX = x; 00290 }
Here is the call graph for this function:
|