Microchip® Advanced Software Framework

 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
App_widget_group

Data Structures

struct  app_calculator_t
 Calculator context. More...
 

Macros

#define BT_H   40
 Height (in pixels) of a normal sized button. More...
 
#define BT_POS_X(col)   (W_SP + (BT_W * (col)))
 Calculate button X coordinate. More...
 
#define BT_POS_Y(row)   (W_SP + T_H + T_SP + (BT_H * (row)))
 Calculate button Y coordinate. More...
 
#define BT_W   40
 Width (in pixels) of a normal sized button. More...
 
#define BT_X   4
 Number of buttons in one column. More...
 
#define BT_Y   5
 Number of buttons in one row. More...
 
#define MAX_DIGITS   9
 Maximum number of digits on display. More...
 
#define MAX_VALUE   999999999L
 Maximum value we can show on display. More...
 
#define MIN_VALUE   -999999999L
 Minimum value we can show on display. More...
 
#define T_H   16
 Height of the static text field. More...
 
#define T_SP   16
 Spacing between static text and button pad. More...
 
#define T_W   (BT_W * BT_X)
 Width of the static text field. More...
 
#define W_SP   16
 Spacing between widget frame and components. More...
 

Functions

static bool app_calc_handler (struct wtk_basic_frame *frame, win_command_t command_data)
 Frame handler for the application. More...
 
static void app_calc_update_disp (struct app_calculator_t *calc)
 Update calculator display with new value. More...
 
bool app_widget_launch (void)
 Setup widget demo. More...
 
static void calc_perform_operation (struct app_calculator_t *calc)
 Perform calculation. More...
 

#define BT_H   40

Height (in pixels) of a normal sized button.

Referenced by app_widget_launch().

#define BT_POS_X (   col)    (W_SP + (BT_W * (col)))

Calculate button X coordinate.

Referenced by app_widget_launch().

#define BT_POS_Y (   row)    (W_SP + T_H + T_SP + (BT_H * (row)))

Calculate button Y coordinate.

Referenced by app_widget_launch().

#define BT_W   40

Width (in pixels) of a normal sized button.

Referenced by app_widget_launch().

#define BT_X   4

Number of buttons in one column.

Referenced by app_widget_launch().

#define BT_Y   5

Number of buttons in one row.

Referenced by app_widget_launch().

#define MAX_DIGITS   9

Maximum number of digits on display.

Referenced by app_calc_update_disp().

#define MAX_VALUE   999999999L

Maximum value we can show on display.

Referenced by app_calc_update_disp(), and calc_perform_operation().

#define MIN_VALUE   -999999999L

Minimum value we can show on display.

Referenced by app_calc_update_disp(), and calc_perform_operation().

#define T_H   16

Height of the static text field.

Referenced by app_widget_launch().

#define T_SP   16

Spacing between static text and button pad.

Referenced by app_widget_launch().

#define T_W   (BT_W * BT_X)

Width of the static text field.

Referenced by app_widget_launch().

#define W_SP   16

Spacing between widget frame and components.

Referenced by app_widget_launch().

static bool app_calc_handler ( struct wtk_basic_frame frame,
win_command_t  command_data 
)
static
static void app_calc_update_disp ( struct app_calculator_t calc)
static

Update calculator display with new value.

Parameters
calcPointer to calculator struct

References app_calculator_t::calc_regs, app_calculator_t::display, MAX_DIGITS, MAX_VALUE, MIN_VALUE, app_calculator_t::state, app_calculator_t::text, and wtk_label_change().

Referenced by app_calc_handler().

static void calc_perform_operation ( struct app_calculator_t calc)
static

Perform calculation.

Parameters
calcPointer to calculator struct

References app_calculator_t::calc_regs, MAX_VALUE, MIN_VALUE, app_calculator_t::operand, app_calculator_t::operation, app_calculator_t::result, and app_calculator_t::state.

Referenced by app_calc_handler().