Today's Menu  Portugal
journal and plan nutrition
Instance Methods | Protected Types | Properties | List of all members
V7foodTextFieldView Class Reference

#import <V7foodTextFieldView.h>

Inheritance diagram for V7foodTextFieldView:
Inheritance graph
[legend]
Collaboration diagram for V7foodTextFieldView:
Collaboration graph
[legend]

Instance Methods

(instancetype) - initWithDelegate:
 
(void) - showUSDAFoodDatabaseResponse:
 
(void) - originate [implementation]
 
(float) - heightRequirement [implementation]
 
(void) - appear: [implementation]
 

Protected Types

enum  USDAFoodDatabaseStatus { USDAFoodInit, USDAFoodDatabaseQueried, USDAFoodDatabaseRespOK, USDAFoodDatabaseRespErr }
 

Properties

UITextField * foodTextField
 

Detailed Description

Definition at line 13 of file V7foodTextFieldView.h.

Member Enumeration Documentation

◆ USDAFoodDatabaseStatus

- (enum) USDAFoodDatabaseStatus
protected

Method Documentation

◆ appear:()

- (void) appear: (CGRect)  bound
implementation

Definition at line 90 of file V7foodTextFieldView.m.

90  :(CGRect)bound
91 {
92 // NSLog(@"FoodTextFieldView.appear: bound: %3.2f/%3.2f, %3.2f/%3.2f",
93 // bound.origin.x, bound.origin.y, bound.size.width, bound.size.height);
94 // NSLog(@"FoodTextFieldView.appear: foodEntryTextField: %@", _foodTextField);
95 }

◆ heightRequirement()

- (float) heightRequirement
implementation

Definition at line 84 of file V7foodTextFieldView.m.

85 {
86  float returnHeight = 36.0f;
87 
88  return returnHeight;
89 }

◆ initWithDelegate:()

- (instancetype) initWithDelegate: (id<V7foodTextFieldDelegate>)  dele

Definition at line 21 of file V7foodTextFieldView.m.

21  : (id<V7foodTextFieldDelegate>) dele
22 {
23  self = [super init];
24  if (self) {
25  delegate = dele;
26  [self originate];
27  }
28  return self;
29 }
id< U7ParamEditControlDelegate > delegate

◆ originate()

- (void) originate
implementation

Definition at line 30 of file V7foodTextFieldView.m.

31 {
32  [self setClipsToBounds:YES];
33 
34  CGRect headerViewFrame = CGRectMake(4.0f, 70.0f, 100.0f, 100.0f);
35  [self setFrame:headerViewFrame];
36 
37  CGRect captionLabelFrame = CGRectMake(2.0f, 2.0f, 50.0f, 35.0f);
38  captionLabel = [[UILabel alloc] initWithFrame:captionLabelFrame];
39  [captionLabel setText:@"Food "];
40  [captionLabel setTextColor:[UIColor blackColor]];
41 
42  CGRect foodEntryTextFieldFrame = CGRectMake(54.0f, 2.0f, 180.0f, 35.0f);
43  _foodTextField = [[UITextField alloc] initWithFrame:foodEntryTextFieldFrame];
44  [_foodTextField setBackgroundColor:[UIColor lightGrayColor]];
45 
46  CGRect scanDatabaseButtonFrame = CGRectMake(240.0f, 2.0f, 100.0f, 35.0f);
47  scanDatabaseButton = [[UIButton alloc] initWithFrame:scanDatabaseButtonFrame];
48  [self showUSDAFoodDatabaseResponse:USDAFoodInit];
49  [scanDatabaseButton addTarget:delegate action:@selector(clickScan) forControlEvents:UIControlEventTouchDown];
50  [Z5DataController labelizeButton:scanDatabaseButton withText:@"scan"];
51 
52  [self addSubview:captionLabel];
53  [self addSubview:_foodTextField];
54  [self addSubview:scanDatabaseButton];
55 }
Singleton interface to both core and remote data sources.
void labelizeButton:withText:(UIButton *targButton, [withText] NSString *txt)
UILabel * captionLabel
UIButton * scanDatabaseButton

◆ showUSDAFoodDatabaseResponse:()

- (void) showUSDAFoodDatabaseResponse: (USDAFoodDatabaseStatus flag

Definition at line 57 of file V7foodTextFieldView.m.

58 {
59  switch(flag) {
60  case USDAFoodInit:
61  {
62  [scanDatabaseButton setBackgroundColor:[UIColor whiteColor]];
63  }
64  break;
66  {
67  [scanDatabaseButton setBackgroundColor:[UIColor magentaColor]];
68  }
69  break;
71  {
72  [scanDatabaseButton setBackgroundColor:[UIColor greenColor]];
73  }
74  break;
76  {
77  [scanDatabaseButton setBackgroundColor:[UIColor orangeColor]];
78  }
79  break;
80  }
81 }

Property Documentation

◆ foodTextField

- (UITextField*) foodTextField
readwritenonatomicstrong

Definition at line 22 of file V7foodTextFieldView.h.


The documentation for this class was generated from the following files: