void VEditorScrollControl::onRightMouseUp( const GuiEvent &pEvent ) { Parent::onMouseUp( pEvent ); // Event. onMouseEvent( "onRightMouseUp", pEvent ); }
/********************************************* SDL event loop **********************************************/ void Application::processEvents(){ SDL_Event event; while ( SDL_PollEvent( &event ) ){ switch( event.type ){ case SDL_VIDEORESIZE: mSurface.onResize(event.resize.w, event.resize.h); break; case SDL_QUIT: //handle quit requests requestShutdown(); break; case SDL_MOUSEBUTTONDOWN: onMouseEvent(event.button.button, event.type); break; case SDL_MOUSEBUTTONUP: onMouseEvent(event.button.button, event.type); break; case SDL_KEYDOWN: onKeyEvent(event.key.keysym.sym, event.type); break; case SDL_KEYUP: onKeyEvent(event.key.keysym.sym, event.type); break; default: break; } } /* if (!done){ //Do one frames worth of work and figure out the length of time uint32_t startTime = SDL_GetTicks(); renderMain(); updateMain(); uint32_t endTime = SDL_GetTicks(); //Figure out the scaling factor for FPS-independent movement uint32_t diff = endTime - startTime; fTimeScale = (float)diff * fTimeScaleScale; //Every hour, do a cleanup if(fCleanupTimer < 0.0f){ ps()->doPeriodicCleanup(); fCleanupTimer = CLEANUP_TIMER; } //Update our various timers fCleanupTimer -= fTimeScale; fUptime += fTimeScale; fParticleFPS = fTimeScale; } */ }
LRESULT WebView::wndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) { LRESULT lResult = 0; bool handled = true; switch (message) { case WM_DESTROY: m_isBeingDestroyed = true; close(); break; case WM_ERASEBKGND: lResult = 1; break; case WM_PAINT: lResult = onPaintEvent(hWnd, message, wParam, lParam, handled); break; case WM_PRINTCLIENT: lResult = onPrintClientEvent(hWnd, message, wParam, lParam, handled); break; case WM_MOUSEMOVE: case WM_LBUTTONDOWN: case WM_MBUTTONDOWN: case WM_RBUTTONDOWN: case WM_LBUTTONDBLCLK: case WM_MBUTTONDBLCLK: case WM_RBUTTONDBLCLK: case WM_LBUTTONUP: case WM_MBUTTONUP: case WM_RBUTTONUP: case WM_MOUSELEAVE: lResult = onMouseEvent(hWnd, message, wParam, lParam, handled); break; case WM_MOUSEWHEEL: case WM_VISTA_MOUSEHWHEEL: lResult = onWheelEvent(hWnd, message, wParam, lParam, handled); break; case WM_SYSKEYDOWN: case WM_KEYDOWN: case WM_SYSCHAR: case WM_CHAR: case WM_SYSKEYUP: case WM_KEYUP: lResult = onKeyEvent(hWnd, message, wParam, lParam, handled); break; case WM_SIZE: lResult = onSizeEvent(hWnd, message, wParam, lParam, handled); break; case WM_WINDOWPOSCHANGED: lResult = onWindowPositionChangedEvent(hWnd, message, wParam, lParam, handled); break; case WM_SETFOCUS: lResult = onSetFocusEvent(hWnd, message, wParam, lParam, handled); break; case WM_KILLFOCUS: lResult = onKillFocusEvent(hWnd, message, wParam, lParam, handled); break; case WM_TIMER: lResult = onTimerEvent(hWnd, message, wParam, lParam, handled); break; case WM_SHOWWINDOW: lResult = onShowWindowEvent(hWnd, message, wParam, lParam, handled); break; case WM_SETCURSOR: lResult = onSetCursor(hWnd, message, wParam, lParam, handled); break; default: handled = false; break; } if (!handled) lResult = ::DefWindowProc(hWnd, message, wParam, lParam); return lResult; }
/********************************************* SDL event loop **********************************************/ void App::utilEventLoop(){ SDL_Event event; while ( !done ){ while ( SDL_PollEvent( &event ) ){ //Hand the event off to the GUI first. If the GUI handles it, it's //done. #ifdef ENABLE_GUI if(processGUIEvent(event)){ continue; } #endif switch( event.type ){ case SDL_VIDEORESIZE: //handle resize event surface = SDL_SetVideoMode( event.resize.w, event.resize.h, 16, videoFlags ); if ( !surface ){ ERR( "Could not get a surface after resize: %s\n", SDL_GetError( ) ); notifyShutdown(); } resizeWindow( event.resize.w, event.resize.h ); #ifdef ENABLE_GUI resizeGUI( event.resize.w, event.resize.h ); #endif break; case SDL_QUIT: //handle quit requests notifyShutdown(); break; case SDL_MOUSEBUTTONDOWN: if(mFlowMgr->onClick(event.button.button, fMouseX, fMouseY, fMouseZ)){ break; } onMouseEvent(event.button.button, SDL_MOUSEBUTTONDOWN); beginDrag(); break; case SDL_MOUSEBUTTONUP: onMouseEvent(event.button.button, SDL_MOUSEBUTTONUP); endDrag(); break; case SDL_KEYDOWN: handleKeyEvent(&event.key.keysym, event.type); break; case SDL_KEYUP: handleKeyEvent(&event.key.keysym, event.type); break; default: break; } } if (!done){ //Do one frames worth of work and figure out the length of time uint32_t startTime = SDL_GetTicks(); renderMain(); updateMain(); uint32_t endTime = SDL_GetTicks(); //Figure out the scaling factor for FPS-independent movement uint32_t diff = endTime - startTime; if (iMaxFrameRate > 0 && diff < 1000 / iMaxFrameRate) { SDL_Delay((1000 / iMaxFrameRate) - diff); diff = 1000 / iMaxFrameRate; } fTimeScale = (float)diff * fTimeScaleScale; //Every hour, do a cleanup if(fCleanupTimer < 0.0f){ ps()->doPeriodicCleanup(); fCleanupTimer = CLEANUP_TIMER; } //Update our various timers fCleanupTimer -= fTimeScale; fUptime += fTimeScale; fParticleFPS = fTimeScale; } } }