grid view - JamJar00/JUI GitHub Wiki

The Grid View is one of three menus in JUI. It acts similar to Java Swing's GridLayout and allows you much more flexibility in placing components.

Usage

To add a Grid View add

gridview_t view;
view = gridview_create(xCount, yCount, component_count, grid_components);

gridview_draw(&view);

gridview_select(&view, 0);

gridview_run(&view);

Reference

gridview_create creates the gridview_t structure given the width of the grid, height of the grid, number of components and pointer to the Grid View components.

gridview_draw clears and draws the view on the screen, if you need to redraw at any point then you can just call this again.

gridview_place creates a Grid View component from a standard component by specifying the x and y coordinates and the width and height (in columns and rows) the component should span.

gridview_select moves the selection cursor to the position specified, if you don't call this the cursor will not be show until the user moves the selection.

gridview_scroll moves the selection cursor by a specified amount forward (positive values) or backward (negative values).

gridview_up moves the selection cursor up one component.

gridview_down moves the selection cursor down one component.

gridview_right moves the selection cursor right one component.

gridview_left moves the selection cursor left one component.

gridview_run enters the main loop for the icon menu and does not return.

⚠️ **GitHub.com Fallback** ⚠️