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 225 of file StringSelector.h. References ActivateListener(), OglGui::ScrollBar::ChangePos(), cLineHeight, OglGui::Window::GetState(), mCurrent, mFirstVis, OglGui::OglWindow::mOglWnd, OglGui::Window::MouseFunc(), mScrollBar, and mStrings. 00226 { 00227 if (!GetState()) 00228 return; 00229 00230 Window::MouseFunc(msg, but, state, x, y); 00231 00232 if (msg == oglMouseWheelUp) 00233 mScrollBar->ChangePos(-1); 00234 if (msg == oglMouseWheelDown) 00235 mScrollBar->ChangePos(1); 00236 00237 if ((msg==oglMouseDown) && (but==oglLeftButton)) 00238 { 00239 int idx, clipY = (y < 0) ? 0 : y; 00240 if (clipY >= mOglWnd->height) 00241 clipY = mOglWnd->height; 00242 clipY = mOglWnd->height - clipY; // mirror for string order 00243 if ((idx = clipY / cLineHeight + mFirstVis) < mStrings.size()) 00244 { 00245 mCurrent = idx; 00246 ActivateListener(); 00247 } 00248 } 00249 }
Here is the call graph for this function:
|