GFXprim
2D bitmap graphics library with emphasis on speed and correctness
|
A horizontal and vertical box widget. More...
#include <widgets/gp_widget_grid.h>
Go to the source code of this file.
Functions | |
static gp_widget * | gp_widget_hbox_new (unsigned int cols, enum gp_widget_grid_flags flags) |
Creates a hbox i.e. grid with single row. | |
static gp_widget * | gp_widget_vbox_new (unsigned int rows, enum gp_widget_grid_flags flags) |
Creates a vbox i.e. grid with single column. | |
gp_widget * | gp_widget_box_put (gp_widget *self, unsigned int pos, gp_widget *child) |
Puts a widget into a hbox or vbox. | |
gp_widget * | gp_widget_box_rem (gp_widget *self, unsigned int pos) |
Removes a widget from hbox or vbox. | |
A horizontal and vertical box widget.
Hbox and vbox widgets are one-dimensional gp_widget_grid.h widgets with rows=1, cols=1 respectively and with a simplified JSON attribute list.
The hbox is uniform, that means that both buttons have the same width, otherwise the button OK would be smaller as the button label is shorter.
The padd between the buttons is the only element that can grow, so it fills awailable space as the hbox grows.
The hbox is uniform, that means that both buttons have the same width, otherwise the button OK would be smaller as the button label is shorter.
The padd on the left is the only element that can grow, so it fills the available space as the hbox grows.
The hbox is uniform, that means that both buttons have the same width, otherwise the button OK would be smaller as the button label is shorter.
Both buttons have fill coeficient 4 and the space between them has fill coeficient 1. Available space is divided by 4:1:4.
Attribute | Type | Default | Description |
---|---|---|---|
border | string | all 1 | See gp_widget_grid.h |
cell-fill | string | cnt x 1 | Cell fill coeficients. |
padd-fill | string | (cnt+1) x 0 | Padding fill coeficients. |
padd | string | (cnt+1) x 1 | Padding sizes between cells. |
frame | bool | false | Draws a frame around the box. |
uniform | bool | false | All cells have the same size. |
widgets | array | Array of widget objects. |
Definition in file gp_widget_hvbox.h.
Puts a widget into a hbox or vbox.
self | A hbox or vbox widget. |
pos | A position to insert the child into, column for hbox and row for vbox. |
child | A child widget to insert. |
Removes a widget from hbox or vbox.
self | A hbox or vbox widget. |
pos | A position to remove the child from. |
|
inlinestatic |
Creates a hbox i.e. grid with single row.
cols | A number of columns in the box. |
flags | A bitwise combination of flags. |
Definition at line 80 of file gp_widget_hvbox.h.
References gp_widget_grid_new().
|
inlinestatic |
Creates a vbox i.e. grid with single column.
rows | A number of columns in the box. |
flags | A bitwise combination of flags. |
Definition at line 94 of file gp_widget_hvbox.h.
References gp_widget_grid_new().