Today's Menu  Portugal
journal and plan nutrition
Z3MenuApprovalView.m
Go to the documentation of this file.
1 //
2 // Z3MenuApprovalView.m
3 // TodaysMenu
4 //
5 // Created by Don Zeek on 4/17/17.
6 // Copyright © 2017 net.dzeek.y2015.ios.portfolio. All rights reserved.
7 //
8 
9 #import "Z3MenuApprovalView.h"
12 
13 @implementation Z3MenuApprovalView
14 {
15  UIButton *cancelButton;
16  UIButton *approvalButton;
17 }
18 id<Z6MenuApprovalDelegate> menuApprovalDelegate;
20 
21 - (instancetype) initWithDelegate:(id<Z6MenuApprovalDelegate>) delegate
22 {
23  self = [super init];
24  if (self) {
26  }
27  return self;
28 }
29 
31 {
32  float ret = makeMealBarViewHeight;
33  return ret;
34 }
35 - (void) appear:(CGRect)bound
36 {
37  [self setBackgroundColor:[UIColor brownColor]];
38 
39  CGRect cancelButtonFrame = CGRectMake(2.0, 2.0, bound.size.width/2 - 4, makeMealBarViewHeight - 4.0);
40  cancelButton = [[UIButton alloc] initWithFrame:cancelButtonFrame];
41  [cancelButton setTitle:@"clear" forState:UIControlStateNormal];
42  [cancelButton addTarget:self action:@selector(clickedCancel) forControlEvents:UIControlEventTouchUpInside];
43  [self addSubview:cancelButton];
44 
45  // add a button to approve the selected menu item for today's (right now) meal
46  CGRect approvalButtonFrame = CGRectMake(bound.size.width/2 + 2, 2.0, bound.size.width/2 - 8, makeMealBarViewHeight - 4.0);
47  approvalButton = [[UIButton alloc] initWithFrame:approvalButtonFrame];
48  [approvalButton setTitle:@"Bravo" forState:UIControlStateNormal];
49  [approvalButton addTarget:self action:@selector(clickedApproval) forControlEvents:UIControlEventTouchUpInside];
50  [self addSubview:approvalButton];
51  // end - add a button to approve the selected menu item for today's (right now) meal
52 
53 
54 }
55 
56 - (void) clickedCancel
57 {
58  NSLog(@"MenuApprovalBar.clickedCancel");
59  [menuApprovalDelegate didTapClearFooter];
60 }
61 
63 {
64  NSLog(@"MenuApprovalBar.clickedApproval");
65  [menuApprovalDelegate didTapBravoFooter];
66 }
67 /*
68 // Only override drawRect: if you perform custom drawing.
69 // An empty implementation adversely affects performance during animation.
70 - (void)drawRect:(CGRect)rect {
71  // Drawing code
72 }
73 */
74 
75 @end
id< Z6MenuApprovalDelegate > menuApprovalDelegate
id< U7ParamEditControlDelegate > delegate
float makeMealBarViewHeight
UIButton * approvalButton