Small but handy GuiScrollCtrl enhancement
by Fyodor -bank- Osokin · in Torque Game Engine · 01/26/2008 (4:38 pm) · 3 replies
what:
1. If you press SHIFT, then the scroll will do horizontal scrolling instead of vertical
2. If there is nothing to scroll vertically, it will try to scroll horizontal automatically
Changes:
open:
guiScrollCtrl.cc
locate:
bool GuiScrollCtrl::onMouseWheelUp(const GuiEvent &event)
change:
locate:
bool GuiScrollCtrl::onMouseWheelDown(const GuiEvent &event)
change:
Save. Rebuild. Enjoy!
1. If you press SHIFT, then the scroll will do horizontal scrolling instead of vertical
2. If there is nothing to scroll vertically, it will try to scroll horizontal automatically
Changes:
open:
guiScrollCtrl.cc
locate:
bool GuiScrollCtrl::onMouseWheelUp(const GuiEvent &event)
change:
scrollByRegion((event.modifier & SI_CTRL) ? UpPage : UpArrow);to this:
scrollByRegion(
(event.modifier & SI_SHIFT || !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 || !mVBarEnabled) ?
( (event.modifier & SI_CTRL) ? RightPage : RightArrow) :
( (event.modifier & SI_CTRL) ? DownPage : DownArrow)
);Save. Rebuild. Enjoy!
About the author
Game developer.
Torque 3D Owner Novack
CyberianSoftware