Resources | developer.brewmp.com Resources | developer.brewmp.com

Developer

resources

Getting started with widgets

This section describes how to create an application that uses Brew MP UI Widgets.

Before creating a widget-based application, you should be familiar with Brew MP programming concepts and the Brew MP tools. Refer to the following documents, which are on the Brew MP website in http://developer.brewmp.com/resources:

  • Programming Model
  • C Eclipse Primer
  • C Visual Studio Primer

The topics in this section cover the following aspects of creating a widget-based application:

  • Required include files
  • Setting up the root container
  • Handling events
  • Drawing to the display
  • Creating containers
  • Creating widgets
  • Inserting widgets into containers
  • Setting widget properties
  • Creating a model listener
  • Handling model events
  • Accessing model data
  • Freeing resources

Code examples

The code examples in this section are taken from the c_simple_widget_app_1_0 application . This application uses widgets to create a simple UI that consists of a title, two radio buttons, and a button.

The title and button widgets are decorator widgets, which are container widgets that contain a single child widget; the decorator changes the appearance or behavior of its child widget. In c_simple_widget_app_1_0, the title and button widgets each decorate a separate static widget.

Each radio button widget has a corresponding static widget that provides the text label for the radio button.

The figure below shows the UI that is created by c_simple_widget_app_1_0, with outlines indicating the containers and widgets used to create the display.