GuideUsing the current demo layouts:The current layouts use the G19’s LCD cursor keys for movement, the Ok button to select an item and the “back” button to activate the cursor (if required). In the non-menu layout, the “Menu” button will open the menu layout, whilst in the menu layout itself the pressing the “Menu” button will reselect the last layout you were in, allowing you to jump back to it. One of the layouts has no keys (tabs) an instead provides an example of creating an auto-cycling layout.
Tabbed or Page LayoutsTo create a typical page layout, the plugin needs several keys: up to four cursor directions are always required, and two other buttons – one which "activates" the plugin enabling you to move the cursor and highlight boxes and one to "select" a box which then sends a page-change command – are optional depending on the desired behaviour.
Creating a page layout takes a few steps:
- Begin by adding a cursor controller
- Change the controller's boundries to 1,1,2,2 - this will create a square, 2 cells wide by 2 cells long.
- Define keys for up/down/left/right - I strongly suggest the g19's lcd cursor keys
- Now define keys for Select & Enable commands - I would suggest the g19's "Ok" and "cancel" keys respectively.
- Now add four Cursor Rectangles, one in each corner of the screen. Make sure they're large enough to see easily but leave a reasonable amount of space free in the center - we'll need that in a moment. Set the top right box's Coordinate value to 2,1 then the bottom left to 1,2 and the bottom right to 2,2
- Now test the cursor movement - you should be able to move between the four boxes and select them at will. Make sure you put the cursor back to the top left corner before you continue.
- Now add a cursor page; position it in the center, taking up as much of the space as is free. It's coordinate should already be at 1,1.
- Repeat this 3 more times - position each page first, exactly the same as the first page, and then set the coordinates to 1,2 then 2,1 and finally 2,2. Each page will disappear after you change the coordinates.
- Now add an object or two to the first page. Make sure they're listed as children of the page in the "Instances" tree to the right of the editing window.
- You can now select a different box (e.g. 2,1) and the objects you added will disappear. Notice the change in instances tree: the first page is now listed in silver showing that the page is now invisible, and whichever page you selected is now black, showing that it is now visible instead. Select 1,1 again and this will revert back, revealing the objects you added to the first page again.
- By selected each page in turn you can add additional objects to each page - consider selecting a theme for each page and try to create one to show the weather, one to show the date & time, one to show an rss feed and one some cpu graphs.
Congratulations: you now have a layout with multiple pages!
Menu LayoutsMenu layouts are very simple to create:
- As above, you will need to add a cursor controller and some rectangles and configure the boundries and coordinates.
- You will probably want to set the Cursor Mode to “Move & Select / Deselect Only” for a menu. More advanced things can be done with the other cursor types, but this is by far the most simple method to understand when creating your first menu layout.
- Now, to make the menu work you need only select a rectangle, tick the “Layout Trigger” field and specify the desired layout file to load.
- Make sure you save your layout before you test it, then select a rectangle with the cursor and press select
You have a working menu!
But Wait! What’s that you say? The menu’s great but you can’t get back to it from your other layout? Ok, that’s very easy to fix:
- In each “child” layout, that is each layout that will be opened by the menu, add a Quick Action object
- Bind a key to the quick action object (e.g. the “Menu” key from the G19’s lcd keys) and select the menu layout file
- Save your layout
Now pressing that key will load the menu, giving you complete navigation between your layouts.
You can also enable the “Persistent Selection” option (you’ll have to specify a text file to save the cursor’s location to; do not enable the auto-reselect option). After saving the menu layout again move to a child layout and back again and you’ll see the cursor begins at your last choice instead of at the “1,1” coordinate making the menu seamless.