Package voltage.core

# Class VoltageToggle

java.lang.Object
voltage.core.VoltageComponent
voltage.core.VoltageButton
voltage.core.VoltageToggle

public class VoltageToggle extends VoltageButton
A 2-state toggle button. Toggle buttons can be grouped together by using a group id. If a button has a group id, pushing it, will un-toggle another button in the group. Only one button within a group can be toggled at the same time. See the Cherry Audio Oscillator to see group ids in use.

- ## Nested Class Summary

  ### Nested classes/interfaces inherited from class voltage.core.VoltageButton

  `VoltageButton.ButtonState, VoltageButton.Justification`

- ## Field Summary

  ### Fields inherited from class voltage.core.VoltageComponent

  `componentName, displayName`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `VoltageToggle(String name, String displayName, VoltageModule module, boolean bInitiallyToggled, long optionalGroupID)`
  Constructor for a VoltageToggle
  `VoltageToggle(String name, VoltageModule module, boolean bInitiallyToggled, long optionalGroupID)`
  Constructor for a VoltageToggle

- ## Method Summary

  Modifier and Type
  Method
  Description
  `String`
  `GetButtonToggledStateImageOverlay(VoltageButton.ButtonState state)`
  Get's the toggled button's image resource for a state.
  `Color`
  `GetToggledOverlayTextColor(VoltageButton.ButtonState state)`
  Gets the text color for a button's toggle state.
  `boolean`
  `IsToggledByDefault()`
  Is this button toggled by default?
  `void`
  `SetButtonToggledStateImageOverlay(String resourceName, VoltageButton.ButtonState state)`
  Sets the toggled state's image overlay.
  `void`
  `SetToggledOverlayStateTextColor(int r, int g, int b, int a, VoltageButton.ButtonState state)`
  Sets the overlay text color for a toggled button's state
  `void`
  `SetToggledOverlayStateTextColor(Color zeColor, VoltageButton.ButtonState state)`
  Sets the overlay text color for a toggled button's state

  ### Methods inherited from class voltage.core.VoltageButton

  `GetAutoRepeat, GetButtonStateImageOverlay, GetImageOverlay, GetOverlayArea, GetOverlayFontSize, GetOverlayText, GetOverlayTextColor, GetOverlayTextColor, GetOverlayTextFont, GetOverlayTextJustification, IsOverlayFontBold, IsOverlayFontItalic, SetAutoRepeat, SetButtonStateImageOverlay, SetDragMode, SetImageOverlay, SetOverlayArea, SetOverlayArea, SetOverlayStateTextColor, SetOverlayStateTextColor, SetOverlayText, SetOverlayTextColor, SetOverlayTextColor, SetOverlayTextFont, SetOverlayTextJustification, SetValue, SetValueNoNotification, ShowingOverlay, ShowOverlay`

  ### Methods inherited from class voltage.core.VoltageComponent

  `AddChildComponent, GetComponentID, GetDisplayName, GetHeight, GetMaxValue, GetMinValue, GetRect, GetSkin, GetTooltipText, GetTransparency, GetUserProperty, GetValue, GetWidth, GetX, GetY, IsEnabled, IsVisible, RemoveChildComponent, SetCanBeAutomated, SetEnabled, SetPosition, SetRect, SetRect, SetSize, SetSkin, SetTransparency, SetUnits, SetUserProperty, SetValue, SetVisible, SetWantsMouseNotifications, SetZOrder, SkewNormalizedValue, UpdateGUIValue, WantsMouseNotifications`

  ### Methods inherited from class java.lang.Object

  `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### VoltageToggle

    public VoltageToggle(String name, VoltageModule module, boolean bInitiallyToggled, long optionalGroupID)
    Constructor for a VoltageToggle
    Parameters:
      `name` - the control's name
      `module` - the owner of this control
      `bInitiallyToggled` - default toggle state.
      `optionalGroupID` - if non-zero, this is the button group id.

  - ### VoltageToggle

    public VoltageToggle(String name, String displayName, VoltageModule module, boolean bInitiallyToggled, long optionalGroupID)
    Constructor for a VoltageToggle
    Parameters:
      `name` - the control's name
      `displayName` - the control's display name.
      `module` - the owner of this control
      `bInitiallyToggled` - default toggle state.
      `optionalGroupID` - if non-zero, this is the button group id.

- ## Method Details

  - ### SetButtonToggledStateImageOverlay

    public void SetButtonToggledStateImageOverlay(String resourceName, VoltageButton.ButtonState state)
    Sets the toggled state's image overlay.
    Parameters:
      `resourceName` - the name of the button's toggled image for a state.
      `state` - the button state for this image overlay.

  - ### GetButtonToggledStateImageOverlay

    public String GetButtonToggledStateImageOverlay(VoltageButton.ButtonState state)
    Get's the toggled button's image resource for a state.
    Parameters:
      `state` - the button state to get.
    Returns:
      the image resource name for the state.

  - ### SetToggledOverlayStateTextColor

    public void SetToggledOverlayStateTextColor(Color zeColor, VoltageButton.ButtonState state)
    Sets the overlay text color for a toggled button's state
    Parameters:
      `zeColor` - the color of the text
      `state` - the state to change.

  - ### SetToggledOverlayStateTextColor

    public void SetToggledOverlayStateTextColor(int r, int g, int b, int a, VoltageButton.ButtonState state)
    Sets the overlay text color for a toggled button's state
    Parameters:
      `r` - red (0-255)
      `g` - green (0-255)
      `b` - blue (0-255)
      `a` - alpha (0-255)
      `state` - the state to change.

  - ### GetToggledOverlayTextColor

    public Color GetToggledOverlayTextColor(VoltageButton.ButtonState state)
    Gets the text color for a button's toggle state.
    Parameters:
      `state` - the button state to get.
    Returns:
      the color of the toggled button's state.

  - ### IsToggledByDefault

    public boolean IsToggledByDefault()
    Is this button toggled by default?
    Returns:
      true if toggled by default.