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

virtual void OglGui::Menu::MouseFunc ( int  msg,
int  btn,
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 152 of file Menu.h.

References ActivateListener(), CloseSubMenu(), OglGui::OglWindow::H(), OglGui::MenuTopPane::Hide(), IsEnabled(), IsSubMenu(), mCurItem, mCurSubMenu, mItemHeight, mMenuTopPane, mSubMenus, Open(), OglGui::OglWindow::W(), OglGui::OglWindow::X(), and OglGui::OglWindow::Y().

00153     {
00154         if (msg==oglMouseMove)
00155         {
00156             mCurItem = -1;
00157             if (x>0 && x<W() && y>0 && y<H())
00158                 mCurItem = (H()-y)/mItemHeight;
00159         }
00160 
00161         if (msg==oglMouseDown && IsEnabled(mCurItem) && !IsSubMenu(mCurItem))
00162         {
00163             mMenuTopPane->Hide();
00164             ActivateListener();
00165         }
00166 
00167         if (msg==oglMouseLeave && !mCurSubMenu)
00168             mCurItem=-1;
00169 
00170         CloseSubMenu();
00171 
00172         if (IsEnabled(mCurItem) && IsSubMenu(mCurItem))
00173         {
00174             mCurSubMenu = mSubMenus[mCurItem];
00175             int iY = H()-mCurItem*mItemHeight;
00176             mCurSubMenu->Open(X()+W(),Y()+iY,W());
00177         }
00178     }

Here is the call graph for this function:


Generated on Fri Mar 19 12:02:47 2010 for ImpalaSrc by  doxygen 1.5.1