Reimplemented from OglGui::Button. Definition at line 478 of file ScrollBar.h. References OglGui::ScrollBar::cSbW, OglGui::Window::GetState(), max, mClickX, mClickY, mDragging, OglGui::ScrollBar::mHorizontal, OglGui::OglWindow::mOglWnd, OglGui::Button::MouseFunc(), mParent, OglGui::ScrollBar::mPixelRange, and OglGui::ScrollBar::OnScrollThumb(). 00479 { 00480 if (!GetState() || (state & (oglShift|oglControl))) 00481 return; 00482 00483 Button::MouseFunc(msg, but, state, x, y); 00484 if (msg == oglMouseDown && but == oglLeftButton) 00485 { 00486 mDragging = true; 00487 mClickX = x; 00488 mClickY = y; 00489 } 00490 00491 if (msg == oglMouseUp && but == oglLeftButton) 00492 mDragging = false; 00493 if (msg == oglMouseMove) 00494 { 00495 if (mDragging) 00496 { 00497 if (mParent->mHorizontal) 00498 { 00499 mOglWnd->x += x - mClickX; 00500 // check restraints 00501 if (mOglWnd->x < cSbW) 00502 mOglWnd->x = cSbW; 00503 int max = mParent->mPixelRange + cSbW - mOglWnd->width; 00504 if (mOglWnd->x > max) 00505 mOglWnd->x = max; 00506 // feedback to parent 00507 mParent->OnScrollThumb(mOglWnd->x - cSbW); 00508 } 00509 else 00510 { 00511 mOglWnd->y += y - mClickY; 00512 // check restraints 00513 if (mOglWnd->y < cSbW) 00514 mOglWnd->y = cSbW; 00515 int max = mParent->mPixelRange + cSbW - mOglWnd->height; 00516 if (mOglWnd->y > max) 00517 mOglWnd->y = max; 00518 // feedback to parent 00519 mParent->OnScrollThumb(mParent->mPixelRange + cSbW - 00520 mOglWnd->height - mOglWnd->y); 00521 } 00522 } 00523 } 00524 }
Here is the call graph for this function:
|