Tablemode viewport
-
Sounds useful, tell me more
Also what's the new automation object thingy for?
-
@d-healey You can make tables with multiple columns (just like the macro edit table or midi automation table).
You define the columns with a JSON object and then populate the rows with another object.
I've written some docs, but I still need to work on it before the API stabilizes, but this will be the goto solution for all browsers or dynamic tables.
-
@Christoph-Hart Excellent!
-
@d-healey I've pushed the docs for the functions, but I need to build the docs before they show up in the official docs:
-
And here's an example how to use those functions:
const var Viewport1 = Content.getComponent("Viewport1"); // Enable Table mode Viewport1.setTableMode({ "RowHeight": 24 }); // Set the column layout Viewport1.setTableColumns([ { "ID": "FirstID", "Label": "First Column", "Type": "Text", "Width":200 }, { "ID": "SecondID", "Label": "Buttonz", "Type": "Button", "Text": "OK", "Toggle": true, "Width": 60 }, { "ID": "ThirdID", "Type": "Slider", "MaxValue": 5.0, "StepSize": 1.0, "Width": 80 }]); // Populate the table with some data // (this call can be called anytime) Viewport1.setTableRowData([ { "FirstID": "Some Text", "SecondID": true, "ThirdID": 3.0 }, { "FirstID": "Some other Text", "SecondID": false, "ThirdID": 1.0 }, { "FirstID": "Last line!", "SecondID": true, "ThirdID": 4.0 } ]); inline function onTableCallback(obj) { Console.print(trace(obj)); if(obj.Type == "Click") { Console.print("Clicked on " + obj.rowIndex); } }; Viewport1.setTableCallback(onTableCallback);
-
can I say this?
Viewport1.setTableColumns([ { "ID": "FirstID", "Label": "First Column", "Type": "Panel", "Width":200 },
I assume this would then populate the Panel.value, and I can use my own redraw callback...
-
@Lindon Nope, only Buttons and Sliders are available at the moment - I might add ComboBoxes and Images, but Panels are too heavyweight for this - then we're back in child-panel nightmare-land
You can skin the buttons and sliders with look and feel though so you can get pretty far.
-
This is a really cool feature. I have no idea what I'll use it for yet but I'm sure it will come in handy. Thanks!
-
@d-healey It's prime use case is for custom preset / samplemap browsers but it could also be used for modulation matrix editors etc.
Maybe your downloader app could also benefit from this.
-
@Christoph-Hart said in Tablemode viewport:
Maybe your downloader app could also benefit from this.
Are you thinking of the product grid?
That might be a use case but I'd need to be able to draw images and probably make the images clickable. I think I'd still need the panels for the download progress.
-
@Christoph-Hart ah great timing! Was hoping for something like this
Can clicking a line in the left column change what's visible in the right hand column for example?