Old 05-24-2018, 05:54 AM   #1
amagalma
Human being with feelings
 
Join Date: Apr 2011
Posts: 1,520
Default Does anyone know what the Dock functions do?

These:
Code:
reaper.Dock_UpdateDockID( ident_str, whichDock )
reaper.DockIsChildOfDock( hwnd )
reaper.DockWindowActivate( hwnd )
reaper.DockWindowAdd( hwnd, name, pos, allowShow )
reaper.DockWindowAddEx( hwnd, name, identstr, allowShow )
reaper.DockWindowRefresh()
reaper.DockWindowRefreshForHWND( hwnd )
reaper.DockWindowRemove( hwnd )
reaper.GetConfigWantsDock( ident_str )

What each one does? Anybody knows?
amagalma is offline   Reply With Quote
Old 05-24-2018, 09:00 AM   #2
mespotine
Human being with feelings
 
mespotine's Avatar
 
Join Date: May 2017
Location: Leipzig, Germany
Posts: 1,782
Default

You can influence docking, as well as get, in which docker a certain window is located.

For window names, you can use the one, that is displayed in the titles (like "Mixer").

Unfortunately the docker-values themselves are undocumented and the usage of the functions is also poorly documented....
mespotine is offline   Reply With Quote
Old 05-24-2018, 09:24 AM   #3
amagalma
Human being with feelings
 
Join Date: Apr 2011
Posts: 1,520
Default

Any use examples for each function?
amagalma is offline   Reply With Quote
Old 05-24-2018, 09:26 AM   #4
mespotine
Human being with feelings
 
mespotine's Avatar
 
Join Date: May 2017
Location: Leipzig, Germany
Posts: 1,782
Default

Not yet.

I'm in the process of documenting all functions of the API, especially the undocumented ones, so this is docker-functions-management is still on my To-Do-list.
mespotine is offline   Reply With Quote
Old 05-24-2018, 09:33 AM   #5
mespotine
Human being with feelings
 
mespotine's Avatar
 
Join Date: May 2017
Location: Leipzig, Germany
Posts: 1,782
Default

I would probably use reaper.GetConfigWantsDock("Mixer") (where "Mixer" is the ident_str of the mixer-window) in a persistant script, that displays into the ReaConsole the return-value of GetConfigWantsDock.

Then just drag the Mixer into the various dockers and see, what GetConfigWantsDock returns as values(the dockID).
(There are two dockers at least at the bottom of Reaper's window, keep that in mind.)

Keep in mind: even if a window isn't docked, it's docker-value, as returned by GetConfigWantsDock is still kept. So when you dock it again into the Reaper-window, it will fall again into the "old"-docker position.

Those who need a HWND as parameter are probably mostly useless in ReaScript, as there are too few functions returning the HWNDs for the windows opened in Reaper. They are probably only useful for C++-extensions, who have more easy access to HWNDs(a HWND is a window object, that has all attributes in it).


That's all I know for now...
mespotine is offline   Reply With Quote
Old 11-25-2019, 01:41 PM   #6
spk77
Human being with feelings
 
Join Date: Aug 2012
Location: Finland
Posts: 2,634
Default

Quote:
Originally Posted by mespotine View Post
I would probably use reaper.GetConfigWantsDock("Mixer") (where "Mixer" is the ident_str of the mixer-window) in a persistant script, that displays into the ReaConsole the return-value of GetConfigWantsDock.

Then just drag the Mixer into the various dockers and see, what GetConfigWantsDock returns as values(the dockID).
(There are two dockers at least at the bottom of Reaper's window, keep that in mind.)

Keep in mind: even if a window isn't docked, it's docker-value, as returned by GetConfigWantsDock is still kept. So when you dock it again into the Reaper-window, it will fall again into the "old"-docker position.

Those who need a HWND as parameter are probably mostly useless in ReaScript, as there are too few functions returning the HWNDs for the windows opened in Reaper. They are probably only useful for C++-extensions, who have more easy access to HWNDs(a HWND is a window object, that has all attributes in it).


That's all I know for now...



I noticed that passing the full file name of a script as "ident_str" -parameter will return the dock ID for script windows:
Code:
dock_ID = reaper.GetConfigWantsDock("spk77_Track Tags (dev101119).lua")
reaper.GetConfigWantsDock function
Code:
integer reaper.GetConfigWantsDock(string ident_str)

gets the dock ID desired by ident_str, if any


gfx.dock(-1) returns different values - this is how they seem to relate:
Code:
reaper.GetConfigWantsDock(string ident_str) == (gfx.dock(-1)-1)/256
spk77 is offline   Reply With Quote
Old 11-25-2019, 02:44 PM   #7
mespotine
Human being with feelings
 
mespotine's Avatar
 
Join Date: May 2017
Location: Leipzig, Germany
Posts: 1,782
Default

Nice work! That is a good start for working through them.
__________________
Ultraschall-API - a Lua-functions-library4Reaper: https://forum.cockos.com/showthread....98#post2067798
Reaper Internals - Developerdocs4Reaper: https://forum.cockos.com/showthread.php?t=207635
mespotine is offline   Reply With Quote
Old 01-13-2020, 11:56 AM   #8
spk77
Human being with feelings
 
Join Date: Aug 2012
Location: Finland
Posts: 2,634
Default

This seems to be added recently, thanks!
Code:
integer reaper.DockGetPosition(integer whichDock)

-1=not found, 0=bottom, 1=left, 2=top, 3=right, 4=floating

...but how to use it?

I thought that it would work like this (I tried to dock the script window to the left)
Code:
dock_pos = reaper.DockGetPosition(1)
gfx.dock(dock_pos*256+1)
...didn't dock to the left



Running this...
Code:
  for i=1, 5 do
    reaper.ShowConsoleMsg(tostring(reaper.DockGetPosition(i-1)) .. "\n")
  end
...returns these values...I thought it would return each position once? It returns multiple "top" positions.
Code:
1
3
2
2
2

Last edited by spk77; 01-14-2020 at 12:24 PM.
spk77 is offline   Reply With Quote
Old 01-14-2020, 12:33 PM   #9
schwa
Administrator
 
schwa's Avatar
 
Join Date: Mar 2007
Location: NY
Posts: 10,443
Default

Each dock has a whichDock number associated with it. To find the whichDock number for a given window, you can use the DockIsChildOfDock function. Once you have the whichDock number, the DockGetPosition function will tell you where that dock is located relative to the main REAPER window.
schwa is offline   Reply With Quote
Old 01-14-2020, 12:35 PM   #10
spk77
Human being with feelings
 
Join Date: Aug 2012
Location: Finland
Posts: 2,634
Default

Thanks, I'll test it immediately!
spk77 is offline   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 02:39 AM.


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