GuiScrollCtrl enhancement - horizontal scroll
by Fyodor -bank- Osokin · 02/19/2008 (6:32 am) · 0 comments
What this resource gives you?
open:
guiScrollCtrl.cc (.cpp)
locate:
bool GuiScrollCtrl::onMouseWheelUp(const GuiEvent &event)
change:
locate:
bool GuiScrollCtrl::onMouseWheelDown(const GuiEvent &event)
change:
Save. Rebuild. Enjoy!
Quote:Changes:
1. If you press-n-hold SHIFT, than the GuiScrollCtrl will do horizontal scrolling instead of vertical (if horizontal scroll is enabled of course, else - no changes in behaviour)
2. If there is nothing to scroll vertically, it will try to scroll "horizontally" automatically
open:
guiScrollCtrl.cc (.cpp)
locate:
bool GuiScrollCtrl::onMouseWheelUp(const GuiEvent &event)
change:
scrollByRegion((event.modifier & SI_CTRL) ? UpPage : UpArrow);to this:
scrollByRegion(
( (event.modifier & SI_SHIFT && mHBarEnabled) || !mVBarEnabled ) ?
( (event.modifier & SI_CTRL) ? LeftPage : LeftArrow ) :
( (event.modifier & SI_CTRL) ? UpPage : UpArrow )
);locate:
bool GuiScrollCtrl::onMouseWheelDown(const GuiEvent &event)
change:
scrollByRegion((event.modifier & SI_CTRL) ? DownPage : DownArrow);to this:
scrollByRegion(
( (event.modifier & SI_SHIFT && mHBarEnabled) || !mVBarEnabled ) ?
( (event.modifier & SI_CTRL) ? RightPage : RightArrow ) :
( (event.modifier & SI_CTRL) ? DownPage : DownArrow )
);Save. Rebuild. Enjoy!
About the author
Game developer.
