Small bug in juce_SliderHandler.h


#1

generated code is “*Horiz” instead of “*Horizontal” and “*Vert” instead of “*Vertical”

        case Slider::TwoValueHorizontal:
            return T("TwoValueHoriz");
        case Slider::TwoValueVertical:
            return T("TwoValueVert");
        case Slider::ThreeValueHorizontal:
            return T("ThreeValueHoriz");
        case Slider::ThreeValueVertical:
            return T("ThreeValueVert");

#2

Ah yes, my apologies to people with sliders that point the wrong way. Here’s an easy-to-paste fix for it:

[code] //==============================================================================
static const String sliderStyleToString (Slider::SliderStyle style)
{
switch (style)
{
case Slider::LinearHorizontal:
return T(“LinearHorizontal”);
case Slider::LinearVertical:
return T(“LinearVertical”);
case Slider::LinearBar:
return T(“LinearBar”);
case Slider::Rotary:
return T(“Rotary”);
case Slider::RotaryHorizontalDrag:
return T(“RotaryHorizontalDrag”);
case Slider::RotaryVerticalDrag:
return T(“RotaryVerticalDrag”);
case Slider::IncDecButtons:
return T(“IncDecButtons”);
case Slider::TwoValueHorizontal:
return T(“TwoValueHorizontal”);
case Slider::TwoValueVertical:
return T(“TwoValueVertical”);
case Slider::ThreeValueHorizontal:
return T(“ThreeValueHorizontal”);
case Slider::ThreeValueVertical:
return T(“ThreeValueVertical”);

    default:
        jassertfalse
        break;
    }

    return String::empty;
}

static Slider::SliderStyle sliderStringToStyle (const String& s)
{
    if (s == T("LinearHorizontal"))
        return Slider::LinearHorizontal;
    else if (s == T("LinearVertical"))
        return Slider::LinearVertical;
    else if (s == T("LinearBar"))
        return Slider::LinearBar;
    else if (s == T("Rotary"))
        return Slider::Rotary;
    else if (s == T("RotaryHorizontalDrag"))
        return Slider::RotaryHorizontalDrag;
    else if (s == T("RotaryVerticalDrag"))
        return Slider::RotaryVerticalDrag;
    else if (s == T("IncDecButtons"))
        return Slider::IncDecButtons;
    else if (s.startsWithIgnoreCase (T("TwoValueHoriz")))
        return Slider::TwoValueHorizontal;
    else if (s.startsWithIgnoreCase (T("TwoValueVert")))
        return Slider::TwoValueVertical;
    else if (s.startsWithIgnoreCase (T("ThreeValueHoriz")))
        return Slider::ThreeValueHorizontal;
    else if (s.startsWithIgnoreCase (T("ThreeValueVert")))
        return Slider::ThreeValueVertical;

    jassertfalse
    return Slider::LinearHorizontal;
}[/code]

#3