Change text input position in drawPresetBrowserDialog
-
Hi everyone,
I would like to ask for a little help.
I am currently working on a preset browser, and I changed the look of the dialog with drawPresetBrowserDialog.
But I can not change the position of the text input. My goal is to follow the changes of obj.labelArea, and somehow make it centered, but it doesn't work.
My code:
laf.registerFunction("drawPresetBrowserDialog", function(g, obj) { obj.area = [obj.area[0] + 75.0, obj.area[1], obj.area[2] -150.0, obj.area[3]]; obj.labelArea = [obj.labelArea[0] + 40.0, obj.labelArea[1], obj.labelArea[2] -80.0, obj.labelArea[3]]; g.fillAll(0x00000000); g.setColour(0xF0CECECE); g.fillRoundedRectangle(obj.area, 5.0); g.setColour(0x76000000); g.fillRoundedRectangle(obj.labelArea, 2.5); g.setColour(0xFF222222); g.drawAlignedText(obj.text, [-32, 160, 350, 4], "centred"); });
Is there any workaround for this?
Thanks!
Gábor -
I don't think it's possible to change the position of the input box. You'd need to create an entirely custom dialog instead.
-
Thanks @d-healey !
Oh damn. How can I do that?
-
@Gabor-K Use a panel/label/buttons to create the dialog. Then the PresetHandler to add the functionality. This might end up being a lot of work, I've never done it so not sure.
-
@d-healey I will have a look, but I guess this option will not work at this time due to time pressure. Thanks anyway, at least I know the limitations.