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. Reimplemented in OglGui::Graph, and OglGui::TitledWindow. Definition at line 104 of file SizableWindow.h. References BringToFront(), GetAction(), IsTopWindowInParent(), mAction, mActOnModifier, mDx, mDy, mHighLight, OglGui::OglWindow::mOglWnd, OglGui::Window::MouseFunc(), mToFrontOnMouseDown, PerformAction(), and SetActionCursor(). Referenced by OglGui::TitledWindow::MouseFunc(), and OglGui::Graph::WndMouseFunc(). 00105 { 00106 int theAction = 0; 00107 if (!mActOnModifier || !(state&mActOnModifier)) 00108 Window::MouseFunc(msg, but, state, x, y); 00109 if (mActOnModifier && (mOglWnd->dragging || !(state&mActOnModifier))) 00110 { 00111 mHighLight = false; 00112 SetActionCursor(mAction = 0); 00113 return; 00114 } 00115 if (msg==oglMouseDown && !(state&oglControl) && 00116 (mToFrontOnMouseDown && !IsTopWindowInParent())) 00117 BringToFront(); 00118 00119 if (mAction && msg == oglMouseUp) 00120 mAction = 0; 00121 00122 if (msg == oglMouseLeave) 00123 { 00124 mHighLight = false; 00125 oglSys.SetCursor(oglCursorArrow); 00126 } 00127 00128 if (msg == oglMouseDown && but == oglLeftButton) 00129 { 00130 mDx = x; 00131 mDy = y; 00132 if (theAction = GetAction(x, y)) 00133 mAction |= theAction; 00134 } 00135 00136 if (mAction) 00137 mHighLight = true; 00138 00139 if (msg == oglMouseMove) 00140 mHighLight = (mAction != 0) || (theAction = GetAction(x, y)); 00141 00142 if (mAction && msg == oglMouseMove ) 00143 PerformAction(x, y); 00144 00145 SetActionCursor(theAction | mAction); 00146 }
Here is the call graph for this function:
|