Go Back   Cockos Incorporated Forums > REAPER Forums > ReaScript, JSFX, REAPER Plug-in Extensions, Developer Forum

Reply
 
Thread Tools Display Modes
Old 12-29-2021, 12:34 PM   #1
cohler
Banned
 
Join Date: Dec 2018
Posts: 642
Default Toolbar icons for multi-state toggles with 3 or more states?

The toggle state of any ReaScript action may be set using
Code:
reaper.SetToggleCommandState
I understand that for simple two-state toggles, one creates a 30x90 icon image inside of which there are three 30x30 images representing the off, hover, and on states, and that 30x90 icon image is placed in the Data/toolbar_icons folder inside the REAPER resource directory, and is assigned to the corresponding toolbar command in the reaper-menu.ini file as follows:
icon_0=some_30x90_icon_file.png
item_0=_ACTION_NAME Action description
The reaper.SetToggleCommandState API function, however, allows you to set the state to any integer, which allows you to have multi (i.e. more than two) state toggles.

How, then, do you assign additional toolbar icon images to those additional states? (PLEASE do not respond to me about two-state toggles, which I already understand and have already explained here.)
cohler is offline   Reply With Quote
Old 01-04-2022, 06:32 PM   #2
cohler
Banned
 
Join Date: Dec 2018
Posts: 642
Default

This thread has close to 6000 views since its creation just a few days ago! Wow! Based on its popularity, and obvious importance, I hope we hear from @Justin and @schwa soon.
cohler is offline   Reply With Quote
Old 07-09-2022, 07:20 AM   #3
cohler
Banned
 
Join Date: Dec 2018
Posts: 642
Default

Quote:
Originally Posted by cohler View Post
The toggle state of any ReaScript action may be set using
Code:
reaper.SetToggleCommandState
I understand that for simple two-state toggles, one creates a 30x90 icon image inside of which there are three 30x30 images representing the off, hover, and on states, and that 30x90 icon image is placed in the Data/toolbar_icons folder inside the REAPER resource directory, and is assigned to the corresponding toolbar command in the reaper-menu.ini file as follows:
icon_0=some_30x90_icon_file.png
item_0=_ACTION_NAME Action description
The reaper.SetToggleCommandState API function, however, allows you to set the state to any integer, which allows you to have multi (i.e. more than two) state toggles.

How, then, do you assign additional toolbar icon images to those additional states? (PLEASE do not respond to me about two-state toggles, which I already understand and have already explained here.)
Bump.
cohler is offline   Reply With Quote
Old 12-31-2022, 09:53 AM   #4
MonkeyBars
Human being with feelings
 
MonkeyBars's Avatar
 
Join Date: Feb 2016
Location: Hollyweird
Posts: 2,637
Default

+1 would be great
MonkeyBars is offline   Reply With Quote
Old 12-31-2022, 01:22 PM   #5
vitalker
Human being with feelings
 
vitalker's Avatar
 
Join Date: Dec 2012
Posts: 13,336
Default

Quote:
Originally Posted by MonkeyBars View Post
+1 would be great
It is not FR and the thread is not in FR forum. Cohler was just asking how to do it.
vitalker is online now   Reply With Quote
Old 12-31-2022, 01:49 PM   #6
MonkeyBars
Human being with feelings
 
MonkeyBars's Avatar
 
Join Date: Feb 2016
Location: Hollyweird
Posts: 2,637
Default

Quote:
Originally Posted by vitalker View Post
It is not FR and the thread is not in FR forum. Cohler was just asking how to do it.
Oh whoops! Anyone know if it's possible?
MonkeyBars is offline   Reply With Quote
Old 12-31-2022, 02:19 PM   #7
vitalker
Human being with feelings
 
vitalker's Avatar
 
Join Date: Dec 2012
Posts: 13,336
Default

Quote:
Originally Posted by MonkeyBars View Post
Oh whoops! Anyone know if it's possible?
I doubt that. The documentation says:

Quote:
boolean reaper.SetToggleCommandState(integer section_id, integer command_id, integer state)

Updates the toggle state of an action, returns true if succeeded. Only ReaScripts can have their toggle states changed programmatically.
All of the above claim that it is not possible. And Actions doesn't support anything, but on and off.
vitalker is online now   Reply With Quote
Old 12-31-2022, 05:32 PM   #8
Meo-Ada Mespotine
Human being with feelings
 
Meo-Ada Mespotine's Avatar
 
Join Date: May 2017
Location: Leipzig
Posts: 6,630
Default

Only on and off is supported, though buttons can have a third state valled "armed" when right clicking a button.
It's probably possible to set it to armed state but would mean it's armed for additional functionality.
I never used armed actions so I have no clue about them and don't know, if the buttons get colored to armed.
__________________
Use you/she/her.Ultraschall-Api Lua Api4Reaper - Donate, if you wish

On vacation for the time being...
Meo-Ada Mespotine is offline   Reply With Quote
Old 01-01-2023, 03:07 AM   #9
vitalker
Human being with feelings
 
vitalker's Avatar
 
Join Date: Dec 2012
Posts: 13,336
Default

Quote:
Originally Posted by Meo-Ada Mespotine View Post
Only on and off is supported, though buttons can have a third state valled "armed" when right clicking a button.
It's probably possible to set it to armed state but would mean it's armed for additional functionality.
I never used armed actions so I have no clue about them and don't know, if the buttons get colored to armed.
Armed is just on state, but you can use left click instead of shortcuts. And yes, the button is colored.
vitalker is online now   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 08:20 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.