Difference between revisions of "emWin Examples"
(→Window Manager) |
(→KEYBOARD widget) |
||
(One intermediate revision by the same user not shown) | |||
Line 284: | Line 284: | ||
|style="font-family: monospace,monospace; width: 25%;"| [[DROPDOWN - Usage (Sample)|DROPDOWN_Usage.c]] |
|style="font-family: monospace,monospace; width: 25%;"| [[DROPDOWN - Usage (Sample)|DROPDOWN_Usage.c]] |
||
|style="width: 75%;"|Usage of a DROPDOWN widget. |
|style="width: 75%;"|Usage of a DROPDOWN widget. |
||
+ | |- |
||
+ | |} |
||
+ | |||
+ | ==== EDIT widget ==== |
||
+ | |||
+ | {| class="wikitable" style="width: 80%;" |
||
+ | ! Name of example !! Description |
||
+ | |- |
||
+ | |style="font-family: monospace,monospace; width: 25%;"| [[Edit Custom KeyHandler (Sample)|EDIT_Custom_KeyHandler.c]] |
||
+ | |style="width: 75%;"|Demonstrates how a custom key handling function can be set to an EDIT which is useful for formatted strings. |
||
|- |
|- |
||
|} |
|} |
||
Line 341: | Line 351: | ||
! Name of example !! Description |
! Name of example !! Description |
||
|- |
|- |
||
− | |style="font-family: monospace,monospace; width: 25%;"| [[KEYBOARD - |
+ | |style="font-family: monospace,monospace; width: 25%;"| [[KEYBOARD - Advanced (Sample)|KEYBOARD_Advanced.c]] |
− | |style="width: 75%;"| |
+ | |style="width: 75%;"|Advanced usage of the KEYBOARD widget, demonstrating exporting and importing pattern and layout files to external memory. |
+ | |- |
||
+ | |style="font-family: monospace,monospace; width: 25%;"| [[KEYBOARD - Simple (Sample)|KEYBOARD_Simple.c]] |
||
+ | |style="width: 75%;"|Basic usage of a KEYBOARD widget using a predefined layout. |
||
|- |
|- |
||
|} |
|} |
Latest revision as of 12:21, 26 January 2023
The emWin examples have the purpose to explain and visualize emWin's features in a straight-forward and simplified way. Thus, most of these examples do not have elaborate graphics, but instead have code that is easy to read and understand.
Contents
- 1 How to use the examples
- 2 List of examples
- 2.1 2D graphic operations
- 2.2 Animations
- 2.3 Bitmaps and images
- 2.4 Fonts
- 2.5 Timers
- 2.6 MultiTouch
- 2.7 Dialogs
- 2.8 Language Support
- 2.9 Memory Devices
- 2.10 Movies
- 2.11 VNC
- 2.12 Widgets
- 2.12.1 General
- 2.12.2 BUTTON widget
- 2.12.3 CHECKBOX widget
- 2.12.4 DROPDOWN widget
- 2.12.5 EDIT widget
- 2.12.6 FRAMEWIN widget
- 2.12.7 GAUGE widget
- 2.12.8 GRAPH widget
- 2.12.9 ICONVIEW widget
- 2.12.10 KEYBOARD widget
- 2.12.11 LISTBOX widget
- 2.12.12 LISTVIEW widget
- 2.12.13 LISTWHEEL widget
- 2.12.14 MULTIPAGE widget
- 2.12.15 PROGBAR widget
- 2.12.16 RADIO widget
- 2.12.17 ROTARY widget
- 2.12.18 SCROLLER widget
- 2.12.19 SLIDER widget
- 2.12.20 SPINBOX widget
- 2.12.21 SWIPELIST widget
- 2.12.22 SWITCH widget
- 2.12.23 TREEVIEW widget
- 2.12.24 WHEEL widget
- 2.13 Window Manager
How to use the examples
The examples are ready-to-run and can be run on most hardware targets and in the Windows simulation. All of the examples are stand-alone, meaning only one C file is required to run the application, with the exception of examples that include file access to external files. For the latter type of examples, the external file referred to in the example is required as well.
File header
Every example file has a header at the beginning of the file. This header states the file name of the example, a small description about the example and how it should be used and a list of required emWin add-ons that are necessary to run the example.
File : GUI_VNC_FileTransfer.c Purpose : Sample that demonstrates how to use a VNC server with emWin and use it for file transfer. Requirements: WindowManager - ( ) MemoryDevices - ( ) AntiAliasing - ( ) VNC-Server - (x) PNG-Library - ( ) TrueTypeFonts - ( )
For example, the VNC server add-on is required for the VNC-related emWin examples.
List of examples
2D graphic operations
Name of example | Description |
---|---|
GUI_DIRTYDEVICE_Usage.c | Demonstrates how to use DIRTYDEVICES. A DIRTYDEVICE monitors the area on the screen that is 'dirty', meaning the area where screen changes happened. |
GUI_Polygon.c | Demonstrates how to draw polygons and what can be done with them. |
GUI_QRCode.c | Shows how to draw a QR code with emWin. |
GUI_SPLINE.c | Demonstrates how splines can be drawn with emWin. |
GUI_YUV_PixelData.c | Shows the usage of YUV devices in emWin. |
Animations
Name of example | Description |
---|---|
GUI_SimpleAnimation.c | Shows how to perform simple animations with emWin. This example shows the basic steps for creating an animation, such as creating and running it, adding animation items and using a delete callback routine. |
GUI_AdvancedAnimation.c | This example demonstrates how more advanced animations can be created with emWin. The advanced animation makes use of slice callbacks, custom position calculation and several animation items. |
Bitmaps and images
Name of example | Description |
---|---|
GUI_CreateBitmapFromStream.c | Creates and draws a streamed bitmap from an external .dta file. The example supports both the usage of Windows file system and emFile, if run on a target. |
GUI_DrawAnimatedGIFBin.c | Draws an animated GIF image after it has been converted into binary form using Bin2C. |
GUI_DrawAnimatedSprite.c | Draws an animated GIF image after it has been converted into an animated sprite using the Bitmap Converter. |
GUI_DrawExternalImage_BMP.c | Shows how to draw BMP images in emWin from external memory. Supports both the usage of Windows file system and emFile. |
GUI_DrawExternalImage_GIF.c | Shows how to draw GIF images in emWin from external memory. Supports both the usage of Windows file system and emFile. |
GUI_DrawExternalImage_JPG.c | Shows how to draw JPG images in emWin from external memory. Supports both the usage of Windows file system and emFile. |
GUI_DrawExternalImage_PNG.c | Shows how to draw PNG images in emWin from external memory. Supports both the usage of Windows file system and emFile. |
GUI_DrawStreamedBitmap.c | Demonstrates how streamed bitmaps can be drawn from external .dta files. Supports both the usage of Windows file system and emFile. |
GUI_SerializeBMP.c | Example that shows how screenshots can be created by serializing the LCD contents into a .bmp file. Supports both the usage of Windows file system and emFile. |
Fonts
Name of example | Description |
---|---|
GUI_SetExternalFont_TTF.c | Shows how to create a custom font from an external .ttf file. Supports both the usage of Windows file system and emFile. |
GUI_SetExternalFont_XBF.c | Shows how to create a custom font from an external .xbf file. Supports both the usage of Windows file system and emFile. |
GUI_SetFont_TTF.c | Shows how to create a custom font from a .ttf file located in accessible memory. |
Timers
Name of example | Description |
---|---|
GUI_Timers.c | Demonstrates how to use timers without the use of the WindowManager in emWin. |
MultiTouch
Name of example | Description |
---|---|
GUI_MultiTouch.c | Simple example on how to poll multiple touch points. |
Dialogs
Name of example | Description |
---|---|
CALENDAR_Usage.c | Demonstrates the usage of CALENDAR dialogs. |
CHOOSECOLOR_Usage.c | Demonstrates the usage of CHOOSECOLOR dialogs. |
CHOOSEFILE_Usage.c | Demonstrates the usage of CHOOSEFILE dialogs. |
DIALOG_CreateDialogs.c | Shows how custom dialogs can be created. |
GUI_Messagebox.c | Demonstrates the usage of MESSAGEBOX dialogs. |
Language Support
Name of example | Description |
---|---|
GUI_LANG_BiDiArabic.c | Demonstrates how arabic text can be displayed/used via bi-directional text support. |
GUI_LANG_Cyrillic.c | Demonstrates how cyrillic text can be displayed with UTF-8 support. |
GUI_LANG_ReadCSV.c | Shows how to read different languages from a .csv file that has been converted into binary form. |
GUI_LANG_ReadCSVEx.c | Shows how to read different languages from a .csv file that is located in external memory. Supports both the usage of Windows file system and emFile. |
GUI_LANG_Thai.c | Demonstrates how thai text can be displayed/used via thai text support. |
Memory Devices
Name of example | Description |
---|---|
GUI_MEMDEV_BlurringAndBlending.c | Shows how blurring and blending operations are done using memory devices. |
GUI_MEMDEV_Container.c | Shows how memory devices can be used as a container to pre-load JPEG images (or something else) to avoid flickering. |
GUI_MEMDEV_Fading.c | Demonstrates how a fading animation between two windows can be executed using memory devices. |
GUI_MEMDEV_Rotate.c | Shows how to rotate images using memory devices. |
GUI_MEMDEV_SerializeBMP.c | Shows how bitmap files can be created from the contents of a memory device. Supports both the usage of Windows file system and emFile. |
Movies
Name of example | Description |
---|---|
GUI_MOVIE_CreateMovie.c | Demonstrates how to display an emWin movie from accessable memory. |
GUI_MOVIE_CreateMovieEx.c | Demonstrates how to display an emWin movie from external memory. |
VNC
Name of example | Description |
---|---|
GUI_VNC_FileTransfer.c | Shows how to use a VNC server with emWin to transfer files. |
GUI_VNC_StartServer.c | Shows how to use a VNC server with emWin. |
Widgets
General
Name of example | Description |
---|---|
WIDGET_CustomScrollbar.c | Explains how the SCROLLBAR of a widget can be customized and manipulated. |
WIDGET_CustomCallback.c | Explains how the callback of a widget can be overwritten. |
WIDGET_OwnerDraw.c | Shows how OwnerDraw routines can be set for widgets that support OwnerDraw. |
WIDGET_ReactOnMessages.c | Demonstrates how the application can react on messages sent by widgets. |
WIDGET_SkinningProps.c | Shows how the appearance of widgets can be changed using skinning properties. This can only be done for widgets that support skinning. |
WIDGET_SkinningRoutine.c | Shows how the appearance of widgets can be changed using a skinning routine. This can only be done for widgets that support skinning. |
BUTTON widget
Name of example | Description |
---|---|
BUTTON_Custom.c | Custom drawing of a BUTTON widget. |
BUTTON_Usage.c | Usage of a BUTTON widget. |
CHECKBOX widget
Name of example | Description |
---|---|
CHECKBOX_Custom.c | Custom drawing of a CHECKBOX widget. |
CHECKBOX_Usage.c | Usage of a CHECKBOX widget. |
DROPDOWN widget
Name of example | Description |
---|---|
DROPDOWN_Custom.c | Custom drawing of a DROPDOWN widget. |
DROPDOWN_Usage.c | Usage of a DROPDOWN widget. |
EDIT widget
Name of example | Description |
---|---|
EDIT_Custom_KeyHandler.c | Demonstrates how a custom key handling function can be set to an EDIT which is useful for formatted strings. |
FRAMEWIN widget
Name of example | Description |
---|---|
FRAMEWIN_Custom.c | Custom drawing of a FRAMEWIN widget. |
FRAMEWIN_Usage.c | Usage of a FRAMEWIN widget. |
GAUGE widget
Name of example | Description |
---|---|
GAUGE_Usage.c | Usage and custom drawing of a GAUGE widget. |
GRAPH widget
Name of example | Description |
---|---|
GRAPH_Custom.c | Custom drawing of a GRAPH widget. |
GRAPH_Usage.c | Usage of a GRAPH widget. |
ICONVIEW widget
Name of example | Description |
---|---|
ICONVIEW_Custom.c | Custom drawing of a ICONVIEW widget. |
ICONVIEW_Usage.c | Usage of a ICONVIEW widget. |
KEYBOARD widget
Name of example | Description |
---|---|
KEYBOARD_Advanced.c | Advanced usage of the KEYBOARD widget, demonstrating exporting and importing pattern and layout files to external memory. |
KEYBOARD_Simple.c | Basic usage of a KEYBOARD widget using a predefined layout. |
LISTBOX widget
Name of example | Description |
---|---|
LISTBOX_Custom.c | Custom drawing of a LISTBOX widget. |
LISTBOX_Usage.c | Usage of a LISTBOX widget. |
LISTVIEW widget
Name of example | Description |
---|---|
LISTVIEW_Custom.c | Custom drawing of a LISTVIEW widget. |
LISTVIEW_Spreadsheet.c | LISTVIEW with editable cells, like in a spreadsheet. |
LISTVIEW_Usage.c | Usage of a LISTVIEW widget. |
LISTWHEEL widget
Name of example | Description |
---|---|
LISTWHEEL_Custom.c | Custom drawing of a LISTWHEEL widget. |
LISTWHEEL_Usage.c | Usage of a LISTWHEEL widget. |
MULTIPAGE widget
Name of example | Description |
---|---|
MULTIPAGE_Custom.c | Custom drawing of a MULTIPAGE widget. |
MULTIPAGE_Usage.c | Usage of a MULTIPAGE widget. |
PROGBAR widget
Name of example | Description |
---|---|
PROGBAR_Custom.c | Custom drawing of a PROGBAR widget. |
PROGBAR_Usage.c | Usage of a PROGBAR widget. |
RADIO widget
Name of example | Description |
---|---|
RADIO_Custom.c | Custom drawing of a RADIO widget. |
RADIO_Usage.c | Usage of a RADIO widget. |
ROTARY widget
Name of example | Description |
---|---|
ROTARY_Usage.c | Usage and custom drawing of a ROTARY widget. |
SCROLLER widget
Name of example | Description |
---|---|
SCROLLER_Custom.c | Custom drawing of a SCROLLER widget. |
SCROLLER_Usage_CustomWidgets.c | Attaching a SCROLLER widget to custom widgets. |
SCROLLER_Usage_DefaultWidgets.c | Attaching a SCROLLER widget to predefined emWin widgets. |
SLIDER widget
Name of example | Description |
---|---|
SLIDER_Custom.c | Custom drawing of a SLIDER widget. |
SLIDER_Usage.c | Usage of a SLIDER widget. |
SPINBOX widget
Name of example | Description |
---|---|
SPINBOX_Custom.c | Custom drawing of a SPINBOX widget. |
SPINBOX_Usage.c | Usage of a SPINBOX widget. |
SWIPELIST widget
Name of example | Description |
---|---|
SWIPELIST_Custom.c | Custom drawing of a SWIPELIST widget. |
SWIPELIST_Usage.c | Usage of a SWIPELIST widget. |
SWITCH widget
Name of example | Description |
---|---|
SWITCH_Usage.c | Usage and custom drawing of a SWITCH widget. |
SWITCH_SetFocusAndToggle.c | Set focus to SWITCH widget and toggle by button. |
TREEVIEW widget
Name of example | Description |
---|---|
TREEVIEW_Custom.c | Custom drawing of a TREEVIEW widget. |
TREEVIEW_Usage.c | Usage of a TREEVIEW widget. |
WHEEL widget
Name of example | Description |
---|---|
WHEEL_Usage.c | Customization and usage of a WHEEL widget. |
Window Manager
Name of example | Description |
---|---|
WM_AllMessages.c | Example that shows all window messages that can be used. |
WM_ChildWindows.c | Demonstrates how child windows work and how they are created. |
WM_Clipping.c | Shows how clipping is performed in emWin. |
WM_CreateWindows.c | Demonstrates how to create windows. |
WM_CustomMessage.c | Demonstrates how custom messages can be sent between windows. |
WM_FocusableWindow.c | Shows how a window can accept focus like most other widgets. |
WM_IrregularFill_ClipRect.c | Demonstrates how irregular objects can be filled in emWin with clipping rectangles. |
WM_IrregularFill_MemDev.c | Demonstrates how irregular objects can be filled in emWin using a memory device as a mask. |
WM_LateClipping.c | Demonstrates the difference between late and early clipping. |
WM_MOTION_MoveContent.c | Shows how motion support works for movable content, such as text that can be scrolled. |
WM_MOTION_MoveWindows.c | Shows how motion support can be used for moving windows. |
WM_MOTION_SwipeInWindow.c | Shows how motion support can be used to move in and out windows with a swipe gesture. |
WM_SetUntouchable.c | Demonstrates how windows can be marked as "untouchable". |
WM_SetUserData.c | Example that shows how to set extra data to a window or widget. User data are extra bytes that are allocated upon creation of the window or widget. This can be utilized to transfer data between windows. |
WM_SimpleTimer.c | Sample that demonstrates how to use timers with the Window Manager. |
WM_TransparentWindows.c | Shows how transparent windows can be created. |