vg4->dialog->windowsize()
Open a canvas-dialog for resizing the window.
SYNTAX
VG_BOOL
vg4->dialog->windowsize(const char *cvasdir,
const struct VG_Position *posdst,
struct VG_Hash *hvar)
FUNCTION PARAMETERS
cvasdir | Directory to load canvasses from, or NULL = use system-canvasses |
posdst | Canvas-position on window, or NULL = centered |
hvar | Hash with variable-values (see vg4->canvas->load()) |
RETURN VALUE
Returns boolean:
- VG_TRUE: OK
- VG_FALSE: Got exit-request
DESCRIPTION
Open a canvas-dialog for resizing the window.
This function uses following canvas-file (installed below share/vgagames4/canvas/)
- windowsize.top.cvas: Top-canvas
The parameter hvar should contain following variables
- key: top:title
value: title of top-canvas
If own canvas-files shall be used instead of the system-canvas-files,
they must lay in cvasdir or cvasdir/windowsize/
and have the same names as the system-canvas-files:
- windowsize.top.cvas
- uses canvas-items:
- [CV-TEXT] with name title: text for title
- [CV-BUTTON] with name done: for returning
- [CV-BUTTON] with name resize-none: for resizing to VG_WINDOW_SCALE_NONE
- [CV-BUTTON] with name resize-best: for resizing to VG_WINDOW_SCALE_BEST
- [CV-BUTTON] with name resize-max: for resizing to VG_WINDOW_SCALE_MAX
- [CV-BUTTON] with name resize-full: for resizing to VG_WINDOW_SCALE_FULL
- [CV-SWITCH] with name scale-nearest: set image-scaling: on=nearest, off=linear
- [CV-SWITCH] with name scale-integer: set window-scaling: on=integer, off=float
- uses variables:
- key: title
value: title of canvas
EXAMPLE
struct VG_Hash *hvar; hvar = vg4->hash->create(); /* set variables */ vg4->hash->setstr(hvar, "top:title", "Resize window"); /* execute dialog */ if (!vg4->dialog->windowsize(NULL, NULL, hvar)) { /* exit request */ VG_dest(); exit(0); } vg4->hash->destroy(hvar);