[Bug] GuiSliderCtrl some mouse actions don't trigger command (with fix)
by George Anderson · in Torque 3D Professional · 03/06/2010 (3:37 pm) · 2 replies
When sliding the "thumb", if you leave the control, then mouse up, it moves the thumb but doesn't trigger the command. Same for scrolling with the middle mouse.
I believe the fix is a simple change. Right now your onleave event marks mDepressed to false and your mouseup event has an if statment where if mDepressed ==false execConsoleCallback(); doesn't get called.
Here is the location of the file:
Torque 3D 2009 Pro 1.1 AlphaEnginesourceguicontrolsguiSliderCtrl.cpp
Here is the change I made. (doesn't address the scroll problem only the mouse capture)
I believe the fix is a simple change. Right now your onleave event marks mDepressed to false and your mouseup event has an if statment where if mDepressed ==false execConsoleCallback(); doesn't get called.
Here is the location of the file:
Torque 3D 2009 Pro 1.1 AlphaEnginesourceguicontrolsguiSliderCtrl.cpp
Here is the change I made. (doesn't address the scroll problem only the mouse capture)
void GuiSliderCtrl::onMouseUp(const GuiEvent &)
{
if ( !mActive || !mAwake || !mVisible )
return;
if( mDepressed )
{
mDepressed = false;
}
execConsoleCallback();//gmod moved this out of the above if statment, helps with capture event on slider.
mouseUnlock();
}Then I added execConsoleCallback(); to both mousewheelup and mousewheeldownbool GuiSliderCtrl::onMouseWheelUp(const GuiEvent &event)
{
if ( !mActive || !mAwake || !mVisible )
return Parent::onMouseWheelUp(event);
mValue += mIncAmount;
updateThumb( mValue, ( event.modifier & SI_SHIFT ) );
execConsoleCallback();//gmod modified
return true;
}
bool GuiSliderCtrl::onMouseWheelDown(const GuiEvent &event)
{
if ( !mActive || !mAwake || !mVisible )
return Parent::onMouseWheelUp(event);
mValue -= mIncAmount;
updateThumb( mValue, ( event.modifier & SI_SHIFT ) );
execConsoleCallback();//gmod modified
return true;
}
Associate Rene Damm
Merged for b2.
Thanks!