|
void | EnableMenuEvents (MenuLayer &menuLayer, bool hasHeaders, bool hasSeparators, bool longClicks, bool customBackground) |
|
virtual uint16_t | OnGetNumSections () |
|
virtual uint16_t | OnGetNumRows (uint16_t section_index)=0 |
|
virtual int16_t | OnGetCellHeight (const MenuIndex &cell_index) |
|
virtual int16_t | OnGetHeaderHeight (uint16_t section_index) |
|
virtual int16_t | OnGetSeparatorHeight (const MenuIndex &cell_index) |
|
virtual void | OnDrawRow (const GContext &ctx, const Layer &cell_layer, const MenuIndex &cell_index)=0 |
|
virtual void | OnDrawHeader (const GContext &ctx, const Layer &cell_layer, uint16_t section_index) |
|
virtual void | OnDrawSeparator (const GContext &ctx, const Layer &cell_layer, const MenuIndex &cell_index) |
|
virtual void | OnSelectClick (const MenuIndex &cell_index) |
|
virtual void | OnSelectLongClick (const MenuIndex &cell_index) |
|
virtual void | OnSelectionChanged (const MenuIndex &new_index, const MenuIndex &old_index) |
|
virtual void | OnSelectionWillChange (MenuIndex &new_index, const MenuIndex &old_index) |
|
virtual void | OnDrawBackground (const GContext &ctx, const Layer &bg_layer, bool highlight) |
|
◆ EnableMenuEvents()
void Pebble::MenuEvents::EnableMenuEvents |
( |
MenuLayer & |
menuLayer, |
|
|
bool |
hasHeaders, |
|
|
bool |
hasSeparators, |
|
|
bool |
longClicks, |
|
|
bool |
customBackground |
|
) |
| |
|
inlineprotected |
Enable the events for the menu. This can be called anytime but should be called when the events will return correct data. If the data changes, you must call ReloadData()
◆ OnDrawBackground()
virtual void Pebble::MenuEvents::OnDrawBackground |
( |
const GContext & |
ctx, |
|
|
const Layer & |
bg_layer, |
|
|
bool |
highlight |
|
) |
| |
|
inlineprotectedvirtual |
Function signature for the callback which draws the menu's background. The background is underneath the cells of the menu, and is visible in the padding below the bottom cell, or if a cell's background color is set to GColorClear.
- Parameters
-
ctx | The destination graphics context to draw into. |
bg_layer | The background's layer, containing the geometry of the background. |
highlight | Whether this should be rendered as highlighted or not. Highlight style should match the highlight style of cells, since this color can be used for animating selection. |
◆ OnDrawHeader()
virtual void Pebble::MenuEvents::OnDrawHeader |
( |
const GContext & |
ctx, |
|
|
const Layer & |
cell_layer, |
|
|
uint16_t |
section_index |
|
) |
| |
|
inlineprotectedvirtual |
Function signature for the callback to render the section header at a given
- Parameters
-
ctx | The destination graphics context to draw into |
cell_layer | The header cell's layer, containing the geometry of the header cell |
section_index | The section index of the section header that needs to be drawn |
- Note
- The
cell_layer
argument is provided to make it easy to re-use an .update_proc
implementation in this callback. Only the bounds and frame of the cell_layer
are actually valid and other properties should be ignored.
- See also
- menu_layer_set_callbacks()
-
MenuLayerCallbacks
◆ OnDrawRow()
virtual void Pebble::MenuEvents::OnDrawRow |
( |
const GContext & |
ctx, |
|
|
const Layer & |
cell_layer, |
|
|
const MenuIndex & |
cell_index |
|
) |
| |
|
protectedpure virtual |
Function signature for the callback to render the menu cell at a given MenuIndex.
- Parameters
-
ctx | The destination graphics context to draw into |
cell_layer | The cell's layer, containing the geometry of the cell |
cell_index | The MenuIndex of the cell that needs to be drawn |
- Note
- The
cell_layer
argument is provided to make it easy to re-use an .update_proc
implementation in this callback. Only the bounds and frame of the cell_layer
are actually valid and other properties should be ignored.
- See also
- menu_layer_set_callbacks()
-
MenuLayerCallbacks
◆ OnDrawSeparator()
virtual void Pebble::MenuEvents::OnDrawSeparator |
( |
const GContext & |
ctx, |
|
|
const Layer & |
cell_layer, |
|
|
const MenuIndex & |
cell_index |
|
) |
| |
|
inlineprotectedvirtual |
Function signature for the callback to render the separator at a given MenuIndex.
- Parameters
-
ctx | The destination graphics context to draw into |
cell_layer | The cell's layer, containing the geometry of the cell |
cell_index | The MenuIndex of the separator that needs to be drawn |
callback_context | The callback context |
- Note
- The
cell_layer
argument is provided to make it easy to re-use an .update_proc
implementation in this callback. Only the bounds and frame of the cell_layer
are actually valid and other properties should be ignored.
- See also
- menu_layer_set_callbacks()
-
MenuLayerCallbacks
◆ OnGetCellHeight()
virtual int16_t Pebble::MenuEvents::OnGetCellHeight |
( |
const MenuIndex & |
cell_index | ) |
|
|
inlineprotectedvirtual |
Function signature for the callback to get the height of the menu cell at a given index.
- Parameters
-
menu_layer | The MenuLayer for which the data is requested |
cell_index | The MenuIndex for which the cell height is requested |
callback_context | The callback context |
- Returns
- The height of the cell at the given MenuIndex
- See also
- menu_layer_set_callbacks()
-
MenuLayerCallbacks
◆ OnGetHeaderHeight()
virtual int16_t Pebble::MenuEvents::OnGetHeaderHeight |
( |
uint16_t |
section_index | ) |
|
|
inlineprotectedvirtual |
Event to get the height of the section header at a given section index.
- Parameters
-
section_index | The index of the section for which the header height is requested |
- Returns
- The height of the section header at the given section index
- See also
- menu_layer_set_callbacks()
-
MenuLayerCallbacks
◆ OnGetNumRows()
virtual uint16_t Pebble::MenuEvents::OnGetNumRows |
( |
uint16_t |
section_index | ) |
|
|
protectedpure virtual |
Event to get the number of rows in a given section in a menu.
- Parameters
-
section_index | The index of the section of the menu for which the number of items it contains is requested |
- Returns
- The number of rows in the given section in the menu
- See also
- menu_layer_set_callbacks()
-
MenuLayerCallbacks
◆ OnGetNumSections()
virtual uint16_t Pebble::MenuEvents::OnGetNumSections |
( |
| ) |
|
|
inlineprotectedvirtual |
◆ OnGetSeparatorHeight()
virtual int16_t Pebble::MenuEvents::OnGetSeparatorHeight |
( |
const MenuIndex & |
cell_index | ) |
|
|
inlineprotectedvirtual |
Function signature for the callback to get the height of the separator at a given index.
- Parameters
-
menu_layer | The MenuLayer for which the data is requested |
cell_index | The MenuIndex for which the cell height is requested |
callback_context | The callback context |
- Returns
- The height of the separator at the given MenuIndex
- See also
- menu_layer_set_callbacks()
-
MenuLayerCallbacks
◆ OnSelectClick()
virtual void Pebble::MenuEvents::OnSelectClick |
( |
const MenuIndex & |
cell_index | ) |
|
|
inlineprotectedvirtual |
◆ OnSelectionChanged()
virtual void Pebble::MenuEvents::OnSelectionChanged |
( |
const MenuIndex & |
new_index, |
|
|
const MenuIndex & |
old_index |
|
) |
| |
|
inlineprotectedvirtual |
◆ OnSelectionWillChange()
virtual void Pebble::MenuEvents::OnSelectionWillChange |
( |
MenuIndex & |
new_index, |
|
|
const MenuIndex & |
old_index |
|
) |
| |
|
inlineprotectedvirtual |
Function signature for the callback which allows or changes selection behavior of the menu. In order to change the cell that should be selected, modify the passed in new_index. Preventing the selection from changing, new_index can be assigned the value of old_index.
- Parameters
-
menu_layer | The MenuLayer for which the selection event that occured |
new_index | Pointer to the index that the MenuLayer is going to change selection to. |
old_index | The index that is being unselected. |
callback_context | The callback context |
- Note
- menu_layer_set_selected_index will not trigger this callback when the selection changes, but menu_layer_set_selected_next will.
◆ OnSelectLongClick()
virtual void Pebble::MenuEvents::OnSelectLongClick |
( |
const MenuIndex & |
cell_index | ) |
|
|
inlineprotectedvirtual |
The documentation for this class was generated from the following file: