Pebble Foundation Classes  0.2.0
C++ for Pebble
MenuLayerCallbacks Struct Reference

Data structure containing all the callbacks of a MenuLayer. More...

#include <pebble.h>

Collaboration diagram for MenuLayerCallbacks:

Public Attributes

MenuLayerGetNumberOfSectionsCallback get_num_sections
 
MenuLayerGetNumberOfRowsInSectionsCallback get_num_rows
 
MenuLayerGetCellHeightCallback get_cell_height
 
MenuLayerGetHeaderHeightCallback get_header_height
 
MenuLayerDrawRowCallback draw_row
 
MenuLayerDrawHeaderCallback draw_header
 
MenuLayerSelectCallback select_click
 
MenuLayerSelectCallback select_long_click
 
MenuLayerSelectionChangedCallback selection_changed
 
MenuLayerGetSeparatorHeightCallback get_separator_height
 
MenuLayerDrawSeparatorCallback draw_separator
 
MenuLayerSelectionWillChangeCallback selection_will_change
 
MenuLayerDrawBackgroundCallback draw_background
 

Detailed Description

Data structure containing all the callbacks of a MenuLayer.

Member Data Documentation

◆ draw_background

MenuLayerDrawBackgroundCallback MenuLayerCallbacks::draw_background

Callback that gets called before any cells are drawn. This supports two states, either highlighted or not highlighted. If highlighted is specified, it is expected to be colored in the same style as the menu's cells are. If this callback is not specified, it will default to the colors set with menu_layer_set_normal_colors and menu_layer_set_highlight_colors.

◆ draw_header

MenuLayerDrawHeaderCallback MenuLayerCallbacks::draw_header

Callback that gets called to render a section header. This gets called for each section header, every time it needs to be re-rendered.

Note
Must be set to a valid callback, unless .get_header_height is NULL. Causes undefined behavior otherwise.

◆ draw_row

MenuLayerDrawRowCallback MenuLayerCallbacks::draw_row

Callback that gets called to render a menu item. This gets called for each menu item, every time it needs to be re-rendered.

Note
Must be set to a valid callback; NULL causes undefined behavior.

◆ draw_separator

MenuLayerDrawSeparatorCallback MenuLayerCallbacks::draw_separator

Callback that gets called to render a separator. This gets called for each separator, every time it needs to be re-rendered.

Note
Must be set to a valid callback, unless .get_separator_height is NULL. Causes undefined behavior otherwise.

◆ get_cell_height

MenuLayerGetCellHeightCallback MenuLayerCallbacks::get_cell_height

Callback that gets called to get the height of a cell. This can get called at various moments throughout the life of a menu.

Note
When NULL, the default height of MENU_CELL_BASIC_CELL_HEIGHT pixels is used. Developers may wish to use MENU_CELL_ROUND_FOCUSED_SHORT_CELL_HEIGHT and MENU_CELL_ROUND_UNFOCUSED_SHORT_CELL_HEIGHT on a round display to respect the system aesthetic.

◆ get_header_height

MenuLayerGetHeaderHeightCallback MenuLayerCallbacks::get_header_height

Callback that gets called to get the height of a section header. This can get called at various moments throughout the life of a menu.

Note
When NULL, the default height of 0 pixels is used. This disables section headers.

◆ get_num_rows

MenuLayerGetNumberOfRowsInSectionsCallback MenuLayerCallbacks::get_num_rows

Callback that gets called to get the number of rows in a section. This can get called at various moments throughout the life of a menu.

Note
Must be set to a valid callback; NULL causes undefined behavior.

◆ get_num_sections

MenuLayerGetNumberOfSectionsCallback MenuLayerCallbacks::get_num_sections

Callback that gets called to get the number of sections in the menu. This can get called at various moments throughout the life of a menu.

Note
When NULL, the number of sections defaults to 1.

◆ get_separator_height

MenuLayerGetSeparatorHeightCallback MenuLayerCallbacks::get_separator_height

Callback that gets called to get the height of a separator This can get called at various moments throughout the life of a menu.

Note
When NULL, the default height of 0 is used.

◆ select_click

MenuLayerSelectCallback MenuLayerCallbacks::select_click

Callback that gets called when the user triggers a click with the SELECT button.

Note
When NULL, click events for the SELECT button are ignored.

◆ select_long_click

MenuLayerSelectCallback MenuLayerCallbacks::select_long_click

Callback that gets called when the user triggers a long click with the SELECT button.

Note
When NULL, long click events for the SELECT button are ignored.

◆ selection_changed

MenuLayerSelectionChangedCallback MenuLayerCallbacks::selection_changed

Callback that gets called whenever the selection changes.

Note
When NULL, selection change events are ignored.

◆ selection_will_change

MenuLayerSelectionWillChangeCallback MenuLayerCallbacks::selection_will_change

Callback that gets called before the selected cell changes. This gets called before the selected item in the MenuLayer is changed, and will allow for the selected cell to be overridden. This allows for skipping cells in the menu, locking selection onto a given item,


The documentation for this struct was generated from the following file: