c5aeccd8ba
git-svn-id: http://skia.googlecode.com/svn/trunk@1879 2bbb7eff-a529-9590-31e7-b0007b416f81
48 lines
1.2 KiB
Objective-C
48 lines
1.2 KiB
Objective-C
//
|
|
// SkAlertPrompt.m
|
|
// iOSSampleApp
|
|
//
|
|
// Created by Yang Su on 7/6/11.
|
|
// Copyright 2011 Google Inc. All rights reserved.
|
|
//
|
|
|
|
#import "SkAlertPrompt.h"
|
|
|
|
@implementation SkAlertPrompt
|
|
@synthesize textField;
|
|
|
|
- (id)initWithTitle:(NSString *)title
|
|
message:(NSString *)message
|
|
delegate:(id)delegate
|
|
cancelButtonTitle:(NSString *)cancelButtonTitle
|
|
otherButtonTitles:(NSString *)okayButtonTitle,... {
|
|
if (self = [super initWithTitle:title
|
|
message:message
|
|
delegate:delegate
|
|
cancelButtonTitle:cancelButtonTitle
|
|
otherButtonTitles:okayButtonTitle, nil]) {
|
|
self.textField = [[UITextField alloc]
|
|
initWithFrame:CGRectMake(12, 45, 260, 25)];
|
|
[self.textField setBackgroundColor:[UIColor whiteColor]];
|
|
textField.borderStyle = UITextBorderStyleLine;
|
|
[self addSubview:self.textField];
|
|
}
|
|
return self;
|
|
}
|
|
|
|
- (void)show {
|
|
[textField becomeFirstResponder];
|
|
[super show];
|
|
}
|
|
|
|
- (NSString *)enteredText {
|
|
return textField.text;
|
|
}
|
|
|
|
- (void)dealloc {
|
|
[textField release];
|
|
[super dealloc];
|
|
}
|
|
|
|
@end
|