Global Lender
A Pebble app for finding new and interesting loans on kiva.org
Functions | Variables
WndDataMenu.c File Reference
#include <pebble.h>
#include "misc.h"
#include "libs/WndDataMenu_Internal.h"
Include dependency graph for WndDataMenu.c:

Functions

MagPebApp_ErrCode WndDataMenu_updateView (WndDataMenu *this)
 
MagPebApp_ErrCode WndDataMenu_setNumSections (WndDataMenu *this, const uint16_t numSections)
 
MagPebApp_ErrCode WndDataMenu_setSectionTitle (WndDataMenu *this, const uint16_t sectIdx, const char *headerTitle)
 
MagPebApp_ErrCode WndDataMenu_buildSection (WndDataMenu *this, const uint16_t sectIdx, const uint16_t numRows, const char *headerTitle)
 
MagPebApp_ErrCode WndDataMenu_buildRow (WndDataMenu *this, const uint16_t sectIdx, const uint16_t rowIdx, const char *rowTitle, const char *rowSubtitle)
 
MagPebApp_ErrCode WndDataMenu_setPalette (WndDataMenu *this, const WndDataMenu_Palette pal)
 
MagPebApp_ErrCode WndDataMenu_push (WndDataMenu *this)
 
WndDataMenuWndDataMenu_create ()
 Creates a data menu window and pushes it on the window stack. More...
 
MagPebApp_ErrCode WndDataMenu_init (WndDataMenu *this)
 
MagPebApp_ErrCode WndDataMenu_destroy (WndDataMenu *this)
 

Variables

const uint16_t WndDataMenu_defaultNumSections = 1
 
const uint16_t WndDataMenu_defaultNumRows = 1
 
const char * WndDataMenu_defaultRowTitle = "Please wait..."
 

Function Documentation

MagPebApp_ErrCode WndDataMenu_buildRow ( WndDataMenu this,
const uint16_t  sectIdx,
const uint16_t  rowIdx,
const char *  rowTitle,
const char *  rowSubtitle 
)

Sets up a row in a section of this data menu.

A call to this function must be preceded by a call to buildSection to allocate the number of rows in this data menu section (default is 1).

Parameters
[in,out]thisPointer to the WndDataMenu "object"; must be already allocated.
[in]sectIdxThe index of the section that this function will build.
[in]rowIdxThe index of the row that this function will build.
[in]rowTitleThe title for this row. May be NULL.
[in]rowSubtitleThe subtitle for this section. May be NULL.
Returns
MPA_SUCCESS on success MPA_INVALID_INPUT_ERR if sectIdx is not a valid section index or rowIdx is not a valid row index in that section. MPA_NULL_POINTER_ERR if parameters this or this->sections are NULL upon entry.
MagPebApp_ErrCode WndDataMenu_buildSection ( WndDataMenu this,
const uint16_t  sectIdx,
const uint16_t  numRows,
const char *  headerTitle 
)

Sets up a section of this data menu.

A call to this function may be preceded by a call to setNumSections to indicate the number of sections in this data menu (default is 1). A call to this function should be followed by a call buildRow to setup the rows within this section.

Parameters
[in,out]thisPointer to the WndDataMenu "object"; must be already allocated.
[in]sectIdxThe index of the section that this function will build.
[in]numRowsIndicates the number of rows this section will contain.
[in]headerTitleThe title for this section. May be NULL.
Returns
MPA_SUCCESS on success MPA_INVALID_INPUT_ERR if sectIdx is not a valid section index MPA_NULL_POINTER_ERR if parameters this or this->sections are NULL upon entry.
WndDataMenu* WndDataMenu_create ( )

Creates a data menu window and pushes it on the window stack.

MagPebApp_ErrCode WndDataMenu_destroy ( WndDataMenu this)
MagPebApp_ErrCode WndDataMenu_init ( WndDataMenu this)

Internal initialization

Parameters
[in,out]thisPointer to WndDataMenu; must be already allocated
MagPebApp_ErrCode WndDataMenu_push ( WndDataMenu this)
MagPebApp_ErrCode WndDataMenu_setNumSections ( WndDataMenu this,
const uint16_t  numSections 
)

Sets the number of sections for this data menu.

Parameters
[in,out]thisPointer to the WndDataMenu "object"; must be already allocated.
[in]numNumber of sections
MagPebApp_ErrCode WndDataMenu_setPalette ( WndDataMenu this,
const WndDataMenu_Palette  pal 
)
MagPebApp_ErrCode WndDataMenu_setSectionTitle ( WndDataMenu this,
const uint16_t  sectIdx,
const char *  headerTitle 
)

Sets the title for a section of this data menu.

Parameters
[in,out]thisPointer to the WndDataMenu "object"; must be already allocated.
[in]sectIdxThe index of the section that this function will build.
[in]headerTitleThe title for this section. May be NULL.
Returns
MPA_SUCCESS on success MPA_INVALID_INPUT_ERR if sectIdx is not a valid section index MPA_NULL_POINTER_ERR if parameters this or this->sections are NULL upon entry.
MagPebApp_ErrCode WndDataMenu_updateView ( WndDataMenu this)

Variable Documentation

const uint16_t WndDataMenu_defaultNumRows = 1
const uint16_t WndDataMenu_defaultNumSections = 1
const char* WndDataMenu_defaultRowTitle = "Please wait..."