Old 04-10-2018, 08:11 AM   #81
Lokasenna
Human being with feelings
 
Lokasenna's Avatar
 
Join Date: Sep 2008
Location: The vast, frozen wasteland of western Canadia.
Posts: 5,553
Default

Quote:
Originally Posted by X-Raym View Post
OK !

Text input are very inspiring, I have still few ideas left (but I dont want to spam you with all of them :P)
No worries. The lack of spare time we spoke about previously is... no longer a problem. :/

Quote:
have an horizontal bar when a line is too long
On the list, and should be easy. I originally had one but took it out to make things easier until I got the basic editor working.

I'd really like to add word-wrapping too, but I can't figure out how to keep track of where the caret/selection is in the wrapped text vs. the original table.

Quote:
it doesn't scroll if click drag select a line longer than the view (nor to the left, nor the right).
Also on the list, not sure of the best way to do 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 offline   Reply With Quote
Old 04-10-2018, 08:47 AM   #82
X-Raym
Human being with feelings
 
X-Raym's Avatar
 
Join Date: Apr 2013
Location: France
Posts: 5,238
Default

Code:
The lack of spare time we spoke about previously is... no longer a problem. :/
Hmmm... this doesn't looks like a total good news... :S

--
There is a word wrap algorythm in my tap tempo script but it doesn't take care carret into account it is just text display.


--
Other idea is to have CTRL+Z Undo possibilities... this would be really nice too :P

--
Thanks for your consideration !
X-Raym is offline   Reply With Quote
Old 04-10-2018, 10:21 AM   #83
Lokasenna
Human being with feelings
 
Lokasenna's Avatar
 
Join Date: Sep 2008
Location: The vast, frozen wasteland of western Canadia.
Posts: 5,553
Default

I have an algorithm for word wrap too, it's just the caret and selection that create a problem.

Undo/Redo are also (surprise!) on the list.
__________________
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 offline   Reply With Quote
Old 04-10-2018, 08:02 PM   #84
Lokasenna
Human being with feelings
 
Lokasenna's Avatar
 
Join Date: Sep 2008
Location: The vast, frozen wasteland of western Canadia.
Posts: 5,553
Default

Another update.

- Horizontal scrollbar
- Shift+wheel to scroll horizontally
- Undo/Redo

Note that Undo will sometimes save more than one state for each key command, since some functions call each other. But we're used to Reaper doing that anyway. :P
__________________
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 offline   Reply With Quote
Old 04-11-2018, 03:54 AM   #85
D Rocks
Human being with feelings
 
Join Date: Dec 2017
Location: Quebec, Canada
Posts: 432
Default

Very nice, thanks.

I begin to get used to your Radial Menu right now and it seems to be something I really like. I like to pop the menu up at mouse cursor its cool man. Good job.

The next Ill try is your Theory Helper. Seems to replace what Im used to in Cubase "chord assistant". Did you learn coding yourself or you had school?
__________________
Alex | www.drocksrecords.com | Thanks for REAPER
D Rocks is offline   Reply With Quote
Old 04-11-2018, 04:22 AM   #86
X-Raym
Human being with feelings
 
X-Raym's Avatar
 
Join Date: Apr 2013
Location: France
Posts: 5,238
Default

It's getting really serious !! :P

Small error with copy pasting empty lines:



As you can see, it creates three empty lines instead of one.

Good luck ! ^^
X-Raym is offline   Reply With Quote
Old 04-11-2018, 05:27 AM   #87
Lokasenna
Human being with feelings
 
Lokasenna's Avatar
 
Join Date: Sep 2008
Location: The vast, frozen wasteland of western Canadia.
Posts: 5,553
Default

Quote:
Originally Posted by X-Raym View Post
It's getting really serious !! :P

Small error with copy pasting empty lines:

As you can see, it creates three empty lines instead of one.

Good luck ! ^^
Strange. It's just taking the input string and running string:gmatch("([^\r\n]*)[\r\n]?").
__________________
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 offline   Reply With Quote
Old 04-11-2018, 05:29 AM   #88
Lokasenna
Human being with feelings
 
Lokasenna's Avatar
 
Join Date: Sep 2008
Location: The vast, frozen wasteland of western Canadia.
Posts: 5,553
Default

Quote:
Originally Posted by D Rocks View Post
Very nice, thanks.

I begin to get used to your Radial Menu right now and it seems to be something I really like. I like to pop the menu up at mouse cursor its cool man. Good job.

The next Ill try is your Theory Helper. Seems to replace what Im used to in Cubase "chord assistant". Did you learn coding yourself or you had school?
Cheers.

I took a lot of summer courses when I was a kid, learning things like Pascal and Visual Basic. I've had to teach myself Lua, though there are a lot of great resources on the internet for 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 offline   Reply With Quote
Old 04-11-2018, 07:50 AM   #89
Lokasenna
Human being with feelings
 
Lokasenna's Avatar
 
Join Date: Sep 2008
Location: The vast, frozen wasteland of western Canadia.
Posts: 5,553
Default

Updated with a better string pattern (cheers @cfillion), should fix the pasting issue above.
__________________
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 offline   Reply With Quote
Old 04-11-2018, 01:06 PM   #90
X-Raym
Human being with feelings
 
X-Raym's Avatar
 
Join Date: Apr 2013
Location: France
Posts: 5,238
Default

@lokanesa
For some obscure reason, CTRL+ALT (or alt gr) + 9 (to make "]" ) instantly kill the script without error message.

I checked and it is not associated with one of my keyboard.
X-Raym is offline   Reply With Quote
Old 04-11-2018, 03:57 PM   #91
X-Raym
Human being with feelings
 
X-Raym's Avatar
 
Join Date: Apr 2013
Location: France
Posts: 5,238
Default

Another bug reports:

It seems that tab character, from copy pasted text or from keypress, isn't visually displayed:



Tab support could be very useful is you copy paste cells froms a spreasheet (or edit code/chunk).
X-Raym is offline   Reply With Quote
Old 04-13-2018, 06:35 AM   #92
Lokasenna
Human being with feelings
 
Lokasenna's Avatar
 
Join Date: Sep 2008
Location: The vast, frozen wasteland of western Canadia.
Posts: 5,553
Default

Another library update, nothing too exciting.

- Added .undo_limit as an accessible parameter for the TextEditor. Defaults to 20 undo states.

- Added a "developer mode", accessible with Ctrl+Shift+Alt+Z. All it does right now is overlay a grid to help with placing elements, but suggestions are welcome.

- GUI.New() now returns the created element's name. In theory you could create a group of elements within a table, the table would end up containing all of their names, and you could use that to i.e. rewrite all of their nmousedown() methods with one loop.

- Menubox now has 'noarrow' as an optional flag at creation. Removes the arrow from the box, so it's just a pretty rectangle.

- Added a template to the Classes folder.
__________________
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 offline   Reply With Quote
Old 04-15-2018, 10:41 PM   #93
woodslanding
Human being with feelings
 
woodslanding's Avatar
 
Join Date: Mar 2007
Location: Denver, CO
Posts: 246
Default Support for Knobman-type pngs on knobs?

This library is awesome, and I can't believe how much great functionality is here!

Just wondering if there is any support for film-strip type graphics on knobs, like those generated by knobman... I like using them in Reaktor and other such programs. It would be a nice addition to this library.

Hey, if someone gives you the sun for free, why not ask for the moon while you're at it


cheers,
-eric
__________________
e moon
http://ericmoonmusic.com
>>{ Very Stable Genius }<<
woodslanding is offline   Reply With Quote
Old 04-16-2018, 07:01 AM   #94
Lokasenna
Human being with feelings
 
Lokasenna's Avatar
 
Join Date: Sep 2008
Location: The vast, frozen wasteland of western Canadia.
Posts: 5,553
Default

Not natively, but you could write your own class for it. The library has a few features to help with storing them in a buffer so they're ready to go, and my GUI tutorial (see my signature) has a post on images with a few helpful functions as well: https://forum.cockos.com/showpost.ph...1&postcount=61
__________________
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

Last edited by Lokasenna; 04-16-2018 at 07:24 AM.
Lokasenna is offline   Reply With Quote
Old 04-22-2018, 09:06 AM   #95
Lokasenna
Human being with feelings
 
Lokasenna's Avatar
 
Join Date: Sep 2008
Location: The vast, frozen wasteland of western Canadia.
Posts: 5,553
Default

Update.

I went through all of the classes and did a ton of cleaning, organizing, efficientization, etc.

Features + fixes:

Menubox: Added .align parameter.

Textbox: Brought over a bunch of code from TextEditor. Now supports longer text, copy/paste, the usual shortcut keys, etc.

Slider: Heavily rewritten, makes better use of blitting.

Radio: Improved click accuracy, fixed issues with .swap displaying text outside the frame.

Checklist: See ^.

Label: :fade now supports fading in when called with a negative curve value.

Frame: Uses blitting instead of drawing everything every time.
__________________
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 offline   Reply With Quote
Old 04-25-2018, 07:53 PM   #96
Lokasenna
Human being with feelings
 
Lokasenna's Avatar
 
Join Date: Sep 2008
Location: The vast, frozen wasteland of western Canadia.
Posts: 5,553
Default

Update.

- Added a basic crash reporter to GUI.Main. As far as I can tell it doesn't impact performance, but I can always add a toggle if it does.

- Moved the library to my own repository: https://github.com/jalovatt/Lokasenna_GUI so I don't feel as bad about constantly shuffling things around in it.

- Added a bunch of documentation to my repository's wiki.
__________________
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 offline   Reply With Quote
Old 04-26-2018, 04:45 AM   #97
MusoBob
Human being with feelings
 
Join Date: Sep 2014
Posts: 415
Default

I'm just trying to move all my floating toolbar action buttons into the GUI.
I don't want to use the existing images only the GUI buttons but I need a lot of different colors
that need to be the same color as the action buttons.
Is there a limit of usable colors or can I use any color for the buttons ?
MusoBob is offline   Reply With Quote
Old 04-26-2018, 06:34 AM   #98
Lokasenna
Human being with feelings
 
Lokasenna's Avatar
 
Join Date: Sep 2008
Location: The vast, frozen wasteland of western Canadia.
Posts: 5,553
Default

By default it only has ~20 colors defined, but you can add as many as you want to that. You can also give it color values directly without defining a preset for them, if you prefer.

https://github.com/jalovatt/Lokasenn...nts-and-colors
__________________
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 offline   Reply With Quote
Old 04-26-2018, 07:23 AM   #99
snooks
Human being with feelings
 
Join Date: Sep 2015
Posts: 1,567
Default

Great work on this and the docs. Thanks!

I'm going to give it a whirl with my new script. Is the GitHub repo cool to contribute to or are you still using a build system with other files?
snooks is offline   Reply With Quote
Old 04-26-2018, 07:32 AM   #100
Lokasenna
Human being with feelings
 
Lokasenna's Avatar
 
Join Date: Sep 2008
Location: The vast, frozen wasteland of western Canadia.
Posts: 5,553
Default

I'm very much a noob when it comes to Git - not sure what you mean about a build system.

Contributions are more than welcome, but I may end up shuffling the file structure around, etc.
__________________
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 offline   Reply With Quote
Old 04-26-2018, 07:39 AM   #101
snooks
Human being with feelings
 
Join Date: Sep 2015
Posts: 1,567
Default

No, not Git related - I think I'm getting mixed up and thinking about the tool you wrote that amalgamates these files into one. So your build tool/system uses this structure and not the other way around IIRC now?

I'll have a good explore of it over the next while!
snooks is offline   Reply With Quote
Old 04-26-2018, 07:43 AM   #102
Lokasenna
Human being with feelings
 
Lokasenna's Avatar
 
Join Date: Sep 2008
Location: The vast, frozen wasteland of western Canadia.
Posts: 5,553
Default

Script Compiler isn't specific to the GUI library - it just for specially-formatted library calls in a script and pastes the contents of the library in so you only have one file to distribute.

I've actually got a big overhaul for it on my to-do list, in fact.
__________________
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 offline   Reply With Quote
Old 04-26-2018, 02:46 PM   #103
MusoBob
Human being with feelings
 
Join Date: Sep 2014
Posts: 415
Default

Perfect, thanks again !
MusoBob is offline   Reply With Quote
Old 04-27-2018, 02:12 AM   #104
MusoBob
Human being with feelings
 
Join Date: Sep 2014
Posts: 415
Default

What the easiest way to get the actual chosen value of my_opt2 in the radio ? e.g C#

Code:
GUI.New("my_opt2",     "Radio",          5, 32, 364, 384, 64, "Keys", "A,A#,B,C,C#,D,D#,E,F,F#,G,G#", "h", 4)
MusoBob is offline   Reply With Quote
Old 04-27-2018, 04:54 AM   #105
snooks
Human being with feelings
 
Join Date: Sep 2015
Posts: 1,567
Default

You just...

Code:
local number = GUI.Val("my_opt2")
https://github.com/jalovatt/Lokasenn...-Options-class

If you want to translate that to a string then you can store the note names in a table...
Code:
local note_names = { [1] = "A", [2] = "Bb"..... }

local selected_note = note_names[number]
snooks is offline   Reply With Quote
Old 04-27-2018, 06:31 AM   #106
Lokasenna
Human being with feelings
 
Lokasenna's Avatar
 
Join Date: Sep 2008
Location: The vast, frozen wasteland of western Canadia.
Posts: 5,553
Default

Quote:
Originally Posted by snooks View Post
If you want to translate that to a string then you can store the note names in a table...
Code:
local note_names = { [1] = "A", [2] = "Bb"..... }

local selected_note = note_names[number]
You can also read from the Radio element's option array:

Code:
local val = GUI.Val("my_opt2")
local name = GUI.elms.my_opt2.optarray[val]
or

Code:
local name = GUI.elms.my_opt2.optarray[ GUI.Val("my_opt2") ]
I can look at making some of the :Val methods return both a number and the associated string.
__________________
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 offline   Reply With Quote
Old 04-27-2018, 11:33 AM   #107
MusoBob
Human being with feelings
 
Join Date: Sep 2014
Posts: 415
Default

Code:
local name = GUI.elms.my_opt2.optarray[ GUI.Val("my_opt2") ]
Perfect thanks.
MusoBob is offline   Reply With Quote
Old 04-28-2018, 09:55 PM   #108
MusoBob
Human being with feelings
 
Join Date: Sep 2014
Posts: 415
Default

What would be very useful is something like SmartGUI Creator , if I'm creating an AHK GUI I can open an existing script.ahk and I can drag the buttons/elements one at a time or move them all down a bit or over a bit in one go without having to re-type ALL the x,y's.
Maybe you could have a plugin for Notepad++ to add/subtract so much to the x and/or y's in the highlighted section of the script ???

MusoBob is offline   Reply With Quote
Old 04-29-2018, 05:49 AM   #109
Lokasenna
Human being with feelings
 
Lokasenna's Avatar
 
Join Date: Sep 2008
Location: The vast, frozen wasteland of western Canadia.
Posts: 5,553
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.
__________________
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 offline   Reply With Quote
Old 04-29-2018, 12:27 PM   #110
Lokasenna
Human being with feelings
 
Lokasenna's Avatar
 
Join Date: Sep 2008
Location: The vast, frozen wasteland of western Canadia.
Posts: 5,553
Default

Updated.

Added a Menubar class, along with some minor bug fixes.



https://github.com/jalovatt/Lokasenn...-Menubar-class
__________________
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 offline   Reply With Quote
Old 04-29-2018, 12:50 PM   #111
deeb
Human being with feelings
 
deeb's Avatar
 
Join Date: Feb 2017
Posts: 1,940
Default

cool cool! hugs!
deeb is offline   Reply With Quote
Old 04-29-2018, 03:28 PM   #112
MusoBob
Human being with feelings
 
Join Date: Sep 2014
Posts: 415
Default

Thanks, good thinkin' again 99 ! I should be able to use that for AHK also.

I just used

Code:
x1 = 10
y1 = 40

--Augmented Chords Buttons

GUI.New("lb_Aug",      "Label",           5, 740+x1, 220+y1, "Aug", true, 1)
GUI.New("chord_Aug",      "Button",           5, 736+x1, 255+y1, 85, 20, "aug", btn_click_aug)
GUI.New("chord_Aug7",      "Button",           5, 736+x1, 280+y1, 85, 20, "aug7", btn_click_aug7)
I will just add that now in the beginning to the different tab elements coordinate's, so X1 = 0 or X1 = 10 or X1 = -10

Last edited by MusoBob; 04-29-2018 at 03:40 PM.
MusoBob is offline   Reply With Quote
Old 05-05-2018, 07:21 PM   #113
mespotine
Human being with feelings
 
mespotine's Avatar
 
Join Date: May 2017
Location: Leipzig, Germany
Posts: 608
Default

Impressive work on your gui-lib, and the more you add, the more I'm stunned.

Is there a way to export/import the gui-table I created with your gui-lib? That would be quite cool, as that way, we could code some "GUI-presets", that can be (re-)used and altered.
I'm currently working on my own gui-lib, which shall include a GUI-editor, in which I would try to add editing-support for your gui-lib as well. But that would mean import and export, to make it easier to handle.

And beside of that, is there a way to find out, which gui-object-classes are available(especially 3rd party ones) and what the attributes of them are(size, text, etc)? This would be important for a gui-editor as well, as I could easily automatically add other added classes without having to hardcode them. That way, I could also check, whether a certain gui-class exists and communicate "missing class, can't build the gui" to the user.

Oh, and is there a function that returns the version of your gui-lib? When I write a script that needs the gui-lib, I would like to communicate to the user, if the installed version is the wrong and too old one.


And a question about the technicalities of the lib: how do you manage the blitting of the elements? My first gui-engine-prototype used a lot of ressources by too much drawing and I would love to go to blit instead. How do you manage to blit the stuff? Has every element having it's own screen-buffer? Do you even blit? Or do you something else? Is there a limit in how many elements are possible or is it flexible?


Just noticed: the link to your script-compiler in the first post is broken and going to a 404.
mespotine is offline   Reply With Quote
Old 05-05-2018, 07:53 PM   #114
Lokasenna
Human being with feelings
 
Lokasenna's Avatar
 
Join Date: Sep 2008
Location: The vast, frozen wasteland of western Canadia.
Posts: 5,553
Default

Quote:
Originally Posted by mespotine View Post
Is there a way to export/import the gui-table I created with your gui-lib?
Not natively. I found an awesome function to export tables from a script to a text file as proper Lua code, so loading them just requires executing that file, but I don't think it would work for classes with metatables and all that.

Quote:
I'm currently working on my own gui-lib, which shall include a GUI-editor, in which I would try to add editing-support for your gui-lib as well.
Great timing. This is what I've been working on this week: https://www.dropbox.com/s/lu6gdkp5uq...20wip.gif?dl=0



Quote:
And beside of that, is there a way to find out, which gui-object-classes are available(especially 3rd party ones) and what the attributes of them are(size, text, etc)?
Currently I'm only aware of my own classes, so the Project Wiki is your best bet.

Quote:
This would be important for a gui-editor as well, as I could easily automatically add other added classes without having to hardcode them.
With my GUI builder I've found that a certain amount of hardcoding is necessary, although it's pretty easy after the first couple of classes.

Quote:
That way, I could also check, whether a certain gui-class exists and communicate "missing class, can't build the gui" to the user.
Have a look at GUI.New in Core.lua - it does this and pops up an error message if the class wasn't loaded.

Quote:
Oh, and is there a function that returns the version of your gui-lib?
GUI.version, but I very rarely update the value in it.

-----------------------------------------

I have to put my kid to bed, will respond to the technical part in a little while.
__________________
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 offline   Reply With Quote
Old 05-05-2018, 08:16 PM   #115
MusoBob
Human being with feelings
 
Join Date: Sep 2014
Posts: 415
Default

The GUI is coming together really well, I have 20 tabs with a lot of buttons on each, I only have a few more tabs to do but it's seems to have a limitation on the amount of buttons, when I try to add another button the camel's back seems to break:

Class - Button.lua:84: bad argument #3 to '__newindex' (number expected, got table)

and I get just a gray background.

I'm using Example - General demonstration.lua Lokasenna_GUI 2.0 preview

If I use the latest release without adding the extra button all I get is just a gray background also.

I changed:
Code:
-- For better cross-platform behavior.
local sep = GUI.file_sep

req("Classes"..sep.."Class - Label.lua")()
req("Classes"..sep.."Class - Knob.lua")()
req("Classes"..sep.."Class - Tabs.lua")()
req("Classes"..sep.."Class - Slider.lua")()
req("Classes"..sep.."Class - Button.lua")()
req("Classes"..sep.."Class - Menubox.lua")()
req("Classes"..sep.."Class - Checklist.lua")()
req("Classes"..sep.."Class - Radio.lua")()
req("Classes"..sep.."Class - Textbox.lua")()
req("Classes"..sep.."Class - Frame.lua")()
to
Code:
req("Classes/Class - Label.lua")()
req("Classes/Class - Knob.lua")()
req("Classes/Class - Tabs.lua")()
req("Classes/Class - Slider.lua")()
req("Classes/Class - Button.lua")()
req("Classes/Class - Menubox.lua")()
req("Classes/Class - Textbox.lua")()
req("Classes/Class - Frame.lua")()
req("Classes/Class - Options.lua")()
is there anything else I need to change ?
MusoBob is offline   Reply With Quote
Old 05-05-2018, 09:28 PM   #116
Lokasenna
Human being with feelings
 
Lokasenna's Avatar
 
Join Date: Sep 2008
Location: The vast, frozen wasteland of western Canadia.
Posts: 5,553
Default

There shouldn't be a limit to the number of buttons you can have AFAIK. Based on the error message you're getting I want to say the problem is in how you're creating it - it says you're giving it a table when it wants a number.

However, it sounds like you're using older versions of everything so I don't have a copy of the code to reference. My first advice would be to upgrade to the newest ones here - I've done a lot of bug fixing, improving efficiency, etc, and I don't think it should affect how you use them much at all.

Regarding the change with reqs, that won't affect anything.
__________________
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

Last edited by Lokasenna; 05-05-2018 at 09:37 PM.
Lokasenna is offline   Reply With Quote
Old 05-05-2018, 09:37 PM   #117
Lokasenna
Human being with feelings
 
Lokasenna's Avatar
 
Join Date: Sep 2008
Location: The vast, frozen wasteland of western Canadia.
Posts: 5,553
Default

Quote:
Originally Posted by mespotine View Post
And a question about the technicalities of the lib: how do you manage the blitting of the elements? My first gui-engine-prototype used a lot of ressources by too much drawing and I would love to go to blit instead. How do you manage to blit the stuff? Has every element having it's own screen-buffer? Do you even blit? Or do you something else? Is there a limit in how many elements are possible or is it flexible?
There's a lot going on, so you should definitely look through Core.lua - GUI.Main is what runs everything, so if you follow the logic through that it should answer a lot of questions.

- Every element gets its own buffer. Most of them draw their basic state to the buffer when the script starts, and then when they need to redraw they just blit it, draw some text on top, and then that gets copied to the main buffer.

- The script stores each z layer on a separate buffer, so only layers with a change are redrawn.

- Elements request a redraw for their layer in their input methods, so unless the user does something there's practically no redrawing to do.

Lua/Reaper might have an upper limit on how many variables or tables are allowed, but my library doesn't impose any limit on how many elements you can have. The elements and z layers can use up to 1023 buffers, although I don't think I've ever used more than 20 or 30.
__________________
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 offline   Reply With Quote
Old 05-05-2018, 10:27 PM   #118
NextLevel
Human being with feelings
 
Join Date: Dec 2014
Posts: 410
Default

Quote:
Originally Posted by Lokasenna View Post
Great timing. This is what I've been working on this week:
Wow Loka, that looks like it's coming along really great!
It would make constructing and layout of GUIs so much quicker.

I hope you plan or releasing it here? Definitely keeping my eye on this thread.

Cheers
NextLevel is offline   Reply With Quote
Old 05-06-2018, 08:47 AM   #119
Lokasenna
Human being with feelings
 
Lokasenna's Avatar
 
Join Date: Sep 2008
Location: The vast, frozen wasteland of western Canadia.
Posts: 5,553
Default

Quote:
Originally Posted by NextLevel View Post
Wow Loka, that looks like it's coming along really great!
It would make constructing and layout of GUIs so much quicker.

I hope you plan or releasing it here? Definitely keeping my eye on this thread.

Cheers
Absolutely. I might be able to have a rough version out in the next week or two.
__________________
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 offline   Reply With Quote
Old 05-06-2018, 08:00 PM   #120
MusoBob
Human being with feelings
 
Join Date: Sep 2014
Posts: 415
Default

Rather than having so many chord buttons as you say for the different keys/scales I added 2 radios,
I will use a table as snooks suggested for each chord set

[/CODE]
Code:
C, Dm, Em, F, G, Am, Bdim, CMaj7, Dm7, Em7, FMaj7, G7, Am7, Bm7b5
I just need it to refresh when the radios are changed so the label and button chord names will change, I couldn't see how the Chord Theory Helper did that.
Thanks.
Attached Images
File Type: png Chords-Key-Scale-400.png (41.1 KB, 10 views)
MusoBob 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 04:45 PM.


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