Old 11-15-2018, 12:49 PM   #361
dsyrock
Human being with feelings
 
dsyrock's Avatar
 
Join Date: Sep 2018
Location: China
Posts: 90
Default

Quote:
Originally Posted by Lokasenna View Post
Did you remember to include a call to the original methods inside both of yours? If you forget that, then the element literally doesn't know anymore what it's supposed to be doing.
I'm not sure, are these right? I just copy from where I declared them the first time. And "onmousedown" still worked but "ondrag" didn't

PS:I said the ondrag thing did not work, it meaned the slider was not only failed to run functionB, but also failed to drag the slider’s handle

Code:
function functionB()

 some codes

end

function functionA()

  some codes

    GUI.New("mylider", "Slider", {     --recreate the slider
        z = 11,
        x = 1096.0,
        y = 5.0,
        w = 106,
        min=0,
        max=newvalue,                  -- new value of max
        defaults=0,    
        caption = "myslider",
        font = 3,
        col_txt = "txt",
        --col_fill = "elm_frame",
        show_values=false
       
    })    

    function GUI.elms.myslider:onmousedown()      --have to declare it again

     GUI.Slider.onmousedown(self)
   
      funntionB()
      
    end
    
    function GUI.elms.myslider:ondrag()           --have to declare it again

      GUI.Slider.ondrag(self)

      functionB()

    end

  reaper.defer(functionA)

end

Last edited by dsyrock; 11-15-2018 at 06:19 PM.
dsyrock is offline   Reply With Quote
Old 11-17-2018, 10:08 PM   #362
MusoBob
Human being with feelings
 
Join Date: Sep 2014
Posts: 426
Default

How do I , oh how do I... not the song, but how do I call a function once the text is entered in the "Textbox" ?
MusoBob is offline   Reply With Quote
Old 11-17-2018, 11:46 PM   #363
deeb
Human being with feelings
 
deeb's Avatar
 
Join Date: Feb 2017
Posts: 1,949
Default

Maybe Check the events in textbox class? onSomething. I am not on computer so can't help.
deeb is offline   Reply With Quote
Old 11-18-2018, 05:07 AM   #364
MusoBob
Human being with feelings
 
Join Date: Sep 2014
Posts: 426
Default

Thanks, I could see onmousedown() ondoubleclick() onupdate() ontype() onwheel() ondrag()

Code:
function GUI.elms.bar1_1:onmousedown()
         reaper.SetEditCurPos(0.0, 0, 0)   
         reaper.Main_OnCommand(40616,0) --Markers: Edit region near cursor
end
to bring up Edit region near cursor.

I can't see how to get
red, green, blue = reaper.ColorFromNative(region_color)
in a frame background color
bg = ????,


..
MusoBob is offline   Reply With Quote
Old 11-18-2018, 09:35 AM   #365
deeb
Human being with feelings
 
deeb's Avatar
 
Join Date: Feb 2017
Posts: 1,949
Default

Quote:
Originally Posted by MusoBob View Post

to bring up Edit region near cursor.

I can't see how to get
red, green, blue = reaper.ColorFromNative(region_color)
in a frame background color
bg = ????,


..
maybe better to ask in another thread, as more people will be able to reply : )
deeb is offline   Reply With Quote
Old 11-18-2018, 12:22 PM   #366
MusoBob
Human being with feelings
 
Join Date: Sep 2014
Posts: 426
Default

red, green, blue = reaper.ColorFromNative(region_color)
GUI.colors["region"] = {red, green, blue, 255}


GUI.New("frame_1", "Frame", {
z = 11,
x = x1+0.0,
y = y1+192.0,
w = 255,
h = 40,
shadow = false,
fill = false,
color = "elm_frame",
bg = "region",
round = 0,
text = "17",
txt_indent = 0,
txt_pad = 0,
pad = 1,
font = 4,
col_txt = "txt"
})

Last edited by MusoBob; 11-18-2018 at 03:30 PM.
MusoBob is offline   Reply With Quote
Old 11-18-2018, 04:35 PM   #367
MusoBob
Human being with feelings
 
Join Date: Sep 2014
Posts: 426
Default

I can update the textbox value
GUI.Val("bar1_1", chord_name)
I need to also to update the Frame bg color in the above post.
MusoBob is offline   Reply With Quote
Old 11-21-2018, 10:08 AM   #368
xpander
Human being with feelings
 
xpander's Avatar
 
Join Date: Jun 2007
Location: Terra incognita
Posts: 4,449
Default

Thank you Lokasenna for this GUI library and tools!

I thought of trying to copy a specific keyswitch panel idea and with the help of the GUI Builder, the first step was really easy. But now that I have buttons in four columns like I want them, how could I go about changing the visibility of those columns depending on what buttons are pressed?

The idea is following: left column stays always visible/active, so it's on top of the hierarchy. The visibility/availability of any other columns to the right would then depend on what button was pressed on the previous column. In this example picture, there could be e.g. a column 5, but because of the choices made on previous columns, it's not available.



Another related question; how to highlight or frame the last pressed button on every column like in the mock-up above?

Any ideas appreciated, thanks.

---
edit: testing layer visibility management next...

Last edited by xpander; 11-22-2018 at 05:37 PM.
xpander is offline   Reply With Quote
Old 11-21-2018, 12:48 PM   #369
MusoBob
Human being with feelings
 
Join Date: Sep 2014
Posts: 426
Default

That's what I'm trying to do in the previous post, to update the frame.
You could have a frame behind the button that changes color.
This could also change with the on/off state if it's a Reaper toggle action

You can also use images and change them.
I think to update my buttons I had to add a ondelete so to delete the old button first.


This is show cue markers toggle:
Code:
function update_show_chords_in_items() 
      
--Delete old buttons before updating  

   if reaper.GetToggleCommandState(40691) == 1 then onstate = "black" textstate = "red"
   else
     onstate = "gray" textstate = "yellow"
   end
GUI.elms.show_chords_in_items_btn:ondelete()
 
GUI.New("show_chords_in_items_btn",      "Button",           3, 275+x1, 180+y1, 135, 20, "Show Chords in Items", btn_click_show_chords_in_items)
GUI.elms.show_chords_in_items_btn.col_txt = textstate
GUI.elms.show_chords_in_items_btn.col_fill = onstate    

GUI.elms.show_chords_in_items_btn:init()    

end



   if reaper.GetToggleCommandState(40691) == 1 then onstate = "black" textstate = "red"
   else
     onstate = "gray" textstate = "yellow"
   end
Code:
function update_chord_buttons() 
      
--Delete old buttons before updating  

    GUI.elms.lb_chords_on:ondelete() 
    GUI.elms.lb_key_chord:ondelete()
MusoBob is offline   Reply With Quote
Old 11-24-2018, 06:51 AM   #370
deeb
Human being with feelings
 
deeb's Avatar
 
Join Date: Feb 2017
Posts: 1,949
Default

I am away from PC. If nothing mentioning in frame class about border color, maybe you can layer a second layer of frame behind the other, with some more pixels on height and width, so that fill color can work as a border. Not sure, just a thought.
deeb is offline   Reply With Quote
Old 12-02-2018, 02:43 PM   #371
tXShooter
Human being with feelings
 
tXShooter's Avatar
 
Join Date: Aug 2017
Posts: 249
Default When docked, and trying to resize the width, it crashes.

What can I do to prevent the script from crashing when resizing the width of the GUI (I've got mine in the Docker when this happens)?

Code:
Error: Reaper DAW Interface GUI.lua:1852: attempt to index a nil value (global 'gui')

Stack traceback:
	Core.lua:70: in metamethod '__index'
	Reaper DAW Interface GUI.lua:1852: in field 'func'
	Core.lua:292: in function <C:\OneDriveTemp\OneDrive\Lokasenna_GUI v2\Library\Core.lua:280>
		[C]: in function 'xpcall'
	Core.lua:280: in function <C:\OneDriveTemp\OneDrive\Lokasenna_GUI v2\Library\Core.lua:279>

Lokasenna_GUI:	(the file is not owned by any package entry)
Reaper:       	5.962/x64
Platform:     	Win64
__________________
"But be ye doers of the word, and not hearers only, deceiving your own selves."
tXShooter is offline   Reply With Quote
Old 12-03-2018, 09:02 AM   #372
tompad
Human being with feelings
 
Join Date: Jan 2010
Location: Fjugesta, Sweden
Posts: 331
Default Docking Lokasenna GUI?

Is it possible to dock a script made with Lokasenna GUI?

Cant do it on linux.....

Regards
TompaD
__________________
ToDoList MusicMath Donation Mark4celeste Frid i ditt hjärta Eve & the Fisherman on Spotify
tompad is offline   Reply With Quote
Old 12-03-2018, 03:35 PM   #373
tXShooter
Human being with feelings
 
tXShooter's Avatar
 
Join Date: Aug 2017
Posts: 249
Default

Quote:
Originally Posted by tompad View Post
Is it possible to dock a script made with Lokasenna GUI?

Cant do it on linux.....

Regards
TompaD
I'm not sure if this is the 'right' way to do it, but here's how I am docking it on start up for Windows 10 / 7:

Code:
local function Init()
	reaper.Main_OnCommand(41172) -- Dock/undock currently focused window
end
__________________
"But be ye doers of the word, and not hearers only, deceiving your own selves."

Last edited by tXShooter; 12-03-2018 at 03:36 PM. Reason: Typo
tXShooter is offline   Reply With Quote
Old 12-24-2018, 10:56 AM   #374
tompad
Human being with feelings
 
Join Date: Jan 2010
Location: Fjugesta, Sweden
Posts: 331
Default

Quote:
Originally Posted by tXShooter View Post
I'm not sure if this is the 'right' way to do it, but here's how I am docking it on start up for Windows 10 / 7:

Code:
local function Init()
	reaper.Main_OnCommand(41172) -- Dock/undock currently focused window
end
This dont work for me - I am trying to make my window dockable by dragging it to a blue field, like a toolbar.
__________________
ToDoList MusicMath Donation Mark4celeste Frid i ditt hjärta Eve & the Fisherman on Spotify
tompad is offline   Reply With Quote
Old 12-24-2018, 11:08 AM   #375
mespotine
Human being with feelings
 
mespotine's Avatar
 
Join Date: May 2017
Location: Leipzig, Germany
Posts: 679
Default

Keep in mind, the Linux version is still missing stuff. This might not work because it might not be implemented yet.
__________________
Ultraschall-API: https://forum.cockos.com/showthread....98#post2067798
Reaper Internals - Developerdocs for Reaper: https://forum.cockos.com/showthread.php?t=207635
mespotine is offline   Reply With Quote
Old 12-24-2018, 02:09 PM   #376
tompad
Human being with feelings
 
Join Date: Jan 2010
Location: Fjugesta, Sweden
Posts: 331
Default

Quote:
Originally Posted by mespotine View Post
Keep in mind, the Linux version is still missing stuff. This might not work because it might not be implemented yet.
Ok, I better take a break from this and focus on other script things. :-)
__________________
ToDoList MusicMath Donation Mark4celeste Frid i ditt hjärta Eve & the Fisherman on Spotify
tompad is offline   Reply With Quote
Old 12-24-2018, 02:17 PM   #377
tompad
Human being with feelings
 
Join Date: Jan 2010
Location: Fjugesta, Sweden
Posts: 331
Default Options in a matrix

Hi again!

Is this possible to do with Options?

I want a matrix with 4 x 4 options and when I click one
of the options all the others are not active(green).

Like this:

XXXX
XXOX
XXXX
XXXX

I started with making 4 columns with 4 options each, but every
column start with one option selected (green). I cant find a way
to disable the green dot in columns. Is it possible?

Merry Christmas
Tompad
__________________
ToDoList MusicMath Donation Mark4celeste Frid i ditt hjärta Eve & the Fisherman on Spotify
tompad is offline   Reply With Quote
Old 12-24-2018, 02:22 PM   #378
tompad
Human being with feelings
 
Join Date: Jan 2010
Location: Fjugesta, Sweden
Posts: 331
Default

Quote:
Originally Posted by mespotine View Post
__________________
Ultraschall-API: https://forum.cockos.com/showthread....98#post2067798
Reaper Internals - Developerdocs for Reaper: https://forum.cockos.com/showthread.php?t=207635

Oooh - I see Santa is coming!

Have to take a look at this for my ToDo-script!
Needed something to check if a project is closed or a new
one is started (to close my ToDo-script and save list).
__________________
ToDoList MusicMath Donation Mark4celeste Frid i ditt hjärta Eve & the Fisherman on Spotify
tompad is offline   Reply With Quote
Old 12-25-2018, 07:51 AM   #379
tompad
Human being with feelings
 
Join Date: Jan 2010
Location: Fjugesta, Sweden
Posts: 331
Default

Quote:
Originally Posted by tompad View Post
Hi again!

Is this possible to do with Options?

I want a matrix with 4 x 4 options and when I click one
of the options all the others are not active(green).

Like this:

XXXX
XXOX
XXXX
XXXX

I started with making 4 columns with 4 options each, but every
column start with one option selected (green). I cant find a way
to disable the green dot in columns. Is it possible?

Merry Christmas
Tompad

Oh my! I never stop be amazed about my mind! Why do I need options??
I can do the same with a matrix of buttons! Sigh!

So buttons will it be!
__________________
ToDoList MusicMath Donation Mark4celeste Frid i ditt hjärta Eve & the Fisherman on Spotify
tompad is offline   Reply With Quote
Old 12-25-2018, 02:32 PM   #380
mespotine
Human being with feelings
 
mespotine's Avatar
 
Join Date: May 2017
Location: Leipzig, Germany
Posts: 679
Default

Quote:
Originally Posted by tompad View Post
Oooh - I see Santa is coming!

Have to take a look at this for my ToDo-script!
Needed something to check if a project is closed or a new
one is started (to close my ToDo-script and save list).
That's what I added that feature for
__________________
Ultraschall-API: https://forum.cockos.com/showthread....98#post2067798
Reaper Internals - Developerdocs for Reaper: https://forum.cockos.com/showthread.php?t=207635
mespotine is offline   Reply With Quote
Old 12-25-2018, 02:34 PM   #381
mespotine
Human being with feelings
 
mespotine's Avatar
 
Join Date: May 2017
Location: Leipzig, Germany
Posts: 679
Default

Feature Request.

Could you add an option for adding background-images, instead of a background-color?
Like, making wnd_bg -1, -1, -1, -1 and setting GUI.colors.wnd_bg_filename="filename" setting an image instead of the background-color.

I would also love to see a class for images. I tried to make my own, but couldn't get far, unfortunately...
__________________
Ultraschall-API: https://forum.cockos.com/showthread....98#post2067798
Reaper Internals - Developerdocs for Reaper: https://forum.cockos.com/showthread.php?t=207635
mespotine is offline   Reply With Quote
Old 01-02-2019, 04:36 PM   #382
Lokasenna
Human being with feelings
 
Lokasenna's Avatar
 
Join Date: Sep 2008
Location: The vast, frozen wasteland of western Canadia.
Posts: 5,560
Default

Certainly doable, and I have image functionality on my to-do list.

In the meantime one of the posts in my GUI tutorial (see my sig) covers how you would go about converting the existing classes to use images instead of drawing. It uses a really old version of the GUI though, so there would be a bit of work to adapt it.
__________________
Currently enrolled in a coding bootcamp; don't expect timely responses from me.
Default 5.0 Nitpicky Edition / GUI tutorial for Lua / GUI library for Lua scripts / Theory Helper / Radial Menu / Donate / ReaPack
Lokasenna is online now   Reply With Quote
Old 01-02-2019, 04:41 PM   #383
Lokasenna
Human being with feelings
 
Lokasenna's Avatar
 
Join Date: Sep 2008
Location: The vast, frozen wasteland of western Canadia.
Posts: 5,560
Default

Highlights around buttons - I do this in Theory Helper... if memory serves, I modified the button class in that script so that if a certain property was true, it drew the highlight in its draw method.

Linux docking - It should work find AFAIK. You just can't right-click on window titlebars to dock them because Reaper has no access to the right-click menu on Linux.
__________________
Currently enrolled in a coding bootcamp; don't expect timely responses from me.
Default 5.0 Nitpicky Edition / GUI tutorial for Lua / GUI library for Lua scripts / Theory Helper / Radial Menu / Donate / ReaPack
Lokasenna is online now   Reply With Quote
Old 01-03-2019, 12:28 PM   #384
tompad
Human being with feelings
 
Join Date: Jan 2010
Location: Fjugesta, Sweden
Posts: 331
Default

Quote:
Originally Posted by Lokasenna View Post
Linux docking - It should work find AFAIK. You just can't right-click on window titlebars to dock them because Reaper has no access to the right-click menu on Linux.
How do I do it? Nothing happens (no blue line)when dragging window in place.
__________________
ToDoList MusicMath Donation Mark4celeste Frid i ditt hjärta Eve & the Fisherman on Spotify
tompad is offline   Reply With Quote
Old 01-04-2019, 12:43 PM   #385
Lokasenna
Human being with feelings
 
Lokasenna's Avatar
 
Join Date: Sep 2008
Location: The vast, frozen wasteland of western Canadia.
Posts: 5,560
Default

Ah, I see. Yeah, Linux handles windows differently so that's currently a problem. I imagine scripts should be able to dock windows using the API, but I never use docking for anything so I'm not sure.
__________________
Currently enrolled in a coding bootcamp; don't expect timely responses from me.
Default 5.0 Nitpicky Edition / GUI tutorial for Lua / GUI library for Lua scripts / Theory Helper / Radial Menu / Donate / ReaPack
Lokasenna is online now   Reply With Quote
Old 01-05-2019, 01:22 PM   #386
bFooz
Human being with feelings
 
bFooz's Avatar
 
Join Date: Jul 2010
Location: Slovakia
Posts: 713
Default

Hi, a crash report. I just run ReaLauncher for the fist time and got this:

Code:
Error: Class - Menubox.lua:141: bad argument #1 to 'floor' (number expected, got table)

Stack traceback:
	Core.lua:87: in function <...am Scripts\Development\Lokasenna_GUI v2\Library\Core.lua:78>
		[C]: in function 'math.floor'
	Class - Menubox.lua:141: in function <...ent\Lokasenna_GUI v2\Library\Classes/Class - Menubox.lua:135>
		(...tail calls...)
	solger_ReaLauncher.lua:825: in function 'UpdatePathDisplayMode'
	solger_ReaLauncher.lua:1157: in method 'onmousedown'
	Class - Tabs.lua:202: in method 'ondrag'
	Core.lua:871: in field 'Update'
	Core.lua:434: in field 'Main_Update_Elms'
	Core.lua:301: in function <...am Scripts\Development\Lokasenna_GUI v2\Library\Core.lua:297>
		[C]: in function 'xpcall'
	Core.lua:297: in function <...am Scripts\Development\Lokasenna_GUI v2\Library\Core.lua:296>

Lokasenna_GUI:	v2.16.2
Reaper:       	5.965
Platform:     	Win32
__________________
Donations | Mixing & Mastering Services
bFooz is offline   Reply With Quote
Old 01-05-2019, 07:13 PM   #387
Lokasenna
Human being with feelings
 
Lokasenna's Avatar
 
Join Date: Sep 2008
Location: The vast, frozen wasteland of western Canadia.
Posts: 5,560
Default

Cheers. I'm guessing it's a ReaLauncher issue, but I'll keep an eye on that thread all the same.
__________________
Currently enrolled in a coding bootcamp; don't expect timely responses from me.
Default 5.0 Nitpicky Edition / GUI tutorial for Lua / GUI library for Lua scripts / Theory Helper / Radial Menu / Donate / ReaPack
Lokasenna is online now   Reply With Quote
Old 01-06-2019, 04:08 AM   #388
solger
Human being with feelings
 
solger's Avatar
 
Join Date: Mar 2013
Posts: 3,316
Default

Quote:
Originally Posted by bFooz View Post
Hi, a crash report. I just run ReaLauncher for the fist time and got this:
Quote:
Originally Posted by Lokasenna View Post
Cheers. I'm guessing it's a ReaLauncher issue, but I'll keep an eye on that thread all the same.
Yeah, that's a bug in the ReaLauncher code which can sometimes cause this error when switching between Tabs.

I'm already making some code changes for the next update, so this error should not be happening anymore in the next ReaLauncher version.
__________________
ReaLauncher
solger is offline   Reply With Quote
Old 01-06-2019, 12:57 PM   #389
woodslanding
Human being with feelings
 
woodslanding's Avatar
 
Join Date: Mar 2007
Location: Denver, CO
Posts: 265
Default How to control widget via midi?

I'm looking through the API to see how to control something from incoming MIDI, and not finding anything. All the midi commands seem to relate to takes, not incoming midi.

I guess if FXparameters and reaper controls are being controlled by midi, you could poll them?

I should look at how LBXStripper does it, I guess....
__________________
e moon
http://ericmoonmusic.com
>>{ Very Stable Genius }<<
woodslanding is offline   Reply With Quote
Old 01-06-2019, 03:02 PM   #390
Lokasenna
Human being with feelings
 
Lokasenna's Avatar
 
Join Date: Sep 2008
Location: The vast, frozen wasteland of western Canadia.
Posts: 5,560
Default

Not sure if LBXStripper has a different approach, as I'm a bit of a stranger to MIDI processing, but the best approach I've found is to have separate actions associated with your script that a user can bind to MIDI keys in the action list.

When one of the actions is run, it sets a variable in an ExtState or text file that your main script can periodically check, doing something when it sees that the variable has changed.
__________________
Currently enrolled in a coding bootcamp; don't expect timely responses from me.
Default 5.0 Nitpicky Edition / GUI tutorial for Lua / GUI library for Lua scripts / Theory Helper / Radial Menu / Donate / ReaPack
Lokasenna is online now   Reply With Quote
Old 01-08-2019, 11:14 AM   #391
Tobbe
Human being with feelings
 
Join Date: Sep 2009
Location: Backe, Jämtland, Sweden
Posts: 175
Default

Hi,

Is it possible to make a GUI for these simulators https://forum.cockos.com/showthread.php?t=215161 with your GUI Library? Would be awesome to learn it

Rock On!
__________________
OS: Linux Mint Debian, Reaper For Linux, HoRNet VST Plugin, Amplesound Bass & Acoustic (Free) and many other free stuff. Behringer U-PHORIA UMC22.
Tobbe is offline   Reply With Quote
Old Yesterday, 09:45 PM   #392
Lokasenna
Human being with feelings
 
Lokasenna's Avatar
 
Join Date: Sep 2008
Location: The vast, frozen wasteland of western Canadia.
Posts: 5,560
Default

My GUI is unfortunately limited to Lua scripts, so no.
__________________
Currently enrolled in a coding bootcamp; don't expect timely responses from me.
Default 5.0 Nitpicky Edition / GUI tutorial for Lua / GUI library for Lua scripts / Theory Helper / Radial Menu / Donate / ReaPack
Lokasenna 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 05:11 PM.


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