Hi,
I have been facing problems with setting the mouse cursor for my Linear bar sliders. I can’t even guess what’s going wrong. Please can somebody help me out here.
Here is a piece of code that sets the mouse cursor but still when the UI turns up, the cursor i have set is no where to be seen.
The problem that i face here is when I try setting the cursor for linear horizontal sliders it works just fine,
but when I try to do the same for linear bar sliders its never sets it.
I’ll be grateful if someone can help, I am stuck up with this issue for quite sometime now.
Thanks
The linear bar style actually contains a big text label, so in fact your mouse is over the label, not the slider, and so it won’t show the slider’s cursor. I guess you could use LookAndFeel::createSliderTextBox to create a box with your custom cursor.
(BTW, please don’t use the T(“”) macro any more - it’s deprecated, and was a terrible idea in the first place!)
Thanks for the reply.
I was using that function already in my lookAndFeel but it never came to my mind to set the cursor for the label there. I would like to add that, even if I did not set the cursor for the label in that function, for some linear bar sliders which use the same lookAndFeel had the custom cursor coming up. I am still grateful that, your idea worked, but don’t you think it shouldn’t be that way.
Can you think of another possible work around? I feel that it’s not the problem’s solution.
There is an interface already to set the Mouse Cursor for the TextBox of the Slider.
/**Sets mouse cursor for text box/label.
*/
void setMouseCursorForTextBox(const MouseCursor& cursor);
I guess this method is being used to set the mouse cursor for the label that the Slider uses internally. But I am sure that this is not working. I have tried it.
But setting the cursor for the label when its created in the lookAndfeel works fine.
I am sorry to have replied so late. I was on a vacation. Also the function was added by a colleague here, in order to set the mouse cursor( but it did not work ), so apologies for that as well. Did you get a solution to the problem??