• Hi Guest!

    Please be aware that we have released another critical security patch for VaM. We strongly recommend updating to version 1.22.0.12 using the VaM_Updater found in your installation folder.

    Details about the security patch can be found here.
CustomTabUI

Plugins + Scripts CustomTabUI

14mhz

Well-known member
Messages
163
Reactions
1,431
Points
93
14mhz submitted a new resource:

CustomTabUI - This simple plugin for Custom tabUI implementation.

CustomTabUI
● This simple plugin for new style tab UI implementation.
● There is no need to remove UI elements when changing tabs.
● Supports tabs expressed as icons.
● This library is free to modify and distribute, but credit is required.
- CustomTabUI.cs is in 14mhz.Plugin-CustomTabUI.1.var
- CustomTabUIExample1.cs is in 14mhz.Plugin-CustomTabUIExample.1.var
- CustomTabUIExample2.cs is in 14mhz.Plugin-CustomTabUIExample.1.var
- CustomTabUIExample3.cs is in...

Read more about this resource...
 
There is a bug in v0.2. (in case JSONStorableAction, ie, initButton)
Please use the code below until v0.3 is patched.
Also, code below that support Tab Traversing.
with the announcement of a new release, attachments have been removed.
C#:
CustomTabUI tui = new CustomTabUI(this, CreateUIElement, "A");
Tab a = tui.newTab(this, "TabA");
{
    a.add(initSlider("SliderA"));
    a.add(initToggle("ToggleA"));
}
Tab b = tui.newTab(this, "TabB");
{
    b.add(initSlider("SliderB"));
    b.add(initToggle("ToggleB"));
}
---- full traverse ----
foreach (KeyValuePair<String, Tab>pair in tui.getTabs())
{
    String    key = pair.Key;    // TabA, TabB key
    Tab       tab = pair.Value;  // TabA, TabB instance
    for (int i = 0; i < tab.elements.Count; i++)
    {
         object o = elements[i]; // JSONStorableParam or JSONStorableAction
    }
}
---- key traverse ----
Tab a = tui.getTab("TabA");
Tab b = tui.getTab("TabB");
JSONStorableFloat j == a.get("SliderA") == tui.getElement("TabA", "SliderA") as JSONStorableFloat;
JSONStorableBool  j == a.get("ToggleA") == tui.getElement("TabA", "ToggleA") as JSONStorableBool;
JSONStorableFloat j == b.get("SliderB") == tui.getElement("TabB", "SliderB") as JSONStorableFloat;
JSONStorableBool  j == b.get("ToggleB") == tui.getElement("TabB", "ToggleB") as JSONStorableBool;
---- also, dynamic obtaining UIDynamic via JSONStorable ----
UIDynamicSlider      u = Tools.JSONStorable2UIDynamic(instance of JSONStorableFloat) as UIDynamicSlider;
UIDynamicToggle      u = Tools.JSONStorable2UIDynamic(instance of JSONStorableBool) as UIDynamicToggle;
UIDynamicColorPicker u = Tools.JSONStorable2UIDynamic(instance of JSONStorableColor) as UIDynamicToggle;
UIDynamicTextField   u = Tools.JSONStorable2UIDynamic(instance of JSONStorableString) as UIDynamicTextField;
UIDynamicPopup       u = Tools.JSONStorable2UIDynamic(instance of JSONStorableStringChooser) as UIDynamicPopup;
UIDynamicButton      u = Tools.JSONStorable2UIDynamic(instance of JSONStorableAction) as UIDynamicButton;
 
Last edited:
Hi, I'm using this for a project, it's great... thanks. I have a couple of suggestions for it;
  • I found it a bit tricky to handle dynamic controls (eg adding new controls when user clicks "Add") as the tabs don't redraw properly (the background size does not grow and the controls are not hidden immediately if the user is not on the tab the controls are being added to). The workaround I had was to call active() on the tab which forces a redraw which was fine. But, there's no property exposed to know what tab the user has open - so it would be good to have a "redraw()" function on the tab, and expose a property to know which tab is active.
  • would be great to have a hide() / show() function to hide the entire control or an individual tab without having to destroy it entirely
 
Hi, I'm using this for a project, it's great... thanks. I have a couple of suggestions for it;
  • I found it a bit tricky to handle dynamic controls (eg adding new controls when user clicks "Add") as the tabs don't redraw properly (the background size does not grow and the controls are not hidden immediately if the user is not on the tab the controls are being added to). The workaround I had was to call active() on the tab which forces a redraw which was fine. But, there's no property exposed to know what tab the user has open - so it would be good to have a "redraw()" function on the tab, and expose a property to know which tab is active.
  • would be great to have a hide() / show() function to hide the entire control or an individual tab without having to destroy it entirely
Coincidentally, developers think in much the same way.
I was developing a dynamic add/remove feature. :LOL:
Us who think the same way are called The DEVELOPER, Welcome. Friend
※ As per your request, the name of the repaint method has been changed to redraw().
 
Last edited:
Back
Top Bottom