Permalink
Browse files

Adding missing files

  • Loading branch information...
1 parent 657d9fa commit 9cf0d3e671b40fe0cd3d6696318e1e0b9c7ecc7c @cruffenach cruffenach committed Jan 4, 2011
View
2 ,
@@ -0,0 +1,2 @@
+.DS_Store
+/build
View
@@ -0,0 +1,2 @@
+.DS_Store
+/build
@@ -0,0 +1,21 @@
+//
+// ELCTextFieldCellDemoAppDelegate.h
+// ELCTextFieldCellDemo
+//
+// Created by Collin Ruffenach on 1/4/11.
+// Copyright 2011 ELC Technologies. All rights reserved.
+//
+
+#import <UIKit/UIKit.h>
+
+@interface ELCTextFieldCellDemoAppDelegate : NSObject <UIApplicationDelegate> {
+
+ UIWindow *window;
+ UINavigationController *navigationController;
+}
+
+@property (nonatomic, retain) IBOutlet UIWindow *window;
+@property (nonatomic, retain) IBOutlet UINavigationController *navigationController;
+
+@end
+
@@ -0,0 +1,90 @@
+//
+// ELCTextFieldCellDemoAppDelegate.m
+// ELCTextFieldCellDemo
+//
+// Created by Collin Ruffenach on 1/4/11.
+// Copyright 2011 ELC Technologies. All rights reserved.
+//
+
+#import "ELCTextFieldCellDemoAppDelegate.h"
+#import "RootViewController.h"
+
+
+@implementation ELCTextFieldCellDemoAppDelegate
+
+@synthesize window;
+@synthesize navigationController;
+
+
+#pragma mark -
+#pragma mark Application lifecycle
+
+- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
+
+ // Override point for customization after application launch.
+
+ // Add the navigation controller's view to the window and display.
+ [self.window addSubview:navigationController.view];
+ [self.window makeKeyAndVisible];
+
+ return YES;
+}
+
+
+- (void)applicationWillResignActive:(UIApplication *)application {
+ /*
+ Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
+ Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game.
+ */
+}
+
+
+- (void)applicationDidEnterBackground:(UIApplication *)application {
+ /*
+ Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.
+ If your application supports background execution, called instead of applicationWillTerminate: when the user quits.
+ */
+}
+
+
+- (void)applicationWillEnterForeground:(UIApplication *)application {
+ /*
+ Called as part of transition from the background to the inactive state: here you can undo many of the changes made on entering the background.
+ */
+}
+
+
+- (void)applicationDidBecomeActive:(UIApplication *)application {
+ /*
+ Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
+ */
+}
+
+
+- (void)applicationWillTerminate:(UIApplication *)application {
+ /*
+ Called when the application is about to terminate.
+ See also applicationDidEnterBackground:.
+ */
+}
+
+
+#pragma mark -
+#pragma mark Memory management
+
+- (void)applicationDidReceiveMemoryWarning:(UIApplication *)application {
+ /*
+ Free up as much memory as possible by purging cached data objects that can be recreated (or reloaded from disk) later.
+ */
+}
+
+
+- (void)dealloc {
+ [navigationController release];
+ [window release];
+ [super dealloc];
+}
+
+
+@end
+
@@ -0,0 +1,32 @@
+//
+// ELCTextfieldCell.h
+// MobileWorkforce
+//
+// Created by Collin Ruffenach on 10/22/10.
+// Copyright 2010 ELC Tech. All rights reserved.
+//
+
+#import <UIKit/UIKit.h>
+
+
+@interface ELCTextfieldCell : UITableViewCell <UITextFieldDelegate> {
+
+ id delegate;
+ UILabel *leftLabel;
+ UITextField *rightTextField;
+ NSIndexPath *indexPath;
+}
+
+@property (nonatomic, assign) id delegate;
+@property (nonatomic, retain) UILabel *leftLabel;
+@property (nonatomic, retain) UITextField *rightTextField;
+@property (nonatomic, retain) NSIndexPath *indexPath;
+
+@end
+
+@protocol ELCTextFieldDelegate
+
+-(void)textFieldDidReturnWithIndexPath:(NSIndexPath*)_indexPath;
+-(void)updateTextLabelAtIndexPath:(NSIndexPath*)_indexPath string:(NSString*)_string;
+
+@end
@@ -0,0 +1,115 @@
+//
+// ELCTextfieldCell.m
+// MobileWorkforce
+//
+// Created by Collin Ruffenach on 10/22/10.
+// Copyright 2010 ELC Tech. All rights reserved.
+//
+
+#import "ELCTextfieldCell.h"
+
+
+@implementation ELCTextfieldCell
+
+@synthesize delegate;
+@synthesize leftLabel;
+@synthesize rightTextField;
+@synthesize indexPath;
+
+- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
+
+ if ((self = [super initWithStyle:style reuseIdentifier:reuseIdentifier])) {
+
+ leftLabel = [[UILabel alloc] initWithFrame:CGRectZero];
+ [leftLabel setBackgroundColor:[UIColor clearColor]];
+ [leftLabel setTextColor:[UIColor colorWithRed:.285 green:.376 blue:.541 alpha:1]];
+ [leftLabel setFont:[UIFont fontWithName:@"Helvetica" size:12]];
+ [leftLabel setTextAlignment:UITextAlignmentRight];
+ [leftLabel setText:@"Left Field"];
+ [self addSubview:leftLabel];
+
+ rightTextField = [[UITextField alloc] initWithFrame:CGRectZero];
+ rightTextField.contentVerticalAlignment = UIControlContentVerticalAlignmentCenter;
+ [rightTextField setDelegate:self];
+ [rightTextField setPlaceholder:@"Right Field"];
+ [rightTextField setFont:[UIFont systemFontOfSize:17]];
+
+ // FOR MWF USE DONE
+ [rightTextField setReturnKeyType:UIReturnKeyDone];
+
+ [self addSubview:rightTextField];
+ }
+
+ return self;
+}
+
+//Layout our fields in case of a layoutchange (fix for iPad doing strange things with margins if width is > 400)
+- (void)layoutSubviews {
+ [super layoutSubviews];
+ CGRect origFrame = self.contentView.frame;
+ if (leftLabel.text != nil) {
+ leftLabel.frame = CGRectMake(origFrame.origin.x, origFrame.origin.y, 90, origFrame.size.height-1);
+ rightTextField.frame = CGRectMake(origFrame.origin.x+105, origFrame.origin.y, origFrame.size.width-120, origFrame.size.height-1);
+ } else {
+ leftLabel.hidden = YES;
+ NSInteger imageWidth = 0;
+ if (self.imageView.image != nil) {
+ imageWidth = self.imageView.image.size.width + 5;
+ }
+ rightTextField.frame = CGRectMake(origFrame.origin.x+imageWidth+10, origFrame.origin.y, origFrame.size.width-imageWidth-20, origFrame.size.height-1);
+ }
+}
+
+- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
+
+ [super setSelected:selected animated:animated];
+}
+
+- (BOOL)textFieldShouldReturn:(UITextField *)textField {
+
+ if([delegate respondsToSelector:@selector(textFieldDidReturnWithIndexPath:)]) {
+
+ [delegate performSelector:@selector(textFieldDidReturnWithIndexPath:) withObject:indexPath];
+ }
+
+ return YES;
+}
+
+- (BOOL) textField:(UITextField *)textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string {
+
+ NSString *textString = self.rightTextField.text;
+
+ if (range.length > 0) {
+
+ textString = [textString stringByReplacingCharactersInRange:range withString:@""];
+ }
+
+ else {
+
+ if(range.location == [textString length]) {
+
+ textString = [textString stringByAppendingString:string];
+ }
+
+ else {
+
+ textString = [textString stringByReplacingCharactersInRange:range withString:string];
+ }
+ }
+
+ if([delegate respondsToSelector:@selector(updateTextLabelAtIndexPath:string:)]) {
+ [delegate performSelector:@selector(updateTextLabelAtIndexPath:string:) withObject:indexPath withObject:textString];
+ }
+
+ return YES;
+}
+
+- (void)dealloc {
+
+ [leftLabel release];
+ [rightTextField release];
+ [indexPath release];
+ [super dealloc];
+}
+
+@end
@@ -0,0 +1,21 @@
+//
+// RootViewController.h
+// ELCTextFieldCellDemo
+//
+// Created by Collin Ruffenach on 1/4/11.
+// Copyright 2011 ELC Technologies. All rights reserved.
+//
+
+#import <UIKit/UIKit.h>
+#import "ELCTextfieldCell.h"
+
+@interface RootViewController : UITableViewController <ELCTextFieldDelegate> {
+
+ NSArray *labels;
+ NSArray *placeholders;
+}
+
+@property (nonatomic, retain) NSArray *labels;
+@property (nonatomic, retain) NSArray *placeholders;
+
+@end
Oops, something went wrong.

0 comments on commit 9cf0d3e

Please sign in to comment.