µGFX  2.9
version 2.9
GWIN

Detailed Description

The GWIN module uses all the other modules (GDISP, GINPUT, GTIMER...) to form a complete GUI toolkit.

Modules

 Containers
 Containers are used to group together other windows and widgets.
 
 Widgets
 Widgets extend the Windows adding capabilities such as user input.
 
 Windows
 Windows are the most basic element in the GWIN module.
 

GWIN Functionality to be included

#define GWIN_NEED_WINDOWMANAGER   GFXOFF
 Should window manager support be included. More...
 
#define GWIN_NEED_CONTAINERS   GFXOFF
 Should the widget hierarchy be included. This provides parent-child features. More...
 
#define GWIN_NEED_WIDGET   GFXOFF
 Should widget functions be included. Needed for any widget (eg Buttons, Sliders etc) More...
 
#define GWIN_FOCUS_HIGHLIGHT_WIDTH   1
 The width of the rectangle that highlights a widget that is focused. More...
 
#define GWIN_NEED_CONTAINER   GFXOFF
 Should the simple container be included. More...
 
#define GWIN_NEED_FRAME   GFXOFF
 Should the frame widget be included. More...
 
#define GWIN_NEED_CONSOLE   GFXOFF
 Should console functions be included. More...
 
#define GWIN_NEED_GRAPH   GFXOFF
 Should graph functions be included. More...
 
#define GWIN_NEED_GL3D   GFXOFF
 Should gl3d functions be included. More...
 
#define GWIN_NEED_BUTTON   GFXOFF
 Should button functions be included. More...
 
#define GWIN_NEED_PROGRESSBAR   GFXOFF
 Should progressbar functions be included. More...
 
#define GWIN_NEED_SLIDER   GFXOFF
 Should slider functions be included. More...
 
#define GWIN_NEED_CHECKBOX   GFXOFF
 Should checkbox functions be included. More...
 
#define GWIN_NEED_IMAGE   GFXOFF
 Should image functions be included. More...
 
#define GWIN_NEED_LABEL   GFXOFF
 Should label functions be included. More...
 
#define GWIN_NEED_RADIO   GFXOFF
 Should radio button functions be included. More...
 
#define GWIN_NEED_LIST   GFXOFF
 Should list widget functions be included. More...
 
#define GWIN_NEED_TABSET   GFXOFF
 Should tabset functions be included. More...
 
#define GWIN_NEED_KEYBOARD   GFXOFF
 Should the virtual keyboard be included. More...
 
#define GWIN_NEED_TEXTEDIT   GFXOFF
 Should the textedit widget be included. More...
 

GWIN Optional Parameters

#define GWIN_WIDGET_TAGS   GFXOFF
 Add a tag to each widget. More...
 
#define GWIN_FLAT_STYLING   GFXOFF
 Use flat styling for controls rather than a 3D look. More...
 
#define GWIN_REDRAW_IMMEDIATE   GFXOFF
 Don't use a timer for redrawing windows. More...
 
#define GWIN_REDRAW_SINGLEOP   GFXOFF
 Redraw all windows in a single operation. More...
 
#define GWIN_BUTTON_LAZY_RELEASE   GFXOFF
 Buttons should not insist the mouse is over the button on mouse release. More...
 
#define GWIN_CONSOLE_USE_HISTORY   GFXOFF
 Should the content of the console be saved for redrawing. More...
 
#define GWIN_CONSOLE_HISTORY_AVERAGING   GFXOFF
 Use font width averaging for the history buffer allocation. More...
 
#define GWIN_CONSOLE_HISTORY_ATCREATE   GFXOFF
 Should the history be turned on for all console windows when they are first created. More...
 
#define GWIN_CONSOLE_USE_FLOAT   GFXOFF
 Console Windows need floating point support in gwinPrintf. More...
 
#define GWIN_CONSOLE_ESCSEQ   GFXOFF
 Console windows support escape sequences to control display. More...
 
#define GWIN_CONSOLE_USE_BASESTREAM   GFXOFF
 Console Windows need BaseStreamSequential support (ChibiOS only) More...
 
#define GWIN_NEED_IMAGE_ANIMATION   GFXOFF
 Image windows can optionally support animated images. More...
 
#define GWIN_LABEL_ATTRIBUTE   GFXOFF
 Enable the API to use attributes in the label widget. More...
 
#define GWIN_NEED_LIST_IMAGES   GFXOFF
 Enable the API to use images in items in the list widget. More...
 
#define GWIN_PROGRESSBAR_AUTO   GFXOFF
 Enable the API to automatically increment the progressbar over time. More...
 
#define GWIN_SLIDER_NOSNAP   GFXOFF
 Should the slider avoid snapping to a fixed position when the mouse is released. More...
 
#define GWIN_SLIDER_DEAD_BAND   5
 The number of pixels of dead-band at each end of the slider. More...
 
#define GWIN_SLIDER_TOGGLE_INC   20
 How many toggles it takes to go from minimum to maximum value on a slider. More...
 
#define GWIN_TABSET_TABHEIGHT   18
 The height in pixels of a row of tabs in a tabset. More...
 
#define GWIN_NEED_FLASHING   GFXOFF
 Should flashing of widgets be supported. More...
 
#define GWIN_FLASHING_PERIOD   250
 What is the period for the flashing timer. More...
 
#define GWIN_KEYBOARD_DEFAULT_LAYOUT   VirtualKeyboard_English1
 The default keyboard layout for the virtual gwin keyboard. More...
 

GWIN Virtual Keyboard Layouts

One or more of these may be defined. They will only be created if GWIN_NEED_KEYBOARD is GFXON.

#define GWIN_NEED_KEYBOARD_ENGLISH1   GFXON
 The default keyboard layout for the virtual gwin keyboard. More...
 

Macro Definition Documentation

◆ GWIN_BUTTON_LAZY_RELEASE

#define GWIN_BUTTON_LAZY_RELEASE   GFXOFF

Buttons should not insist the mouse is over the button on mouse release.

Defaults to GFXOFF

Definition at line 222 of file gwin_options.h.

◆ GWIN_CONSOLE_ESCSEQ

#define GWIN_CONSOLE_ESCSEQ   GFXOFF

Console windows support escape sequences to control display.

Defaults to GFXOFF

Note
Currently supported: ESC color Change subsequent text color color: "0" = black, "1" = red, "2" = green, "3" = yellow, "4" = blue, "5" = magenta, "6" = cyan, "7" = white ESC C Revert subsequent text color to the window default ESC u Turn on underline ESC U Turn off underline ESC b Turn on bold ESC B Turn off bold ESC J Clear the window

Definition at line 295 of file gwin_options.h.

◆ GWIN_CONSOLE_HISTORY_ATCREATE

#define GWIN_CONSOLE_HISTORY_ATCREATE   GFXOFF

Should the history be turned on for all console windows when they are first created.

Defaults to GFXOFF

Note
gwinConsoleSetBuffer() can be used to turn the history buffer off and on at any time.

Definition at line 269 of file gwin_options.h.

◆ GWIN_CONSOLE_HISTORY_AVERAGING

#define GWIN_CONSOLE_HISTORY_AVERAGING   GFXOFF

Use font width averaging for the history buffer allocation.

Defaults to GFXOFF

If this feature is enabled, the width one third of the way between the font's character width minimum and maximum will be used instead of the font's minimum width.

Note
This option reduces the memory allocation for a variable width font's history buffer. Note that strange redrawing and scrolling effects can occur if the buffer is too small to save a complete screen of data. The system tries to optimize storage so this may only be evident in very limited situations eg with a console with many characters in it.

Definition at line 260 of file gwin_options.h.

◆ GWIN_CONSOLE_USE_BASESTREAM

#define GWIN_CONSOLE_USE_BASESTREAM   GFXOFF

Console Windows need BaseStreamSequential support (ChibiOS only)

Defaults to GFXOFF

Note
To use the ChibiOS basestream functions such as chprintf() for printing in a console window you need to set this option to GFXON in your gfxconf.h and include in your application source file... #include "chprintf.h" In your makefile, as part of your list of C source files, include ${CHIBIOS}/os/various/chprintf.c

Definition at line 308 of file gwin_options.h.

◆ GWIN_CONSOLE_USE_FLOAT

#define GWIN_CONSOLE_USE_FLOAT   GFXOFF

Console Windows need floating point support in gwinPrintf.

Defaults to GFXOFF

Definition at line 276 of file gwin_options.h.

◆ GWIN_CONSOLE_USE_HISTORY

#define GWIN_CONSOLE_USE_HISTORY   GFXOFF

Should the content of the console be saved for redrawing.

Defaults to GFXOFF

If this feature is enabled, the contents of the console will be saved as it is written. If a redraw is required it will be redrawn from the history. Scrolling will also use the history buffer if it is turned on.

Note
Using this option allocates the amount of memory to store the history based on the minimum character width in the current font at the time the history is turned on. Using a fixed width font is a good idea to minimize memory usage.
If you change the size of the window or you change the font being displayed you should turn off the history and then turn it back on in order to get a new buffer of the correct size for the window/font combination. Strange redrawing and scrolling effects can occur if the buffer is too small to save a complete screen of data. Note the system tries to optimize storage so this may only be evident in very limited situations eg with a console with many characters in it.
gwinConsoleSetBuffer() can be used to turn the history buffer off and on.

Definition at line 244 of file gwin_options.h.

◆ GWIN_FLASHING_PERIOD

#define GWIN_FLASHING_PERIOD   250

What is the period for the flashing timer.

Defaults to 250 milliseconds

Definition at line 388 of file gwin_options.h.

◆ GWIN_FLAT_STYLING

#define GWIN_FLAT_STYLING   GFXOFF

Use flat styling for controls rather than a 3D look.

Defaults to GFXOFF

Note
This may appear better on color-restricted displays
Flat styling is less graphics and cpu intensive (marginally) than the default 3D look.

Definition at line 188 of file gwin_options.h.

◆ GWIN_FOCUS_HIGHLIGHT_WIDTH

#define GWIN_FOCUS_HIGHLIGHT_WIDTH   1

The width of the rectangle that highlights a widget that is focused.

Defaults to 1

Definition at line 52 of file gwin_options.h.

◆ GWIN_KEYBOARD_DEFAULT_LAYOUT

#define GWIN_KEYBOARD_DEFAULT_LAYOUT   VirtualKeyboard_English1

The default keyboard layout for the virtual gwin keyboard.

Defaults to VirtualKeyboardLayout_English1

Definition at line 395 of file gwin_options.h.

◆ GWIN_LABEL_ATTRIBUTE

#define GWIN_LABEL_ATTRIBUTE   GFXOFF

Enable the API to use attributes in the label widget.

Defaults to GFXOFF

Note
Using this feature is discouraged. The proper (and faster as well as more efficient) way is to use two separate labels.

Definition at line 324 of file gwin_options.h.

◆ GWIN_NEED_BUTTON

#define GWIN_NEED_BUTTON   GFXOFF

Should button functions be included.

Defaults to GFXOFF

Definition at line 94 of file gwin_options.h.

◆ GWIN_NEED_CHECKBOX

#define GWIN_NEED_CHECKBOX   GFXOFF

Should checkbox functions be included.

Defaults to GFXOFF

Definition at line 115 of file gwin_options.h.

◆ GWIN_NEED_CONSOLE

#define GWIN_NEED_CONSOLE   GFXOFF

Should console functions be included.

Defaults to GFXOFF

Definition at line 73 of file gwin_options.h.

◆ GWIN_NEED_CONTAINER

#define GWIN_NEED_CONTAINER   GFXOFF

Should the simple container be included.

Defaults to GFXOFF

Definition at line 59 of file gwin_options.h.

◆ GWIN_NEED_CONTAINERS

#define GWIN_NEED_CONTAINERS   GFXOFF

Should the widget hierarchy be included. This provides parent-child features.

Defaults to GFXOFF

Definition at line 38 of file gwin_options.h.

◆ GWIN_NEED_FLASHING

#define GWIN_NEED_FLASHING   GFXOFF

Should flashing of widgets be supported.

Defaults to GFXOFF

Precondition
Requires GWIN_NEED_WINDOWMANAGER to be GFXON

Definition at line 381 of file gwin_options.h.

◆ GWIN_NEED_FRAME

#define GWIN_NEED_FRAME   GFXOFF

Should the frame widget be included.

Defaults to GFXOFF

Definition at line 66 of file gwin_options.h.

◆ GWIN_NEED_GL3D

#define GWIN_NEED_GL3D   GFXOFF

Should gl3d functions be included.

Defaults to GFXOFF

Definition at line 87 of file gwin_options.h.

◆ GWIN_NEED_GRAPH

#define GWIN_NEED_GRAPH   GFXOFF

Should graph functions be included.

Defaults to GFXOFF

Definition at line 80 of file gwin_options.h.

◆ GWIN_NEED_IMAGE

#define GWIN_NEED_IMAGE   GFXOFF

Should image functions be included.

Defaults to GFXOFF

Definition at line 122 of file gwin_options.h.

◆ GWIN_NEED_IMAGE_ANIMATION

#define GWIN_NEED_IMAGE_ANIMATION   GFXOFF

Image windows can optionally support animated images.

Defaults to GFXOFF

Definition at line 315 of file gwin_options.h.

◆ GWIN_NEED_KEYBOARD

#define GWIN_NEED_KEYBOARD   GFXOFF

Should the virtual keyboard be included.

Defaults to GFXOFF

Definition at line 157 of file gwin_options.h.

◆ GWIN_NEED_KEYBOARD_ENGLISH1

#define GWIN_NEED_KEYBOARD_ENGLISH1   GFXON

The default keyboard layout for the virtual gwin keyboard.

Defaults to VirtualKeyboardLayout_English1

Definition at line 409 of file gwin_options.h.

◆ GWIN_NEED_LABEL

#define GWIN_NEED_LABEL   GFXOFF

Should label functions be included.

Defaults to GFXOFF

Definition at line 129 of file gwin_options.h.

◆ GWIN_NEED_LIST

#define GWIN_NEED_LIST   GFXOFF

Should list widget functions be included.

Defaults to GFXOFF

Definition at line 143 of file gwin_options.h.

◆ GWIN_NEED_LIST_IMAGES

#define GWIN_NEED_LIST_IMAGES   GFXOFF

Enable the API to use images in items in the list widget.

Defaults to GFXOFF

Definition at line 331 of file gwin_options.h.

◆ GWIN_NEED_PROGRESSBAR

#define GWIN_NEED_PROGRESSBAR   GFXOFF

Should progressbar functions be included.

Defaults to GFXOFF

Definition at line 101 of file gwin_options.h.

◆ GWIN_NEED_RADIO

#define GWIN_NEED_RADIO   GFXOFF

Should radio button functions be included.

Defaults to GFXOFF

Definition at line 136 of file gwin_options.h.

◆ GWIN_NEED_SLIDER

#define GWIN_NEED_SLIDER   GFXOFF

Should slider functions be included.

Defaults to GFXOFF

Definition at line 108 of file gwin_options.h.

◆ GWIN_NEED_TABSET

#define GWIN_NEED_TABSET   GFXOFF

Should tabset functions be included.

Defaults to GFXOFF

Definition at line 150 of file gwin_options.h.

◆ GWIN_NEED_TEXTEDIT

#define GWIN_NEED_TEXTEDIT   GFXOFF

Should the textedit widget be included.

Defaults to GFXOFF

Definition at line 164 of file gwin_options.h.

◆ GWIN_NEED_WIDGET

#define GWIN_NEED_WIDGET   GFXOFF

Should widget functions be included. Needed for any widget (eg Buttons, Sliders etc)

Defaults to GFXOFF

Definition at line 45 of file gwin_options.h.

◆ GWIN_NEED_WINDOWMANAGER

#define GWIN_NEED_WINDOWMANAGER   GFXOFF

Should window manager support be included.

Defaults to GFXOFF

Definition at line 31 of file gwin_options.h.

◆ GWIN_PROGRESSBAR_AUTO

#define GWIN_PROGRESSBAR_AUTO   GFXOFF

Enable the API to automatically increment the progressbar over time.

Defaults to GFXOFF

Definition at line 338 of file gwin_options.h.

◆ GWIN_REDRAW_IMMEDIATE

#define GWIN_REDRAW_IMMEDIATE   GFXOFF

Don't use a timer for redrawing windows.

Defaults to GFXOFF

Note
Normally windows and widgets are redrawn on a timer. Setting this option causes them to be redrawn immediately. Note that this can cause extended blocking times on events and saves little code.
If GWIN_NEED_WINDOWMANAGER is GFXOFF then this setting is ignored as redrawing always occurs immediately.

Definition at line 200 of file gwin_options.h.

◆ GWIN_REDRAW_SINGLEOP

#define GWIN_REDRAW_SINGLEOP   GFXOFF

Redraw all windows in a single operation.

Defaults to GFXOFF

Note
Windows are normally redraw one per gtimer cycle. Setting this option causes all windows to be redrawn in a single gtimer cycle. Note that this can cause extended blocking times on the timer thread but may speed up redraw slightly.
This is only relevant if GWIN_REDRAW_IMMEDIATE is GFXOFF. Everything always gets redrawn in a single operation if GWIN_REDRAW_IMMEDIATE is GFXON.

Definition at line 215 of file gwin_options.h.

◆ GWIN_SLIDER_DEAD_BAND

#define GWIN_SLIDER_DEAD_BAND   5

The number of pixels of dead-band at each end of the slider.

Defaults to 5

Note
A dead-band is required because fingers can often cannot accurately control the slider peg at the edges of the slider

Definition at line 357 of file gwin_options.h.

◆ GWIN_SLIDER_NOSNAP

#define GWIN_SLIDER_NOSNAP   GFXOFF

Should the slider avoid snapping to a fixed position when the mouse is released.

Defaults to GFXOFF

Note
If GFXOFF the slider will snap to the closest set-able position when the mouse is released. If GFXON it will maintain the position the mouse was released at, except when at the minimum and maximum slider values.

Definition at line 348 of file gwin_options.h.

◆ GWIN_SLIDER_TOGGLE_INC

#define GWIN_SLIDER_TOGGLE_INC   20

How many toggles it takes to go from minimum to maximum value on a slider.

Defaults to 20

Note
When the slider is being operated by a toggle device this setting describes how many toggles are required to go from end to end.

Definition at line 366 of file gwin_options.h.

◆ GWIN_TABSET_TABHEIGHT

#define GWIN_TABSET_TABHEIGHT   18

The height in pixels of a row of tabs in a tabset.

Defaults to 18

Definition at line 373 of file gwin_options.h.

◆ GWIN_WIDGET_TAGS

#define GWIN_WIDGET_TAGS   GFXOFF

Add a tag to each widget.

Defaults to GFXOFF

Note
Adds a tag member to each widget. Any events created include this tag. The enables switch based application logic to detect the event source.

Definition at line 179 of file gwin_options.h.