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

#import <V3GalleryEditTableViewController.h>

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

Instance Methods

(void) - viewDidLoad [implementation]
 
(void) - viewWillAppear: [implementation]
 
(void) - sizeKitchenTable [implementation]
 
(void) - viewWillDisappear: [implementation]
 
(void) - itemSelected: [implementation]
 
(void) - clickPlusButton [implementation]
 
(NSInteger) - getKitchenFocusGallery [implementation]
 
(void) - didReceiveMemoryWarning [implementation]
 
(void) - editDoneButtonHit [implementation]
 
(NSInteger) - numberOfComponentsInPickerView: [implementation]
 
(NSInteger) - pickerView:numberOfRowsInComponent: [implementation]
 

Properties

< V3KitchenTableProtocol, V3GalleryMenuItemControlbarProtocol > NSNumber * focusGallery
 

Detailed Description

Gallery Edit Controller

This bunch of modules provides for editting the menu item stack presented.

dot_inline_dotgraph_9.png

Y4NutritionViewController

dot_inline_dotgraph_10.png

Z6MenuPanoramaView

dot_inline_dotgraph_11.png

Production of collection view cells

msc_inline_mscgraph_3

The containing view object takes care of the CollectionViewDelegate and CollectionViewDataSource requirements, the ViewController is only informed of digested commands (eg. menu item clicked)

Definition at line 13 of file V3GalleryEditTableViewController.h.

Method Documentation

◆ clickPlusButton()

- (void) clickPlusButton
implementation

Definition at line 221 of file V3GalleryEditTableViewController.m.

222 {
223  NSLog(@"V3GalleryEditTableViewController.clickPlusButton");
225  [[self navigationController] pushViewController:vc3 animated:YES];
226 }

◆ didReceiveMemoryWarning()

- (void) didReceiveMemoryWarning
implementation

Definition at line 233 of file V3GalleryEditTableViewController.m.

233  {
234  [super didReceiveMemoryWarning];
235  // Dispose of any resources that can be recreated.
236 }

◆ editDoneButtonHit()

- (void) editDoneButtonHit
implementation

Definition at line 238 of file V3GalleryEditTableViewController.m.

239 {
241  [self setEditing:editModeBool];
242  if (!editModeBool) {
243  // editting complete, update database
244 
245  }
246 }

◆ getKitchenFocusGallery()

- (NSInteger) getKitchenFocusGallery
implementation

Definition at line 228 of file V3GalleryEditTableViewController.m.

228  {
229  return [_focusGallery integerValue];
230 }

◆ itemSelected:()

- (void) itemSelected: (MenuItem *)  selectedMenuItem
implementation

Definition at line 215 of file V3GalleryEditTableViewController.m.

215  :(MenuItem *)selectedMenuItem
216 {
217  U7UsdaParamEntryViewController *recipeView =
218  [[U7UsdaParamEntryViewController alloc] initWithMenuItem:selectedMenuItem];
219  [self.navigationController pushViewController:recipeView animated:YES];
220 }

◆ numberOfComponentsInPickerView:()

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

Definition at line 252 of file V3GalleryEditTableViewController.m.

252  :(nonnull UIPickerView *)pickerView {
253  NSLog(@"V3GalleryEditTableViewController.numberOfComponentsInPickerView: should not be data source");
254  return 1;
255 }

◆ pickerView:numberOfRowsInComponent:()

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

Definition at line 257 of file V3GalleryEditTableViewController.m.

257  :(nonnull UIPickerView *)pickerView numberOfRowsInComponent:(NSInteger)component {
258  NSLog(@"V3GalleryEditTableViewController.numberOfRowsInComponent: should not be data source");
259  return 3;
260 
261 }

◆ sizeKitchenTable()

- (void) sizeKitchenTable
implementation

Definition at line 196 of file V3GalleryEditTableViewController.m.

197 {
198  kitchenTableViewHeight = [galleryEditTableView heightRequirement];
199  CGRect tableViewFrame = CGRectMake(4.0, kitchenTableViewTop, galleryEditOverallSize.width - 8.0, kitchenTableViewHeight);
200  [galleryEditTableView setFrame:tableViewFrame];
201 }

◆ viewDidLoad()

- (void) viewDidLoad
implementation

Definition at line 141 of file V3GalleryEditTableViewController.m.

141  {
142  [super viewDidLoad];
143 
144  self.title = @"Kitchen";
145 
146  _focusGallery = [NSNumber numberWithInteger:1];
147 
148  [mDateFormatter setDateStyle:NSDateFormatterNoStyle];
149  [mDateFormatter setTimeStyle:NSDateFormatterMediumStyle];
150 
151 
152  // fetch, scale, and add a subview background image
153  UIImage *backgrdImage = [UIImage imageNamed:@"szmaniasKitchen.png"];
154  CGSize photoSize = [backgrdImage size];
155  CGRect totalFrame = self.view.frame;
156  galleryEditOverallSize = totalFrame.size;
157  float resizeRatio = photoSize.height / totalFrame.size.height;
158  UIImage *resizedImage = [UIImage imageWithCGImage:[backgrdImage CGImage]
159  scale:backgrdImage.scale * resizeRatio
160  orientation:(backgrdImage.imageOrientation) ];
161  UIImageView *backgrd = [[UIImageView alloc] initWithImage:resizedImage];
162  [self.view addSubview:backgrd];
163  // end - fetch, scale, and add a subview background image
164 
165  CGRect topNavigationFrame = [[[self navigationController]
166  navigationBar] frame];
167  kitchenTableViewTop = topNavigationFrame.origin.y + topNavigationFrame.size.height + 4.0 + 60.0;
169  CGRect tableViewFrame = CGRectMake(4.0, kitchenTableViewTop, galleryEditOverallSize.width - 8.0, kitchenTableViewHeight);
170 
171  galleryEditTableView = [[V3KitchenTableView alloc] initWithFrame: tableViewFrame andDelegate:self];
172 
173  keylimePie = [UIColor keylimePieColor];
174  [galleryEditTableView setBackgroundColor:keylimePie];
175  [self.view addSubview:galleryEditTableView];
176 
177  cellBackgroundColor = [UIColor colorWithRed:0.8f green:1.0f blue:1.0f alpha:1.0f];
178 
179  editModeBool = NO;
180 
181  self.navigationItem.rightBarButtonItem = self.editButtonItem;
182 
183  // Uncomment the following line to preserve selection between presentations.
184  // self.clearsSelectionOnViewWillAppear = NO;
185 }

◆ viewWillAppear:()

- (void) viewWillAppear: (BOOL)  animated
implementation

Definition at line 187 of file V3GalleryEditTableViewController.m.

187  :(BOOL)animated
188 {
189  [super viewWillAppear:animated];
190 
191  [galleryEditTableView appear:self.view.bounds];
192  [galleryEditTableView reloadData];
193 
194  [self sizeKitchenTable];
195 }

◆ viewWillDisappear:()

- (void) viewWillDisappear: (BOOL)  animated
implementation

Definition at line 202 of file V3GalleryEditTableViewController.m.

202  :(BOOL)animated
203 {
204  Z5LocalDataController *localData = [[Z5DataController sharedInstance] localDataController];
205 
206  NSRange initRange = NSMakeRange(10, 0);
207  [localData initGalleryPositionsRange:initRange];
208  for (MenuItem *mItem in menuItems) {
209  [mItem setGalleryPositionNo:[NSNumber numberWithInteger:[localData getNextGalleryPositionIdx]]];
210  }
211  [localData saveContext];
212 }
instancetype sharedInstance()
void initGalleryPositionsRange:(NSRange fetchAllRange)
Singleton interface to both core and remote data sources.

Property Documentation

◆ focusGallery

- (<V3KitchenTableProtocol, V3GalleryMenuItemControlbarProtocol> NSNumber*) focusGallery
readwritenonatomicstrong

Definition at line 17 of file V3GalleryEditTableViewController.h.


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