jalovatt / scythe Goto Github PK
View Code? Open in Web Editor NEWLua GUI library and utility framework for Reaper scripts (formerly Lokasenna_GUI)
Home Page: https://jalovatt.github.io/scythe
License: MIT License
Lua GUI library and utility framework for Reaper scripts (formerly Lokasenna_GUI)
Home Page: https://jalovatt.github.io/scythe
License: MIT License
Just one window for now, but having a class should allow a lot of logic from Init
and the update functions to be moved out of Core.
Also: GUI.get_window_pos
, maybe the save/load ExtState functions as well.
Issues:
state
and last
Many scripts aren't really dockable without this, since a dock will never have the same dimensions as a hard-coded window.
May not be practical for something big like Theory Helper, in which case being able to define a minimal layout when docked might suffice.
Might need the JS extension?
i.e.
local myColors = {
main: "red",
}
Maybe just make "Caption" a shared class that implements a Label?
I expect that US and JS windows will have their own graphics API. Scripters should be isolated from this, so the GUI should be able to load different drawing modules that provide wrappers for gfx.rect
, gfx.drawstr
, etc.
Bugs:
To Do:
GB may be a little easier to implement this time since elements are now created with prop objects rather than multiple arguments. At the same time, handling layers might be more difficult because they're now actual reference values.
Ideas:
local guiStructure = {
windows: {
{
name: "Window Title",
layers: {
name: "Layer 1",
z: 2,
elements: {
{
name: "my_btn",
type: "Button",
x: 96,
...
}
...
}
...
}
...
}
Complete rebuild
IDEA
Basic Features:
Textbox pad should only adjust the caption. Add "cap_align" param for left, top, right, bottom?
Menubox displays !s and #s in values
Props aren't updated on recreate w/ dir change (w vs h)
Menubox allows scrolling to # values
Add checks to all properties to revert to last value on error
Add ref + function to allow adjusting the sidebar on window resize
Add global redraw flag to Core.lua
This should all be doable with GUI v2.9, just have to change the reqs and Ctrl+H some GUI function/var names to port it to v3.
This should also be doable with GUI v2.9 and similarly easy to port
GUI Builder GUI Builder.lua
Element functions func_Elements.lua
data_Elements.lua
Menus func_Menus.lua
File
New func_New.lua
Open project func_SaveLoad.lua
Save project func_SaveLoad.lua
Import from script func_Import.lua
Export to script func_Export.lua
Exit
View
Show grid func_View.lua
Snap to grid func_View.lua
Settings
Project Settings wnd_Project.lua
Preferences wnd_Prefs.lua
Tabs
Properties tab_Properties.lua
Layers tab_Layers.lua
In order to minimize coupling, and to enforce use of user-defined theming later, modules should expose as little of their functionality as possible.
For logic modules, this might mean anything that isn't a "top-level" function. For classes, this means anything that we don't specifically want scripts to mess with such as color and font settings.
Some elements may still need to expose their coloring and fonts, such as if a scripter wanted to have some sort of logo, but that should be an exception to the rule specifically provided by elements like Frame.
Can largely be pulled straight out of Radial.
Anything that repositions elements (the "flow" idea, etc) would need to be aware and update original positions as well where appropriate.
This one might be a bit difficult, both for the number of things that rely on the GUI state and not creating performance issues.
Ideas:
Have GUI require Buffer, wrap getBuffer and releaseBuffer, then expose them to elements (still requires Element dependency on GUI)
Move the app state into a separate module that Buffer can access without creating a circular dependency
Using the existing text measurement functionality (which could probably use an overhaul), Textbox should be able to do this. TextEditor might be able to as well, since we aren't currently worried about word wrapping.
This might require hiding a lot of the coloring functions from script devs, or at least limiting their choices.
Basic config script
Pull settings from ExtState
Write settings to ExtState
Extract colors and fonts to a default theme file
Add colors to Configuration
Add fonts to Configuration
Popup menu for selecting colors from the existing list?
Font validation lights.
doubleclickTime = 0.30
caretBlinkRate = 16
shadowSize = 1
tooltipTime = 0.7
colors = {
windowBg
tabBg
elmBg
elmFrame
elmFill
elmOutline
txt
shadow
faded
}
fonts = {
sans
mono
}
dev = {
gridMajor = 128,
gridMinor = 16
}
The GUI will need to be restructured so that an arbitrary number of windows can exist and be opened/closed/paused independently of each other.
As a first step, a new GUI-level Window class will be necessary. A Window:
Maybe not necessary if we're planning to take color options away from scripters.
"Can only contain numbers", "must be a valid email address", etc, etc.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.