Slider tooltip


#1

Hi Jules,

On a LinearBar Slider, tooltips do not show up as expected because the child Label that displays the text value does not share that tooltip. Doing a

valueBox->setTooltip(getTooltip()) in Slider::lookAndFeelChanged

should fix that (maybe you would want to do that only in the case of a LinearBar slider)


#2

Ah - good point. Thanks, I’ll sort that out…


#3

I recently noticed that bug, too… but i actually found it favourable, as i wanted to display a different tip for the slider and the label…
a base-level fix probably won’t break this for me, tho.


#4

[quote=“jpo”]…Doing a

valueBox->setTooltip(getTooltip()) in Slider::lookAndFeelChanged

should fix that …[/quote]
Hi,

in juce_amalgamated this line is already implemented (in Juce v1.47 from SVN), but it still doesn´t work for me, e.g. for TextBoxLeft+LinearVertical:

See: void Slider::lookAndFeelChanged()

[code] if (textBoxPos != NoTextBox)
{
addAndMakeVisible (valueBox = getLookAndFeel().createSliderTextBox (*this));

    valueBox->setWantsKeyboardFocus (false);
    valueBox->setText (previousTextBoxContent, false);

    valueBox->setEditable (editableText && isEnabled());
    valueBox->addListener (this);

    if (style == LinearBar)
        valueBox->addMouseListener (this, false);

    valueBox->setTooltip (getTooltip());
}

[/code]
Do I miss something?
EDIT: In Jucer v1.1 it works :?:


#5

No help here? :slight_smile:
None of the Tooltips work in JUCE SVN v1.47. I tested with Jucer-generated- and handmade-code. But no Tooltips occur. But in Testing Component of Jucer it works… :?:


#6

I guess you need a TooltipWindow? Read the help for that class for more info.


#7

eem…what about classical calls like

m_stretchSlider->setTooltip (T("drag to time stretch")); playButton = new TextButton (T("play"),T("click here to play the current audio file")));
Why don´t they work anymore? Or did I mess up anything?


#8

Like I said, read the help for TooltipWindow. You need to create one.


#9

Thanks!
When setting parentcomponent to desktop, it works like a charm.

  1. Is it new, that setting a TooltipWindow is a precondition?
  2. Problem 1: When moving the mouse along over a button without leaving it, the tooltip disappears.
  3. Problem 2: Whenn setting e.g. a Button or a Slider as parentcomponent, the tooltip is broken and shown only a part of it. Strangely when holding over neighbours component :slight_smile:

#10
  1. No
  2. That’s just the logic it uses. I guess it could be tweaked, but seems fine to me
  3. Er, right, so you put a component inside a button and you’re asking why it’s only showing up inside the button?.. I think you need to spend a bit more time thinking about some of these questions before you post them!

#11
  1. hm… maybe then I´ve overseen it in Jucer´s Code. I guess it must have been added in another Component, on top of mine.
  2. :oops: You sound logical. Ok, I misinterpreted the first parameter, despite of its name: I was too quick and thought, this would be the component, for which this Tooltip should appear only.

#12

Now that the linear bar mode is indeed fixed, maybe the +/- buttons could also share the tooltip when the slider is in inc/dec mode?


#13

Sure, that sounds like it just needs a bit of a tweak.