Eyeon:Script/Reference/Applications/Fuse/Classes/Input/MultiButtonControl

From VFXPedia

Jump to: navigation, search

Contents


MultiButton Control

Description

The MultiButtonControl displays one or more buttons used to select from a range of options.

To add a MultibuttonControl to an input, you first specify the MultiButtonControl as the INPID_InputControl attribute in an AddInput function. Each button is then described by a table added to the same AddInput attribute table. See the example below :

This control returns an integer value representing which button is selected. If the first button is selected, thevalue will be 0, the second button would return as 1, and so forth.


Attributes

See the General Control Attributes list.

Per-button attributes

MBTNC_AddButton
Set this attribute to a string which will be used as the label for the button.
MBTNCD_ButtonWidth
This should be an fractional value between 0 and 1, determining the width of the button. A value of 1.0 would create a button the full width of the control.
MBTNC_ShowLabel
Enables or disables displaying the button's name text on the button.
MBTNC_ShowIcon
Enables or disables displaying the button's icon on the button.
MBTNCS_ToolTip
Set this to a string to be displayed when hovering the mouse cursor over the button.


Control attributes

MBTNC_ButtonHeight
This should be an integer value in pixels, determining the height of the buttons. The default value is 26 pixels high.
MBTNC_StretchToFit
Setting this to true will stretch the buttons equally across the full width of the control.
MBTNC_ShowName
Setting this to false will hide the name of the control.
MBTNC_NoIconScaling
Enables or disables scaling of the button's icon to the full size of the button.
MBTNC_Type
Can be one of "Normal", "Toggle" or "TriState".
MBTNC_Align
Can be one of "Center", "Left" or "Right".

Example

The BoolTest.Fuse example found at Eyeon:Script/Reference/Applications/Fuse/Example_Fuses demonstrates proper use of the MultiButtonControl.

The following fragment shows the creation of a MultiButtonControl with four options.

function Create()
	InOperation = self:AddInput("Operation", "Operation", {
		LINKID_DataType = "Number",
		INPID_InputControl = "MultiButtonControl",
		INP_Default = 0.0,
		{ MBTNC_AddButton = "Min", MBTNCD_ButtonWidth = 0.25, },
		{ MBTNC_AddButton = "Max", MBTNCD_ButtonWidth = 0.25, },
		{ MBTNC_AddButton = "Add", MBTNCD_ButtonWidth = 0.25, },
		{ MBTNC_AddButton = "Sub", MBTNCD_ButtonWidth = 0.25, },
		})


Tips for MultiButtonControl (edit)

If you set the MBTNCD_ButtonWidth = 0, you effectively hide a button.

If you set MBTNCD_ButtonWidth > 1, Fusion will not be pleased.

MBTNC_ShowBasicButton = false will hide the button, but leave a clickable label.

It doesn't "hide" the button. It just stops the button from drawing its button imagery. It will still fill its bounds, draw its label and any icon (if it has one). It will behave just like a button too (you can click on it, etc) --Stuart 20:14, 22 November 2011 (EST)


MBTNC_ShowBasicButton = false won't be very useful with the Fusion 6.1 skin. The Normal/Selected/Pushed colors are the same. Switching to an older skin or overriding the Button colors in a custom skin would fix this. --Chad 14:30, 23 October 2012 (EDT)

It's not really useful in general, and it's not expected that anyone would be using MBTNC_ShowBasicButton anyway. Stuart 15:38, 23 October 2012 (EDT)