Today's Menu  Portugal
journal and plan nutrition
Instance Methods | List of all members
Z3MenuJournalView Class Reference

#import <Z3MenuJournalView.h>

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

Instance Methods

(instancetype) - initWithDelegate:
 
(NSDate *) - getMealJournalDate
 
(float) - heightRequirement [implementation]
 
(void) - appear: [implementation]
 
(void) - newRating:: [implementation]
 
(void) - clickedCheck [implementation]
 
- Instance Methods inherited from <DLStarRatingDelegate>
(void) - newRating::
 

Detailed Description

Definition at line 14 of file Z3MenuJournalView.h.

Method Documentation

◆ appear:()

- (void) appear: (CGRect)  bound
implementation

Definition at line 39 of file Z3MenuJournalView.m.

39  :(CGRect)bound
40 {
41  UIColor *blueCheeseSpotColor = [UIColor colorWithRed:196.0/256 green:220.0/256 blue:180.0/256 alpha:1.0];
42  [self setBackgroundColor:blueCheeseSpotColor];
43 
44  CGRect timePickerFrame = CGRectMake(2.0, 2.0, bound.size.width - 6.0, timePickerHeight);
45  mealJournalDatePick = [[UIDatePicker alloc] initWithFrame:timePickerFrame];
46  [mealJournalDatePick setMinuteInterval:10];
47  int finishedDinnerTenMinutesAgoSeconds = - (10.0 * 60.0);
48  NSDate *dinnerTime = [NSDate dateWithTimeIntervalSinceNow:finishedDinnerTenMinutesAgoSeconds];
49  [mealJournalDatePick setDate:dinnerTime];
50  NSDate *now = [NSDate dateWithTimeIntervalSinceNow:0];
51  [mealJournalDatePick setMaximumDate:now];
52  [self addSubview:mealJournalDatePick];
53 
54  float starRatingFrameWidth = bound.size.width - checkButtonWidth - 6.0;
55  CGRect starRatingFrame = CGRectMake(2.0,
56  timePickerHeight + 4.0,
57  starRatingFrameWidth,
59  starRating = [[DLStarRatingControl alloc] initWithFrame:starRatingFrame];
60  [starRating setDelegate:self];
61  [self addSubview:starRating];
62 
63  CGRect checkButtonFrame = CGRectMake(bound.size.width - checkButtonWidth - 6.0,
65  checkButtonWidth - 4,
67  checkButton = [[UIButton alloc] initWithFrame:checkButtonFrame];
68  // checkButton = [[UIButton alloc] initWithFrame:checkButtonFrame];
69  // [checkButton setBackgroundColor:[UIColor lightGrayColor]];
70  [checkButton setTitle:@"â0œ“" forState:UIControlStateNormal];
71  // [checkButton setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
72  [checkButton addTarget:self action:@selector(clickedCheck) forControlEvents:UIControlEventTouchUpInside];
73  [self addSubview:checkButton];
74 
75 }
float checkButtonWidth
UIDatePicker * mealJournalDatePick
DLStarRatingControl * starRating
float timePickerHeight
float starRatingHeight

◆ clickedCheck()

- (void) clickedCheck
implementation

Definition at line 82 of file Z3MenuJournalView.m.

83 {
84  NSLog(@"MenuJournalView.clickedCheck");
85  [menuJournalDelegate didTapCheckFooter];
86 }

◆ getMealJournalDate()

- (NSDate *) getMealJournalDate

Definition at line 87 of file Z3MenuJournalView.m.

88 {
89  return [mealJournalDatePick date];
90 }

◆ heightRequirement()

- (float) heightRequirement
implementation

Definition at line 34 of file Z3MenuJournalView.m.

35 {
36  float ret = timePickerHeight + starRatingHeight;
37  return ret;
38 }
float timePickerHeight
float starRatingHeight

◆ initWithDelegate:()

- (instancetype) initWithDelegate: (id<Z6MenuJournalDelegate>)  delegate

Definition at line 24 of file Z3MenuJournalView.m.

24  :(id<Z6MenuJournalDelegate>) delegate
25 {
26  self = [super init];
27  if (self) {
30  }
31  return self;
32 }
id< Z6MenuJournalDelegate > menuJournalDelegate
float checkButtonWidth
id< U7ParamEditControlDelegate > delegate
float starRatingHeight

◆ newRating::()

- (void) newRating: (DLStarRatingControl *)  control
: (float)  rating 
implementation

Definition at line 77 of file Z3MenuJournalView.m.

77  :(DLStarRatingControl *)control :(float)rating
78 {
79  NSLog(@"MenuJournalView.newRating");
80  [menuJournalDelegate didTapRatingControl:rating];
81 }

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