1 /* FoodRanking.h */
2 
3 /*
4     NUT nutrition software
5     Copyright (C) 1996-2014 by Jim Jozwiak.
6 
7     This program is free software; you can redistribute it and/or modify
8     it under the terms of the GNU General Public License as published by
9     the Free Software Foundation; either version 2 of the License, or
10     (at your option) any later version.
11 
12     This program is distributed in the hope that it will be useful,
13     but WITHOUT ANY WARRANTY; without even the implied warranty of
14     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15     GNU General Public License for more details.
16 
17     You should have received a copy of the GNU General Public License
18     along with this program; if not, write to the Free Software
19     Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
20 */
21 
22 #ifndef FOODRANKING_H
23 #define FOODRANKING_H
24 
25 #include "TheStory.h"
26 
27 class TheStory;
28 
29 class FoodRanking : public Fl_Group
30 {
31 public:
32 FoodRanking(int x, int y, int w, int h, Fl_Color widgetcolor, TheStory *story);
33 void populate(int nutnum, int screen);
34 void set_food_group(int fg);
35 void set_minimize(int min);
36 void per_100_grams(int nutnum, int screen);
37 void per_100_grams_dry_weight(int nutnum, int screen);
38 void per_100_grams_within_food_group(int nutnum, int screen);
39 void per_100_calories(int nutnum, int screen);
40 void per_serving(int nutnum, int screen);
41 void per_serving_minimize(int nutnum, int screen, int type);
42 void per_daily_recorded_meals(int nutnum, int screen);
43 int max_array(void);
44 void food_present(int foodno);
45 void reindex_foodbuttons(int foodnum);
46 bool initial_meal_add;
47 
48 protected:
49 void resize(int x, int y, int w, int h);
50 
51 private:
52 Nut_Scroll *ancient_scroll;
53 Nut_Pack *foodpack;
54 Fl_Menu_Button *mb;
55 float abacus[MAX_FOOD];
56 FoodButton *FoodButtonArray[MAX_FOOD];
57 TheStory *story;
58 char mbbuf[80];
59 };
60 
61 #endif
62