Hoping for TABS in Designer
Hoping for TABS in Designer
I really like Designer, but creating layouts could become a lot easier if there was some sort of a TAB object, with in-editor option to show/hide...
When designing modules at some point it can come in handy to divide knobs etc. over several TABS...
And while it's perfectly possible to create those kind of things in Java, there is know way to hide objects in the editor which makes it real hard to design multi-TAB screens...
I hope Cherry Audio at some point will create an option for that...
Are others having the same difficulties?
cheers Hans
When designing modules at some point it can come in handy to divide knobs etc. over several TABS...
And while it's perfectly possible to create those kind of things in Java, there is know way to hide objects in the editor which makes it real hard to design multi-TAB screens...
I hope Cherry Audio at some point will create an option for that...
Are others having the same difficulties?
cheers Hans
Request for Music
- honki-bobo
- Posts: 310
- Joined: Sat Nov 09, 2019 1:18 pm
Re: Hoping for TABS in Designer
You can use the SetVisible(boolean isVisible) method to switch visibility of GUI elements, i.e. create two toggle buttons in one toggle group (your tab selectors), which turn visibility of certain elements on or off, depending on what you want to see on each tab.
Re: Hoping for TABS in Designer
Ya I know and use that Martin... and that’s good for ‘runtime’ but when editing I end up with multiple elements in the same spot that are on top of each other that I can not hide IN the editor window....
Or do I miss something?
Or do I miss something?
Request for Music
Re: Hoping for TABS in Designer
You can (with a bit of work behind the scenes, and some limitations), create the 'duplicate' components on the fly, using the existing ones as references. For example, I use code like this to create arrays of LEDs on the fly:
Code: Select all
/*
* dynamic gui control creation helpers
*
* AddComponent() is native to VoltageModule, and isn't visible from our external jar
* but it seems likely (from the code generated by VMD) that calling AddComponent()
* immediatly after creating the gui element is important. So before adding them to an
* instance of our 'LedRack' class(es) we'll create the leds, and AddComponent() them
* as we go. then we'll return the batch of new leds as an array (for use with
* the LedRack constructor)
*
*/
// create a bunch of leds using the specified skin
public VoltageLED[] LedFactory (int n, String skin, String name_root) {
VoltageLED[] leds = new VoltageLED[n];
for (int i=0; i < leds.length; i++) {
String lname = name_root + " " + (i+1);
leds[i] = new VoltageLED (lname, lname, this);
AddComponent (leds[i]);
leds[i].SetSkin (skin);
leds[i].SetVisible (false);
}
return leds;
}
And you're not limited to LEDs either of course - just look at the un-editable section of the module, and copy the matching initialization sequence for the component(s) you want to create on the fly.
To clone the location etc. of existing components, try something like this:
Code: Select all
// build a toggle button from a source toggle button and string
public VoltageToggle ButtonFactory (VoltageToggle src, String name) {
VoltageToggle button = new VoltageToggle (name, name, this, false, 0);
AddComponent(button);
button.SetWantsMouseNotifications( false );
button.SetRect(src.GetRect());
button.SetSkin( "Blue Square" );
button.ShowOverlay( false );
button.SetOverlayText( "" );
button.SetVisible( false );
return button;
}
Hope that helps!
Cheers,
--
Terry McG
Re: Hoping for TABS in Designer
Very cool trick, Terry!
I must confess that coming from (the last 15 years or so) PHP I missed the option of creating 'variable variables' that can in PHP be easily used to create objects on the fly...
I didn't really get how in Java (actually just started with it) something like that could be done - so very cool - thanks a lot!!!
This is at least a way of creating some repeating elements on the fly while having the tabs-images or rects in between and not clutter the editor...
I still think it would be very useful if the editor had a 'tab container' that could hold objects and the tab container could be set to hide/visible within the editor as well, like form editors in for instance VBA have...
But again thanks for this great advice!
cheers Hans
I must confess that coming from (the last 15 years or so) PHP I missed the option of creating 'variable variables' that can in PHP be easily used to create objects on the fly...
I didn't really get how in Java (actually just started with it) something like that could be done - so very cool - thanks a lot!!!
This is at least a way of creating some repeating elements on the fly while having the tabs-images or rects in between and not clutter the editor...
I still think it would be very useful if the editor had a 'tab container' that could hold objects and the tab container could be set to hide/visible within the editor as well, like form editors in for instance VBA have...
But again thanks for this great advice!
cheers Hans
Request for Music
Re: Hoping for TABS in Designer
Hi Hans...
Have fun with the clones
Cheers,
--
Terry McG
Sounds good to me too!
Have fun with the clones
Cheers,
--
Terry McG
Re: Hoping for TABS in Designer
Hey Terry... certainly having fun with the clones...
I tried using the same kind of thing using an array of AnalogOscillators but have not succeeded to get sound yet...
My syntax seems to ok - no errors there, but no sound..
Have you ever tried that?
cheers Hans
I tried using the same kind of thing using an array of AnalogOscillators but have not succeeded to get sound yet...
My syntax seems to ok - no errors there, but no sound..
Have you ever tried that?
cheers Hans
Request for Music
Re: Hoping for TABS in Designer
forget about it... just worked it out....
a variable was not properly initialized, so the value was incorrect... doh..
a variable was not properly initialized, so the value was incorrect... doh..
Request for Music
Re: Hoping for TABS in Designer
Glad it's working out!
I always seem to be missing a variable somewhere too
Cheers,
--
Terry McG
I always seem to be missing a variable somewhere too
Cheers,
--
Terry McG
Re: Hoping for TABS in Designer
Ya right?
I can be so sloppy in typing... missing brackets..missing semicolons or mistyping ..orforgetting...
And you really almost start to rely on the checks that the editor does when building...
Like..do I have enough closing brackets?.. and instead of counting.. just wait for the error
I can be so sloppy in typing... missing brackets..missing semicolons or mistyping ..orforgetting...
And you really almost start to rely on the checks that the editor does when building...
Like..do I have enough closing brackets?.. and instead of counting.. just wait for the error
Request for Music