Added keyboard support in view initialization and proper deallocation of keyboard in -(void)dealloc, if keyboard is enabled gsoc2008_iphone
authorHolmes Futrell <hfutrell@umail.ucsb.edu>
Tue, 29 Jul 2008 17:19:23 +0000
branchgsoc2008_iphone
changeset 2405 3d0b3a7d3bea
parent 2404 18cb44c5b221
child 2406 05e8f46403c0
Added keyboard support in view initialization and proper deallocation of keyboard in -(void)dealloc, if keyboard is enabled
src/video/uikit/SDL_uikitview.m
--- a/src/video/uikit/SDL_uikitview.m	Tue Jul 29 17:09:29 2008 +0000
+++ b/src/video/uikit/SDL_uikitview.m	Tue Jul 29 17:19:23 2008 +0000
@@ -19,11 +19,16 @@
  Sam Lantinga
  slouken@libsdl.org
  */
+
 #import "SDL_uikitview.h"
+#import "SDL_uikitkeyboard.h"
 
 @implementation SDL_uikitview
 
 - (void)dealloc {
+#if SDL_IPHONE_KEYBOARD
+	[textField release];
+#endif
 	[super dealloc];
 }
 
@@ -31,13 +36,17 @@
 
 	self = [super initWithFrame: frame];
 	
+#if SDL_IPHONE_KEYBOARD
+	[self initializeKeyboard];
+#endif	
+
 	int i;
 	for (i=0; i<MAX_SIMULTANEOUS_TOUCHES; i++) {
 		mice[i].driverdata = NULL;
 		SDL_AddMouse(&(mice[i]), i);
 	}
 	self.multipleTouchEnabled = YES;
-		
+			
 	return self;
 
 }
@@ -95,8 +104,8 @@
 - (void)touchesCancelled:(NSSet *)touches withEvent:(UIEvent *)event {
 	/*
 		this can happen if the user puts more than 5 touches on the screen
-		at once, or perhaps in other circumstances.  Usually all active
-		touches are canceled.
+		at once, or perhaps in other circumstances.  Usually (it seems)
+		all active touches are canceled.
 	*/
 	[self touchesEnded: touches withEvent: event];
 }
@@ -118,4 +127,6 @@
 	}
 }
 
+
+
 @end