Bool ColorBox::InputEvent(const BaseContainer &msg) { if(msg.GetInt32(BFM_INPUT_DEVICE) == BFM_INPUT_MOUSE){ if(msg.GetInt32(BFM_INPUT_CHANNEL) == BFM_INPUT_MOUSELEFT){ m_mouseX = msg.GetInt32(BFM_INPUT_X); m_mouseY = msg.GetInt32(BFM_INPUT_Y); m_mouseDown = TRUE; Global2Local(&m_mouseX, &m_mouseY); MouseDragStart(BFM_INPUT_MOUSELEFT,m_mouseX, m_mouseY,MOUSEDRAGFLAGS_0); MouseUpdate(); } } Float x, y; BaseContainer channels; while (MouseDrag(&x, &y, &channels) == MOUSEDRAGRESULT_CONTINUE) { m_mouseX -= x; m_mouseY -= y; //Global2Local(&m_mouseX, &m_mouseY); MouseUpdate(); } BaseContainer res; if(GetInputState(BFM_INPUT_MOUSE,BFM_INPUT_MOUSELEFT,res) && res.GetInt32(BFM_INPUT_VALUE) == 0){ if(m_mouseDown){ MouseDragEnd(); m_mouseDown = FALSE; } } return FALSE; }
void CglList::MouseMove(int x, int y, int dx,int dy, int button) { if (button != SDL_BUTTON_LEFT || !activeMousePress) return; MouseUpdate(x, y); }
void CInput::OnFrame (void) { Device.Statistic->Input.Begin (); dwCurTime = Device.TimerAsync_MMT (); if (pKeyboard) KeyUpdate (); if (pMouse) MouseUpdate (); Device.Statistic->Input.End (); }
bool CglList::MousePress(int x, int y, int button) { if (button != SDL_BUTTON_LEFT || !IsAbove(x, y)) return false; activeMousePress = true; MouseUpdate(x, y); // make sure place is up to date return true; }
void CglList::MouseRelease(int x, int y, int button) { if (button != SDL_BUTTON_LEFT || !activeMousePress) return; activeMousePress = false; if (!MouseUpdate(x, y) && cancelPlace >= 0) { // make sure place is up to date place = cancelPlace; } Select(); // watch out, the callback may delete this }
//------------------------------------------------------- void CInput::iCapture(IInputReceiver *p) { VERIFY(p); if (pMouse) MouseUpdate(); if (pKeyboard) KeyUpdate(); // change focus if (!cbStack.empty()) cbStack.back()->IR_OnDeactivate(); cbStack.push_back(p); cbStack.back()->IR_OnActivate(); // prepare for _new_ controller ZeroMemory ( timeStamp, sizeof(timeStamp) ); ZeroMemory ( timeSave, sizeof(timeStamp) ); ZeroMemory ( offs, sizeof(offs) ); }
bool List::MousePress(int x, int y, int button) { switch (button) { case SDL_BUTTON_LEFT: { activeMousePress = true; MouseUpdate(x, y); // make sure place is up to date break; } case SDL_BUTTON_WHEELDOWN: ScrollDownOne(); break; case SDL_BUTTON_WHEELUP: ScrollUpOne(); break; } return false; }
CLIPPER MUpdate() { SysRefresh(); MouseUpdate(); }