View Single Post
Old 11-24-2014, 12:30 PM   #11
Breeder
Human being with feelings
 
Breeder's Avatar
 
Join Date: Nov 2010
Posts: 2,436
Default

Quote:
Originally Posted by gofer View Post
If not, Hopi could use them as a nifty additional way to switch his toolbars. He could basically have them semi-automatically follow his current work context (hover above the area of interest and use the shortcut which will switch his "ribbon" to the toolbar that fits that context best). Although I am a fan of small mouse position toolbars I think this could make for some good workflow as well.
Hmm...to switch toolbar (using the actions Toolbars: switch to toolbar x) you first need to focus the toolbar you want to switch from. When you do this with toolbar button, the toolbar that you want to switch from will get focused (by pressing the toolbar button) and then switched (by releasing the toolbar button).
And here's the problem. Besides making an option to switch to toolbar instead of toggling it under mouse we would also need to create a mechanism to tell the extension which toolbars to switch. Why is this a problem? Imagine Hopi having 5 toolbars set up at the top REAPER. If he has toolbar 1 shown, we need to switch toolbar 1 to toolbar x. After toolbar x is shown, when the action is called again we would need to switch from toolbar x to toolbar y.

What follows from this is that the user would have to set up special rules for each context. For example, you would say..."if detected context is item, switch toolbars 1, 2, 3, 4 and 5 to toolbar 2".
You can see how this can get complicated fast. Not to mention that contextual toolbars dialog is big as it is, stuffing all of these options in there somehow would make it even bigger.

I'm also not sure if setting focus to toolbar x is possible (in recent REAPER updates a new mechanism is created for setting focus to things, so I'm not sure if we could set focus to specific toolbar without trouble...in any case it wouldn't be doable from ReaScript alone since you need win32 api for it)

To be honest, contextual toolbars were created with mouse use in mind - all of these features would probably be beneficial to some users, but I don't want to over-complicate anything too much. I know that REAPER is famous for one million options, but in this case I think that simple is better.


For everything else, there is ReaScript. For example:

As said earlier, due to focus issues with toolbars it's not possible to switch specific toolbar to another toolbar, however...if you want to keep all of your toolbars docked in the same place you could pull it off with ReaScript. Like this:

Code:
from sws_python import *

window, segment, details, empty = BR_GetMouseCursorContext(0, 0, 0, 128)
toolbarAction = -1

if window in ("tcp", "mcp") and segment in ("track", "empty"):                      # Toolbar 1 (MCP/TCP track)
	toolbarAction = 41679
elif segment == "envelope" or details in ("env_point", "env_segment"):              # Toolbar 5 (envelope)
	toolbarAction = 41683
elif window == "arrange" and segment == "track" and (details in ("item", "empty")): # Toolbar 6 (Item)
	toolbarAction = 41684

if toolbarAction != -1 and not RPR_GetToggleCommandState(toolbarAction):

	# Close other toolbars
	if toolbarAction != 41679 and RPR_GetToggleCommandState(41679):
		RPR_Main_OnCommand(41679, 0)

	if toolbarAction != 41683 and RPR_GetToggleCommandState(41683):
		RPR_Main_OnCommand(41683, 0)

	if toolbarAction != 41684 and RPR_GetToggleCommandState(41684):
		RPR_Main_OnCommand(41684, 0)

	# Toggle our toolbar
	RPR_Main_OnCommand(toolbarAction, 0)
Quote:
Originally Posted by gofer View Post
If however SWS contextual toolbars can only open at mouse cursor it would be a very good idea to make it an option to open them in their last saved position instead (in a future build of SWS extensions). I figure we can already do this via ReaScript.
As said earlier, I would like to keep things as simple as possible but maybe I could pull this of without much complication. Need to play with it first...
Breeder is offline   Reply With Quote