Floating Tile Button
-
@d-healey the man with all the answers
-
@d-healey said in Floating Tile Button:
If you set the saveInPreset property to true for the button you want to be enabled on init and all the others to false.
Hate to be picky, but that's not good advice. All controls related to UI handling (page swapping, making other elements visible, etc) must not have
saveInPreset
enabled, or the interface will do random things if you load user presets.Instead, leave
saveInPreset
tofalse
, and callsetValue()
for the given control directly in the onInit callback:const var page1Button = Content.getComponent("page1Button"); const var page2Button = Content.getComponent("page2Button"); const var page3Button = Content.getComponent("page3Button"); page1Button.setValue(1); // or whatever logic you need page1Button.changed();
-
The boss in the house. Thanks as ever @Christoph-Hart and @d-healey
-
@christoph-hart said in Floating Tile Button:
page1Button.setValue(1); // or whatever logic you need
page1Button.changed();How to set the page? This just sets the button.
-
Not sure how you've setup your controls, but this should also fire the callback of the button which triggers the page swap.
-
@Christoph-Hart
David's method works fine, your method sets the button but it doesn't cause the page to change. I'm not at the multiple preset stage yet so I can't comment on what awaits further down the lineActually that's not true it's working now albeit the button doesn't stay highlighted as being in the "on" state
-
@Christoph-Hart
Just For General
What Is The Meaning Of The Numbers In This Line?PresetDisplay.setPopupData(presetBrowserData, [PresetDisplay.getWidth()/2, 25, 800, 470]);
-
Just change them and see what happens...
-
@Christoph-Hart Thanks Christoph
I Changed And Compiled Them Several Of Times
But It Jumps To The Top Again , And Also Cant Get Rid Of The White Stroke On The Browser Itself :(
Any Idea?
Thanks Man -
I am using this now , can I somehow change the font in the PresetBrowser as well as setting whether the favourites , catagory etc is shown i.e the usual settings fro the preset browser ?
-
@lalalandsynth Here is all that you can change at the moment without diving inC++
https://docs.hise.audio/glossary/custom_lookandfeel.html#getting-started
The font is in the property editor as well
favorite or category can't be moved, but you can have 2 columns instead of 3 -
@ustk Yes, But I cannot select the presetbrowser to show any settings in the property editor while calling it via the script .
So i am assuming i need to set all properties including Font via script.Oh, I just addded "ShowFolderButton": false, into the
"Type": "PresetBrowser", "Title": " ", "FontSize": 16, "ShowFolderButton": false, "ColourData":
Still not sure how to set the font wondering if I need to set a custom look and feel just to change the font for the preset browser or if I can access via scripting the usual options in the property editor ?
-
EDIT: Seems like my Oxygen font was corrupt . All good now .
and you can set what you want by borrowing terms from the property editor."bgColour": "0xFF282522", "itemColour1": "00B6A187", "itemColour3": "00B6A187", "textColour": "0xFFb6a187",
-
@lalalandsynth btw ,Using this method and the preset browser does not resize with the gui.
-
@lalalandsynth Maybe you should use a simple panel that you show/hide instead of a popup panel then...
-
@ustk Yes, I did it differently in another plugin , this method seemed viable there for a moment.
Also kind of liked the X to close the window. -
@lalalandsynth said in Floating Tile Button:
Also kind of liked the X to close the window.
You can make your own
-
@ustk True , I will try that !
although, first thing that comes to mind is if I make an invisible toggle on top of the preset text to open the preset window and an x to close , I would need to push the Open toggle twice to open it again , right ? -
@lalalandsynth said in Floating Tile Button:
@ustk True , I will try that !
although, first thing that comes to mind is if I make an invisible toggle on top of the preset text to open the preset window and an x to close , I would need to push the Open toggle twice to open it again , right ?reset it as you open the panel...
-
Or just toggle the panel with a momentary btn:
inline function onopenCloseBtnControl(component, value) { if (value) presetPnl.showControl( ! presetPnl.get("visible")); }; Content.getComponent("openCloseBtn").setControlCallback(onopenCloseBtnControl);