version 2.8
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   FALSE
 Should window manager support be included. More...
 
#define GWIN_NEED_CONTAINERS   FALSE
 Should the widget hierarchy be included. This provides parent-child features. More...
 
#define GWIN_NEED_WIDGET   FALSE
 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   FALSE
 Should the simple container be included. More...
 
#define GWIN_NEED_FRAME   FALSE
 Should the frame widget be included. More...
 
#define GWIN_NEED_CONSOLE   FALSE
 Should console functions be included. More...
 
#define GWIN_NEED_GRAPH   FALSE
 Should graph functions be included. More...
 
#define GWIN_NEED_GL3D   FALSE
 Should gl3d functions be included. More...
 
#define GWIN_NEED_BUTTON   FALSE
 Should button functions be included. More...
 
#define GWIN_NEED_PROGRESSBAR   FALSE
 Should progressbar functions be included. More...
 
#define GWIN_NEED_SLIDER   FALSE
 Should slider functions be included. More...
 
#define GWIN_NEED_CHECKBOX   FALSE
 Should checkbox functions be included. More...
 
#define GWIN_NEED_IMAGE   FALSE
 Should image functions be included. More...
 
#define GWIN_NEED_LABEL   FALSE
 Should label functions be included. More...
 
#define GWIN_NEED_RADIO   FALSE
 Should radio button functions be included. More...
 
#define GWIN_NEED_LIST   FALSE
 Should list widget functions be included. More...
 
#define GWIN_NEED_TABSET   FALSE
 Should tabset functions be included. More...
 
#define GWIN_NEED_KEYBOARD   FALSE
 Should the virtual keyboard be included. More...
 
#define GWIN_NEED_TEXTEDIT   FALSE
 Should the textedit widget be included. More...
 

GWIN Optional Parameters

#define GWIN_WIDGET_TAGS   FALSE
 Add a tag to each widget. More...
 
#define GWIN_FLAT_STYLING   FALSE
 Use flat styling for controls rather than a 3D look. More...
 
#define GWIN_REDRAW_IMMEDIATE   FALSE
 Don't use a timer for redrawing windows. More...
 
#define GWIN_REDRAW_SINGLEOP   FALSE
 Redraw all windows in a single operation. More...
 
#define GWIN_BUTTON_LAZY_RELEASE   FALSE
 Buttons should not insist the mouse is over the button on mouse release. More...
 
#define GWIN_CONSOLE_USE_HISTORY   FALSE
 Should the content of the console be saved for redrawing. More...
 
#define GWIN_CONSOLE_HISTORY_AVERAGING   FALSE
 Use font width averaging for the history buffer allocation. More...
 
#define GWIN_CONSOLE_HISTORY_ATCREATE   FALSE
 Should the history be turned on for all console windows when they are first created. More...
 
#define GWIN_CONSOLE_USE_FLOAT   FALSE
 Console Windows need floating point support in gwinPrintf. More...
 
#define GWIN_CONSOLE_ESCSEQ   FALSE
 Console windows support escape sequences to control display. More...
 
#define GWIN_CONSOLE_USE_BASESTREAM   FALSE
 Console Windows need BaseStreamSequential support (ChibiOS only) More...
 
#define GWIN_NEED_IMAGE_ANIMATION   FALSE
 Image windows can optionally support animated images. More...
 
#define GWIN_LABEL_ATTRIBUTE   FALSE
 Enable the API to use attributes in the label widget. More...
 
#define GWIN_NEED_LIST_IMAGES   FALSE
 Enable the API to use images in items in the list widget. More...
 
#define GWIN_PROGRESSBAR_AUTO   FALSE
 Enable the API to automatically increment the progressbar over time. More...
 
#define GWIN_SLIDER_NOSNAP   FALSE
 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   FALSE
 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 TRUE.

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

Macro Definition Documentation

#define GWIN_BUTTON_LAZY_RELEASE   FALSE

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

Defaults to FALSE

Definition at line 222 of file gwin_options.h.

#define GWIN_CONSOLE_ESCSEQ   FALSE

Console windows support escape sequences to control display.

Defaults to FALSE

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.

#define GWIN_CONSOLE_HISTORY_ATCREATE   FALSE

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

Defaults to FALSE

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.

#define GWIN_CONSOLE_HISTORY_AVERAGING   FALSE

Use font width averaging for the history buffer allocation.

Defaults to FALSE

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.

#define GWIN_CONSOLE_USE_BASESTREAM   FALSE

Console Windows need BaseStreamSequential support (ChibiOS only)

Defaults to FALSE

Note
To use the ChibiOS basestream functions such as chprintf() for printing in a console window you need to set this option to TRUE 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.

#define GWIN_CONSOLE_USE_FLOAT   FALSE

Console Windows need floating point support in gwinPrintf.

Defaults to FALSE

Definition at line 276 of file gwin_options.h.

#define GWIN_CONSOLE_USE_HISTORY   FALSE

Should the content of the console be saved for redrawing.

Defaults to FALSE

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.

#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.

#define GWIN_FLAT_STYLING   FALSE

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

Defaults to FALSE

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.

#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.

#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.

#define GWIN_LABEL_ATTRIBUTE   FALSE

Enable the API to use attributes in the label widget.

Defaults to FALSE

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.

#define GWIN_NEED_BUTTON   FALSE

Should button functions be included.

Defaults to FALSE

Definition at line 94 of file gwin_options.h.

#define GWIN_NEED_CHECKBOX   FALSE

Should checkbox functions be included.

Defaults to FALSE

Definition at line 115 of file gwin_options.h.

#define GWIN_NEED_CONSOLE   FALSE

Should console functions be included.

Defaults to FALSE

Definition at line 73 of file gwin_options.h.

#define GWIN_NEED_CONTAINER   FALSE

Should the simple container be included.

Defaults to FALSE

Definition at line 59 of file gwin_options.h.

#define GWIN_NEED_CONTAINERS   FALSE

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

Defaults to FALSE

Definition at line 38 of file gwin_options.h.

#define GWIN_NEED_FLASHING   FALSE

Should flashing of widgets be supported.

Defaults to FALSE

Precondition
Requires GWIN_NEED_WINDOWMANAGER to be TRUE

Definition at line 381 of file gwin_options.h.

#define GWIN_NEED_FRAME   FALSE

Should the frame widget be included.

Defaults to FALSE

Definition at line 66 of file gwin_options.h.

#define GWIN_NEED_GL3D   FALSE

Should gl3d functions be included.

Defaults to FALSE

Definition at line 87 of file gwin_options.h.

#define GWIN_NEED_GRAPH   FALSE

Should graph functions be included.

Defaults to FALSE

Definition at line 80 of file gwin_options.h.

#define GWIN_NEED_IMAGE   FALSE

Should image functions be included.

Defaults to FALSE

Definition at line 122 of file gwin_options.h.

#define GWIN_NEED_IMAGE_ANIMATION   FALSE

Image windows can optionally support animated images.

Defaults to FALSE

Definition at line 315 of file gwin_options.h.

#define GWIN_NEED_KEYBOARD   FALSE

Should the virtual keyboard be included.

Defaults to FALSE

Definition at line 157 of file gwin_options.h.

#define GWIN_NEED_KEYBOARD_ENGLISH1   TRUE

The default keyboard layout for the virtual gwin keyboard.

Defaults to VirtualKeyboardLayout_English1

Definition at line 409 of file gwin_options.h.

#define GWIN_NEED_LABEL   FALSE

Should label functions be included.

Defaults to FALSE

Definition at line 129 of file gwin_options.h.

#define GWIN_NEED_LIST   FALSE

Should list widget functions be included.

Defaults to FALSE

Definition at line 143 of file gwin_options.h.

#define GWIN_NEED_LIST_IMAGES   FALSE

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

Defaults to FALSE

Definition at line 331 of file gwin_options.h.

#define GWIN_NEED_PROGRESSBAR   FALSE

Should progressbar functions be included.

Defaults to FALSE

Definition at line 101 of file gwin_options.h.

#define GWIN_NEED_RADIO   FALSE

Should radio button functions be included.

Defaults to FALSE

Definition at line 136 of file gwin_options.h.

#define GWIN_NEED_SLIDER   FALSE

Should slider functions be included.

Defaults to FALSE

Definition at line 108 of file gwin_options.h.

#define GWIN_NEED_TABSET   FALSE

Should tabset functions be included.

Defaults to FALSE

Definition at line 150 of file gwin_options.h.

#define GWIN_NEED_TEXTEDIT   FALSE

Should the textedit widget be included.

Defaults to FALSE

Definition at line 164 of file gwin_options.h.

#define GWIN_NEED_WIDGET   FALSE

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

Defaults to FALSE

Definition at line 45 of file gwin_options.h.

#define GWIN_NEED_WINDOWMANAGER   FALSE

Should window manager support be included.

Defaults to FALSE

Definition at line 31 of file gwin_options.h.

#define GWIN_PROGRESSBAR_AUTO   FALSE

Enable the API to automatically increment the progressbar over time.

Defaults to FALSE

Definition at line 338 of file gwin_options.h.

#define GWIN_REDRAW_IMMEDIATE   FALSE

Don't use a timer for redrawing windows.

Defaults to FALSE

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 FALSE then this setting is ignored as redrawing always occurs immediately.

Definition at line 200 of file gwin_options.h.

#define GWIN_REDRAW_SINGLEOP   FALSE

Redraw all windows in a single operation.

Defaults to FALSE

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 FALSE. Everything always gets redrawn in a single operation if GWIN_REDRAW_IMMEDIATE is TRUE.

Definition at line 215 of file gwin_options.h.

#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.

#define GWIN_SLIDER_NOSNAP   FALSE

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

Defaults to FALSE

Note
If FALSE the slider will snap to the closest set-able position when the mouse is released. If TRUE 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.

#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.

#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.

#define GWIN_WIDGET_TAGS   FALSE

Add a tag to each widget.

Defaults to FALSE

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.