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

#import <V3KitchenTableView.h>

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

Instance Methods

(id) - initWithFrame:andDelegate:
 
(void) - fillDataForGallery:
 
(float) - heightRequirement [implementation]
 
(void) - appear: [implementation]
 
(void) - fireRecipeCheck [implementation]
 
(void) - addMenuItemOnToday: [implementation]
 
(void) - clickPlusButton [implementation]
 
(NSInteger) - getKitchenFocusGallery [implementation]
 
(NSInteger) - numberOfSectionsInTableView: [implementation]
 
(NSInteger) - tableView:numberOfRowsInSection: [implementation]
 
(nonnull UITableViewCell *) - tableView:cellForRowAtIndexPath: [implementation]
 
(void) - tableView:moveRowAtIndexPath:toIndexPath: [implementation]
 
(void) - tableView:didSelectRowAtIndexPath: [implementation]
 
(CGFloat) - tableView:heightForRowAtIndexPath: [implementation]
 
(CGFloat) - tableView:heightForHeaderInSection: [implementation]
 
(UIView *) - tableView:viewForHeaderInSection: [implementation]
 
(BOOL) - tableView:canEditRowAtIndexPath: [implementation]
 
(void) - tableView:commitEditingStyle:forRowAtIndexPath: [implementation]
 
(BOOL) - tableView:canMoveRowAtIndexPath: [implementation]
 
(CGFloat) - pickerView:rowHeightForComponent: [implementation]
 
(NSAttributedString *) - pickerView:attributedTitleForRow:forComponent: [implementation]
 
(void) - pickerView:didSelectRow:inComponent: [implementation]
 
(NSInteger) - numberOfComponentsInPickerView: [implementation]
 
(NSInteger) - pickerView:numberOfRowsInComponent: [implementation]
 
- Instance Methods inherited from Z7EmpaneledTableView
(id) - initWithFrame:
 
(void) - setViewForHead:
 
(void) - spaceForSectionHead:
 
(void) - measureForSectionHead:
 
(void) - setViewForTail:
 
(float) - getViewHeightReqmt
 

Detailed Description

Definition at line 24 of file V3KitchenTableView.h.

Method Documentation

◆ addMenuItemOnToday:()

- (void) addMenuItemOnToday: (UIButton *)  sender
implementation

Definition at line 78 of file V3KitchenTableView.m.

78  :(UIButton *)sender
79 {
80  NSLog(@"V3KitchenTableView.V3GalleryMenuItemControlbarProtocol");
81 }

◆ appear:()

- (void) appear: (CGRect)  bound
implementation

Definition at line 59 of file V3KitchenTableView.m.

59  :(CGRect)bound
60 {
61  self.dataSource = self;
62  [self setDelegate:self];
63 
64  [self.layer setBorderColor: [[UIColor blackColor] CGColor]];
65  [self.layer setBorderWidth: 2.0];
66  self.layer.cornerRadius = 8.0f;
67  self.layer.masksToBounds = YES;
68 
69  [self fillDataForGallery:(int)focusKitchenGallery];
70  [self reloadData];
71 }

◆ clickPlusButton()

- (void) clickPlusButton
implementation

Definition at line 82 of file V3KitchenTableView.m.

83 {
84  NSLog(@"V3KitchenTableView.clickPlusButton");
85  [memDelegate clickPlusButton];
86 }

◆ fillDataForGallery:()

- (void) fillDataForGallery: (int)  galleryNo

Definition at line 294 of file V3KitchenTableView.m.

294  :(int)galleryNo
295 {
296  Z5LocalDataController *localData = [[Z5DataController sharedInstance] localDataController];
297  NSLog(@"V3GalleryEdit.fillDataForGallery: gallery#: %d", galleryNo);
298  NSNumber *galleryChoice = [NSNumber numberWithInt:galleryNo];
299  NSArray *tmp = [localData retrieveAllMenuItems:galleryChoice];
300  NSLog(@"V3GalleryEdit.fillDataForGallery: count of all menu items in d/b: %ld", (unsigned long)[tmp count]);
301  kitchenTableMenuItems = [[NSMutableArray alloc] initWithArray:tmp];
302 }
NSArray< MenuItem * > * retrieveAllMenuItems:(NSNumber *galleryNo)
instancetype sharedInstance()
Singleton interface to both core and remote data sources.
NSMutableArray< MenuItem * > * kitchenTableMenuItems

◆ fireRecipeCheck()

- (void) fireRecipeCheck
implementation

Definition at line 74 of file V3KitchenTableView.m.

75 {
76  NSLog(@"V3KitchenTableView.fireRecipeCheck");
77 }

◆ getKitchenFocusGallery()

- (NSInteger) getKitchenFocusGallery
implementation

Definition at line 87 of file V3KitchenTableView.m.

88 {
89  return focusKitchenGallery;
90 }
NSInteger focusKitchenGallery

◆ heightRequirement()

- (float) heightRequirement
implementation

Definition at line 52 of file V3KitchenTableView.m.

53 {
54  unsigned long nEntries = [kitchenTableMenuItems count];
55  float ret = (nEntries * 67.0) + [self getViewHeightReqmt];
56  NSLog(@"V3KitchentableView.heghtRequirement: nEntries: %lu ret: %3.2f", nEntries, ret);
57  return ret + 80.0;
58 }

◆ initWithFrame:andDelegate:()

- (id) initWithFrame: (CGRect)  frame
andDelegate: (id<V3KitchenTableProtocol>)  delegate 

Definition at line 31 of file V3KitchenTableView.m.

31  :(CGRect)frame
32  andDelegate:(id<V3KitchenTableProtocol>)delegate
33 {
34  self = [super initWithFrame:frame];
35  if (self) {
37  kitchenTableMenuItems = [[NSMutableArray alloc] init];
38  focusKitchenGallery = [[memDelegate focusGallery] integerValue];
40 
41  mDateFormatter = [[NSDateFormatter alloc] init];
42  [mDateFormatter setTimeStyle:NSDateFormatterNoStyle];
43  [mDateFormatter setDateStyle:NSDateFormatterMediumStyle];
44 
45  CGRect kitchenTableHeadFrame = CGRectMake(0, 0, self.bounds.size.width - 8.0, 60);
46  kitchenTableHeadView = [[V3GalleryMenuItemControlbarView alloc] initWithFrame:kitchenTableHeadFrame andDelegate:self];
47 
48  }
49  return self;
50 }
int tableRowImageHeight
NSInteger focusKitchenGallery
NSDateFormatter * mDateFormatter
id< V3KitchenTableProtocol > memDelegate
id< U7ParamEditControlDelegate > delegate
V3GalleryMenuItemControlbarView * kitchenTableHeadView
NSMutableArray< MenuItem * > * kitchenTableMenuItems

◆ numberOfComponentsInPickerView:()

- (NSInteger) numberOfComponentsInPickerView: (UIPickerView *)  pickerView
implementation

Definition at line 305 of file V3KitchenTableView.m.

305  :(UIPickerView *)pickerView
306 {
307  return 1;
308 }

◆ numberOfSectionsInTableView:()

- (NSInteger) numberOfSectionsInTableView: (UITableView *)  tableView
implementation

Definition at line 93 of file V3KitchenTableView.m.

93  :(UITableView *)tableView
94 {
95  NSInteger ret = 1;
96  // NSLog(@"V3KitchenTableView.numberOfSectionsInTableView: %ld", (long)ret);
97  return ret;
98 }

◆ pickerView:attributedTitleForRow:forComponent:()

- (NSAttributedString *) pickerView: (UIPickerView *)  pickerView
attributedTitleForRow: (NSInteger)  row
forComponent: (NSInteger)  component 
implementation

Definition at line 258 of file V3KitchenTableView.m.

258  :(UIPickerView *)pickerView
259  attributedTitleForRow:(NSInteger)row
260  forComponent:(NSInteger)component
261 {
262  NSString *txt;
263  if (0 == row) {
264  txt = @"Removed";
265  } else if (1 == row) {
266  txt = @"Available Now";
267  } else if (2 == row) {
268  txt = @"Off-menu Kitchen Recipes";
269  }
270  UIFont *herefont = [UIFont fontWithName:@"Helvetica-Bold" size:18];
271  NSDictionary *attribs = @{
272  NSForegroundColorAttributeName: [UIColor blackColor],
273  NSFontAttributeName: herefont
274  };
275  NSMutableAttributedString *attributedText =
276  [[NSMutableAttributedString alloc] initWithString:txt
277  attributes:attribs];
278  return attributedText;
279 }

◆ pickerView:didSelectRow:inComponent:()

- (void) pickerView: (UIPickerView *)  pickerView
didSelectRow: (NSInteger)  row
inComponent: (NSInteger)  component 
implementation

Definition at line 281 of file V3KitchenTableView.m.

281  :(UIPickerView *)pickerView
282  didSelectRow:(NSInteger)row
283  inComponent:(NSInteger)component
284 {
285  NSLog(@"V3GalleryEdit.didSelectRow: row %ld", (long)row);
286 
287  focusKitchenGallery = row;
288  // initialize class var with all menu items for display by the gallery
289  [self fillDataForGallery:(int)focusKitchenGallery];
290  [self reloadData];
291 
292  [memDelegate sizeKitchenTable];
293 }
NSInteger focusKitchenGallery

◆ pickerView:numberOfRowsInComponent:()

- (NSInteger) pickerView: (UIPickerView *)  pickerView
numberOfRowsInComponent: (NSInteger)  component 
implementation

Definition at line 309 of file V3KitchenTableView.m.

309  :(UIPickerView *)pickerView
310 numberOfRowsInComponent:(NSInteger)component
311 {
312  return 3;
313 }

◆ pickerView:rowHeightForComponent:()

- (CGFloat) pickerView: (UIPickerView *)  pickerView
rowHeightForComponent: (NSInteger)  component 
implementation

Definition at line 252 of file V3KitchenTableView.m.

252  :(UIPickerView *)pickerView
253 rowHeightForComponent:(NSInteger)component
254 {
255  return 48.0;
256 }

◆ tableView:canEditRowAtIndexPath:()

- (BOOL) tableView: (UITableView *)  tableView
canEditRowAtIndexPath: (NSIndexPath *)  indexPath 
implementation

Definition at line 214 of file V3KitchenTableView.m.

214  :(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath {
215  // Return NO if you do not want the specified item to be editable.
216  return YES;
217 }

◆ tableView:canMoveRowAtIndexPath:()

- (BOOL) tableView: (UITableView *)  tableView
canMoveRowAtIndexPath: (NSIndexPath *)  indexPath 
implementation

Definition at line 245 of file V3KitchenTableView.m.

245  :(UITableView *)tableView canMoveRowAtIndexPath:(NSIndexPath *)indexPath {
246  // Return NO if you do not want the item to be re-orderable.
247  return YES;
248 }

◆ tableView:cellForRowAtIndexPath:()

- (nonnull UITableViewCell *) tableView: (nonnull UITableView *)  tableView
cellForRowAtIndexPath: (nonnull NSIndexPath *)  indexPath 
implementation

Definition at line 107 of file V3KitchenTableView.m.

107  :(nonnull UITableView *)tableView cellForRowAtIndexPath:(nonnull NSIndexPath *)indexPath {
108  NSString *cellKey = @"usda-pdata-display";
109  UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:cellKey];
110  // NSLog(@"U3parameterTableView.tableCellForRow: %ld de-Qd cell: %@", (long)[indexPath row], cell);
111  if (cell == nil) {
112 
113  cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:cellKey];
114 
115  // cell.contentView.autoresizingMask = UIViewAutoresizingFlexibleHeight|UIViewAutoresizingFlexibleWidth;
116 
117  CGRect contentRect = [cell.contentView frame];
118  CGRect fetchPublishButton1Frame = CGRectMake(contentRect.size.width - 86.0f, 5.0, 64.0f, contentRect.size.height - 10);
119  UIButton *pushMe = [[UIButton alloc] initWithFrame:fetchPublishButton1Frame];
120  [pushMe setBackgroundColor:[UIColor grayColor]];
121  [pushMe setTitle:@"GO" forState:UIControlStateNormal];
122  [pushMe setTitleColor:[UIColor yellowColor] forState:UIControlStateNormal];
123 
124  [cell.contentView addSubview:pushMe];
125 
126  [cell.layer setCornerRadius:7.0f];
127  [cell.layer setMasksToBounds:YES];
128  [cell.layer setBorderWidth:1.0f];
129 
130  [cell.textLabel setTextColor:[UIColor purpleColor]];
131  [cell.textLabel setOpaque:YES];
132  }
133  [cell setBackgroundColor:[UIColor brownColor]];
134  NSInteger nComponents = [kitchenTableMenuItems count];
135 
136  if (nComponents > [indexPath row]) {
137 
138  MenuItem *item = [kitchenTableMenuItems objectAtIndex:[indexPath row]];
139  NSString *itemName = [item name];
140  [Z5DataController labelizeCell:cell withText:itemName inColor:[UIColor pearlColor] andDetail:nil];
141 
142  } else if (0 == nComponents) {
143  cell.textLabel.text = @"no food data";
144  }
145  NSLog(@"V3KitchenTableView.tableCellForRow: %3.2f", cell.bounds.size.height);
146  return cell;
147 }
Singleton interface to both core and remote data sources.
void labelizeCell:withText:inColor:andDetail:(UITableViewCell *targCell, [withText] NSString *txt, [inColor] UIColor *color, [andDetail] NSString *detailTxt)

◆ tableView:commitEditingStyle:forRowAtIndexPath:()

- (void) tableView: (UITableView *)  tableView
commitEditingStyle: (UITableViewCellEditingStyle)  editingStyle
forRowAtIndexPath: (NSIndexPath *)  indexPath 
implementation

Definition at line 220 of file V3KitchenTableView.m.

220  :(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath {
221  // xxx [tableView beginUpdates];
222 
223  if (editingStyle == UITableViewCellEditingStyleDelete) {
224  // Delete the row from the data source
225  NSInteger rowNo = [indexPath row];
226  MenuItem *removedItem = [kitchenTableMenuItems objectAtIndex:rowNo];
227  [removedItem setGalleryNumber:0];
228 
229  [kitchenTableMenuItems removeObjectAtIndex:rowNo];
230 
231  [tableView deleteRowsAtIndexPaths:@[indexPath] withRowAnimation:UITableViewRowAnimationFade];
232  } else if (editingStyle == UITableViewCellEditingStyleInsert) {
233  // Create a new instance of the appropriate class, insert it into the array, and add a new row to the table view
234  }
235 
236  // xxx [tableView endUpdates];
237 }

◆ tableView:didSelectRowAtIndexPath:()

- (void) tableView: (UITableView *)  tableView
didSelectRowAtIndexPath: (NSIndexPath *)  indexPath 
implementation

Definition at line 167 of file V3KitchenTableView.m.

167  :(UITableView *)tableView
168 didSelectRowAtIndexPath:(NSIndexPath *)indexPath
169 {
170  NSInteger selectSection = [indexPath section];
171  NSInteger selectRow = [indexPath row];
172  NSLog(@"V3GalleryEdit.didSelectRowAtIndexPath: sect: %ld row: %ld", (long)selectSection, (long)selectRow);
173  switch (selectSection) {
174  case 0:
175  {
176  MenuItem *selectedMenuItem = [kitchenTableMenuItems objectAtIndex:selectRow];
177 
178  [memDelegate itemSelected:selectedMenuItem];
179  }
180  break;
181  }
182 }

◆ tableView:heightForHeaderInSection:()

- (CGFloat) tableView: (UITableView *)  tableView
heightForHeaderInSection: (NSInteger)  section 
implementation

Definition at line 196 of file V3KitchenTableView.m.

196  :(UITableView *)tableView heightForHeaderInSection:(NSInteger)section
197 {
198  [kitchenTableHeadView appear:self.bounds];
200 
201  NSLog(@"V3KitchenTableView.heightForHeaderInSection: ret: %3.2f", ret);
202  return ret;
203 }
V3GalleryMenuItemControlbarView * kitchenTableHeadView

◆ tableView:heightForRowAtIndexPath:()

- (CGFloat) tableView: (UITableView *)  tableView
heightForRowAtIndexPath: (NSIndexPath *)  indexPath 
implementation

Definition at line 184 of file V3KitchenTableView.m.

184  :(UITableView *)tableView
185 heightForRowAtIndexPath:(NSIndexPath *)indexPath
186 {
187  CGFloat ret = 42.0;
188  if (tableRowImageHeight > 42) {
189  ret = tableRowImageHeight + 2;
190  }
191  return ret;
192 }
int tableRowImageHeight

◆ tableView:moveRowAtIndexPath:toIndexPath:()

- (void) tableView: (UITableView *)  tableView
moveRowAtIndexPath: (NSIndexPath *)  fromIndexPath
toIndexPath: (NSIndexPath *)  toIndexPath 
implementation

Definition at line 149 of file V3KitchenTableView.m.

149  :(UITableView *)tableView moveRowAtIndexPath:(NSIndexPath *)fromIndexPath toIndexPath:(NSIndexPath *)toIndexPath
150 {
151  switch ([fromIndexPath section]) {
152  case 0:
153  {
154  NSInteger fromRow = [fromIndexPath row];
155  NSInteger toRow = [toIndexPath row];
156  NSLog(@"V3GalleryEdit.moveRowAtIndexPath: from %ld to %ld", (long)fromRow, (long)toRow);
157 
158  MenuItem *menuItem = [kitchenTableMenuItems objectAtIndex:fromRow];
159  [kitchenTableMenuItems removeObjectAtIndex:fromRow];
160  [kitchenTableMenuItems insertObject:menuItem atIndex:toRow];
161  }
162  break;
163  }
164 }
MenuItem * menuItem

◆ tableView:numberOfRowsInSection:()

- (NSInteger) tableView: (UITableView *)  tableView
numberOfRowsInSection: (NSInteger)  section 
implementation

Definition at line 99 of file V3KitchenTableView.m.

99  :(UITableView *)tableView
100  numberOfRowsInSection:(NSInteger)section
101 {
102  NSInteger ret = [kitchenTableMenuItems count];
103  // NSLog(@"V3KitchenTableView.numberOfRowsInSection: section# %ld, rows: %ld", (long)section, (long)ret);
104  return ret;
105 }

◆ tableView:viewForHeaderInSection:()

- (UIView *) tableView: (UITableView *)  tableView
viewForHeaderInSection: (NSInteger)  section 
implementation

Definition at line 204 of file V3KitchenTableView.m.

204  :(UITableView *)tableView viewForHeaderInSection:(NSInteger)section
205 {
206  NSLog(@"V3KitchenTableView.viewForHeaderInSection: section: %ld width: %f", (long)section, self.contentSize.width);
207 
208  return kitchenTableHeadView;
209 }
V3GalleryMenuItemControlbarView * kitchenTableHeadView

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