View Single Post
Old 04-29-2018, 05:49 AM   #109
Lokasenna
Human being with feelings
 
Lokasenna's Avatar
 
Join Date: Sep 2008
Location: Calgary, AB, Canada
Posts: 6,551
Default

I've had that on my idea list for quite a while, but when I start thinking about there are always a few bits that sound too difficult. eugen2777 had a basic one for his GUI template; I might take a look.

That said, you can do this:
Code:
local ref1 = {x = 16, y = 16, w = 48, h = 20}
GUI.New("btn_1", "Button", 1, ref1.x,    ref1.y,        ref1.w, ref1.h, ...
GUI.New("btn_2", "Button", 1, ref1.x,    ref1.y + 24,   ref1.w, ref1.h, ...
GUI.New("btn_3", "Button", 1, ref1.x,    ref1.y + 48,   ref1.w, ref1.h, ...
GUI.New("btn_4", "Button", 1, ref1.x,    ref1.y + 72,   ref1.w, ref1.h, ...
or create them with whatever coords you want and then do this after the fact:

Code:
for i = 1, 4 do
    GUI.elms.["btn_"..i].x = ref1.x
    GUI.elms.["btn_"..i].y = ref1.y + (i - 1) * 24
    GUI.elms.["btn_"..i].w = ref1.w
    GUI.elms.["btn_"..i].h = ref1.h
end
Radial Menu uses it all over the place, since I'll often know that I want certain elements together but keep changing my mind on where I want the whole group.
__________________
I'm no longer using Reaper or working on scripts for it. Sorry. :(
Default 5.0 Nitpicky Edition / GUI library for Lua scripts / Theory Helper / Radial Menu / Donate
Lokasenna is offline   Reply With Quote