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 24053d0b3a7d3bea
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
     1.1 --- a/src/video/uikit/SDL_uikitview.m	Tue Jul 29 17:09:29 2008 +0000
     1.2 +++ b/src/video/uikit/SDL_uikitview.m	Tue Jul 29 17:19:23 2008 +0000
     1.3 @@ -19,11 +19,16 @@
     1.4   Sam Lantinga
     1.5   slouken@libsdl.org
     1.6   */
     1.7 +
     1.8  #import "SDL_uikitview.h"
     1.9 +#import "SDL_uikitkeyboard.h"
    1.10  
    1.11  @implementation SDL_uikitview
    1.12  
    1.13  - (void)dealloc {
    1.14 +#if SDL_IPHONE_KEYBOARD
    1.15 +	[textField release];
    1.16 +#endif
    1.17  	[super dealloc];
    1.18  }
    1.19  
    1.20 @@ -31,13 +36,17 @@
    1.21  
    1.22  	self = [super initWithFrame: frame];
    1.23  	
    1.24 +#if SDL_IPHONE_KEYBOARD
    1.25 +	[self initializeKeyboard];
    1.26 +#endif	
    1.27 +
    1.28  	int i;
    1.29  	for (i=0; i<MAX_SIMULTANEOUS_TOUCHES; i++) {
    1.30  		mice[i].driverdata = NULL;
    1.31  		SDL_AddMouse(&(mice[i]), i);
    1.32  	}
    1.33  	self.multipleTouchEnabled = YES;
    1.34 -		
    1.35 +			
    1.36  	return self;
    1.37  
    1.38  }
    1.39 @@ -95,8 +104,8 @@
    1.40  - (void)touchesCancelled:(NSSet *)touches withEvent:(UIEvent *)event {
    1.41  	/*
    1.42  		this can happen if the user puts more than 5 touches on the screen
    1.43 -		at once, or perhaps in other circumstances.  Usually all active
    1.44 -		touches are canceled.
    1.45 +		at once, or perhaps in other circumstances.  Usually (it seems)
    1.46 +		all active touches are canceled.
    1.47  	*/
    1.48  	[self touchesEnded: touches withEvent: event];
    1.49  }
    1.50 @@ -118,4 +127,6 @@
    1.51  	}
    1.52  }
    1.53  
    1.54 +
    1.55 +
    1.56  @end