Example #1
0
static void down_click_handler_repeating(ClickRecognizerRef recognizer, void *context) {
  //text_layer_set_text(one_layer, "Down");
    if(layer_count_start == 0){
          if (dollars > 5)
      dollars = dollars - 5;
      
      //text_layer_destroy(layer_array[0]);
      add_menu_item(0,GRect(10,0,menu_item_width,menu_item_height));
      
    }else if(layer_count_start == 1){
          if (cents > 5)
            cents = cents - 5;
    //text_layer_destroy(layer_array[1]);
    add_menu_item(1,GRect(10,25,menu_item_width,menu_item_height));     
          

    }else if(layer_count_start == 2){
          if(tip_percent > 0)
            tip_percent--;
    //text_layer_destroy(layer_array[2]);
    add_menu_item(2,GRect(10,50,menu_item_width,menu_item_height));    
          

    }else{
       if (people > 0)
     people--;
     //text_layer_destroy(layer_array[3]);
     add_menu_item(3, GRect(10,75,menu_item_width,menu_item_height)); 
      
  }

  update_total();
}
Example #2
0
void update_shot() {
	thishole++;
	mini_snprintf(s_shots_hole, 25, "Shots: %d", thishole);
	text_layer_set_text(&shots_hole, s_shots_hole);
	update_total();
	text_layer_set_text(&club, "Shot Recorded");
	timer_handle = app_timer_send_event(g_ctx, 1500 /* milliseconds */, COOKIE_MY_TIMER);
}
Example #3
0
static void up_click_handler_repeating(ClickRecognizerRef recognizer, void *context) {
  //text_layer_set_text(one_layer, "Up");
  if(layer_count_start == 0){
    dollars = dollars + 5;
    //text_layer_destroy(layer_array[0]);
    add_menu_item(0,GRect(10,0,menu_item_width,menu_item_height));  
  }else if(layer_count_start == 1){
    cents = cents + 5;
    //text_layer_destroy(layer_array[1]);
    add_menu_item(1,GRect(10,25,menu_item_width,menu_item_height)); 
  }else if(layer_count_start == 2){
    tip_percent++;
    //text_layer_destroy(layer_array[2]);
    add_menu_item(2,GRect(10,50,menu_item_width,menu_item_height));
  }else{
    people++;
    //text_layer_destroy(layer_array[3]);
    add_menu_item(3,GRect(10,75,menu_item_width,menu_item_height));
  }
  update_total();
}