implemented platform independant clickable OK button on gui combat window when selecting blocker order. removed iOS specific coding.

This commit is contained in:
techdragon.nguyen@gmail.com
2011-12-31 08:21:00 +00:00
parent f93246c75c
commit dfa007cecb
7 changed files with 127 additions and 213 deletions

View File

@@ -6,11 +6,8 @@
BOOL bannerIsVisible;
}
- (void)addOkButtonListener: (CGRect) frame;
@property (nonatomic, retain) id eaglView;
@property (nonatomic, retain) UITextField *inputField;
@property (nonatomic, retain) UIButton *okButtonView;
@property (nonatomic, assign) BOOL bannerIsVisible;
@end

View File

@@ -10,7 +10,6 @@
@synthesize bannerIsVisible;
@synthesize eaglView;
@synthesize okButtonView;
@synthesize inputField;
#pragma mark initialization / deallocation methods
@@ -39,7 +38,6 @@
[eaglView setDelegate: nil];
[eaglView release], eaglView = nil;
[inputField release], inputField = nil;
[okButtonView release], okButtonView = nil;
[super dealloc];
}
@@ -88,31 +86,6 @@
// e.g. self.myOutlet = nil;
}
#pragma mark - UIView Creation
- (void)addOkButtonListener: (CGRect) frame
{
// create an invisible view to handle the pressing of the OK button.
if ( okButtonView == nil )
{
okButtonView = [[UIButton alloc] initWithFrame: frame];
[okButtonView setBackgroundColor: [UIColor clearColor]];
[okButtonView setEnabled: YES];
[okButtonView addTarget: self.view action:@selector(handleOK:) forControlEvents: UIControlEventTouchUpInside];
[self.view addSubview: okButtonView];
}
else
{
[self.view bringSubviewToFront: okButtonView];
}
}
- (void)removeOkButtonListener
{
[[self.view.subviews lastObject] removeFromSuperview];
[okButtonView release], okButtonView = nil;
}
#pragma mark - device orientation handlers
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {

View File

@@ -150,9 +150,6 @@
width: (CGFloat) width
height: (CGFloat) height
{
CGRect uiFrame = CGRectMake(x, y, width, height);
if ( [command isEqualToString: @"okbuttoncreated"] )
[glViewController addOkButtonListener: uiFrame];
}
- (void)handleWEngineCommand:(NSString *) command withParameter: (NSString *) parameter