}//end method /// <summary> /// Updates textbox values to represent the current goals /// </summary> private void SetGoalTextboxValues() { caloriesTxt.Text = tracker.GetCalorieGoal().ToString(); carbsTxt.Text = tracker.GetCarbsGoal().ToString(); fatTxt.Text = tracker.GetFatGoal().ToString(); proteinTxt.Text = tracker.GetProteinGoal().ToString(); }//end method
}//end method /// <summary> /// Update labels over the progress bars. /// </summary> private void UpdateProgressBarLabels() { if (caloriesProgressBar.Value < caloriesProgressBar.Maximum) { this.calorieProgressBarValueLabel.Text = caloriesProgressBar.Value.ToString() + " / " + caloriesProgressBar.Maximum.ToString(); } else { int overflowAmt = tracker.GetCurrentCalories() - tracker.GetCalorieGoal(); this.calorieProgressBarValueLabel.Text = overflowAmt.ToString() + " over goal!"; } if (carbsProgressBar.Value < carbsProgressBar.Maximum) { this.carbProgressBarValueLabel.Text = carbsProgressBar.Value.ToString() + " / " + carbsProgressBar.Maximum.ToString(); } else { int overflowAmt = tracker.GetCurrentCarbs() - tracker.GetCarbsGoal(); this.carbProgressBarValueLabel.Text = overflowAmt.ToString() + " over goal!"; } if (fatProgressBar.Value < fatProgressBar.Maximum) { this.fatProgressBarValueLabel.Text = fatProgressBar.Value.ToString() + " / " + fatProgressBar.Maximum.ToString(); } else { int overflowAmt = tracker.GetCurrentFat() - tracker.GetFatGoal(); this.fatProgressBarValueLabel.Text = overflowAmt.ToString() + " over goal!"; } if (proteinProgressBar.Value < proteinProgressBar.Maximum) { this.proteinProgressBarValueLabel.Text = proteinProgressBar.Value.ToString() + " / " + proteinProgressBar.Maximum.ToString(); } else { int overflowAmt = tracker.GetCurrentProtein() - tracker.GetProteinGoal(); this.proteinProgressBarValueLabel.Text = overflowAmt.ToString() + " over goal!"; } }//end method