MPLAB® Harmony Graphics Suite > Designer > Microchip Aria Designer > MHGC Tools > Event Manager > Graphics Composer Macros
MPLAB® Harmony Graphics Suite
Graphics Composer Macros

Macros implement event handlers for events that originate outside of graphics primitives such as widgets and are designed to change or manipulate widgets inside of the graphics part of an application. (Events that originate outside of graphics and don’t touch the graphics part of the application are outside of the scope of the Graphics Event Manager and are not discussed here.) 

The following figure shows a simple example of a macro.

 

 

 

The toolbar for Macros has three icons.

 

 

Creating a new macro and selecting its actions is just like that of a widget event:

  1. Create a new macro using the “Create New Macro” tool. The check box to the left of the new macro’s name enables/disables the macro. Clearing it removes the macro from the next code generation.
  2. Select the new macro and edit it using the second icon (shown previously).
  3. In the Actions: window, select Create New Action. An optional name can be provided in the Name: box. The user can then choose to use a Template and select a predefined action or Custom to create a customized action.

 

 

  1. A “Custom” action is picked, proceed as discussed previous in Graphics Composer Events. When using templates the next step is to choose the target widget for the action. This choice is limited to those only the widgets in the currently “active” screen. If the application has multiple screens and the widget that is being targeted is not part of the currently active screen, the user would need to change the active screen.
    • Changing the active screen can be done by selecting the corresponding screen tab at the bottom of the Graphics Composer Screen Designer

 

 

  • Alternately, the screen can be switched using the Graphics Composer Manager:Screens tab

 

 

  1. After selecting the target widget for this macro, click Next button to select an action related to this widget. (Just as with template-based widget events.) The macro can contain more than one action, targeting more than one widget.
MPLAB® Harmony Graphics Suite