Hover on Button or Slider ??
-
Hi, I have a button and a slider inside a panel. What I want to do is to change the panel color when the mouse is over the button or slider. I searched and couldn't find any information. Is it possible to do this?
-
@mehmethand You can do it if you are styling the control with look and feel
-
@d-healey thank you David. I'm not using look and feel. I have filmstrips for slider and button. So LAF is the only way for this operation I think.
-
@mehmethand You might be able to do it by running a timer and calling
Content.getComponentUnderMouse()
-
@d-healey Thank you so much. I tried timer and calling Content.getComponentUnderMouse(). It is working great.
-
@mehmethand you can combine laf + images :
const knobImage = Content.createLocalLookAndFeel(); knobImage.loadImage("{PROJECT_FOLDER}image.png", "img"); knobImage.registerFunction("drawRotarySlider", function(g, obj) { var a = obj.area; var offset = 100.0; // size of 1 image in px g.drawImage("img", a, 0, Engine.doubleToString(obj.value*100.0*offset, 2)); });
Although it only works with linear values. If you use non-linear knob modes, it gets messed up.