Jump to content

checkbox?


Dewdman42

Recommended Posts

Well I just tried a PluginParameter type "checkbox" and it does as is expected, makes a checkbox.  Since its not apparently documented anywhere I am unsure if there are any other optional arguments for it, I doubt it, but just asking.  Sounds like a "menu" with only two items on it somehow automagically turns into two linked radio buttons, which is equally effective...   I didn't see this documented anywhere either, just kind of exploring...
Link to comment
Share on other sites

That got me in the past:

PluginParameters = [
{
	type : "menu"
,	name: "Menu/Checkbox"
,	defaultValue: 0
,	valueStrings: [
   // "Off" first, "On" last
		"Off", "On"
	]
}
,	
{
	type : "menu"
,	name: "Menu/Toggle"
,	defaultValue: 0
,	valueStrings: [
   // "On" first, "Off" last
		"On", "Off"
	]
}	
,
{
	type : "menu"
,	name: "Menu/NotACheckbox"
,	defaultValue: 0
,	valueStrings: [
   // add spaces to strings to avoid a checkbox
		"Off ", "On "
	]
}
]

 

With checkbox, setting its defaultValue to 1 makes it ticked, setting it to 0, unticked...

 

There are a few more mutant parameters lurking in there too if I recall correctly.

Link to comment
Share on other sites

You know what? I'm regretting writing that without thinking! I've searched through my project files to no avail. I'll post it here when I find it. Basically its a slider that cannot be moved. This is annoying:

 

PluginParameters = [
    {
        type: "text",
        name: "BLINK"
    }
,   {
        type: "checkbox",
        name: "BLINK",
        defaultValue: 1
    }
]

ParameterChanged = ( index, value ) => {
    let param = PluginParameters[ index ]
    if ( param.hidden ) {
        PluginParameters[ 0 ].name = "    "
        param.hidden = false
    } else {
        PluginParameters[ 0 ].name = "BLINK"
        param.hidden = true
    }
    UpdatePluginParameters()
}

Link to comment
Share on other sites

  • 2 weeks later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...