Created
September 6, 2010 10:29
-
-
Save benlangfeld/566886 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@implementation TransferDialog : CPPanel | |
{ | |
CPTextField targetURIField; | |
CPButton cancelButton; | |
CPButton transferButton; | |
Call call; | |
} | |
+ (TransferDialog)transferDialogForCall:(Call)aCall | |
{ | |
return [[TransferDialog alloc] initForCall:aCall]; | |
} | |
- (id)initForCall:(Call)aCall | |
{ | |
var self = [super initWithContentRect:CGRectMake(0.0,0.0,400.0,110.0) styleMask:CPTitledWindowMask | CPClosableWindowMask]; | |
if (self) | |
{ | |
call = aCall; | |
// Setup the panel | |
[self setTitle:@"Transfer Call"]; | |
// Setup the TextField | |
targetURIField = [CPTextField textFieldWithStringValue:@"" placeholder:@"Target URI" width:100.0]; | |
[targetURIField setFrameOrigin:CGPointMake(100.0,40.0)]; | |
// Setup the cancel button | |
cancelButton = [CPButton buttonWithTitle:@"Cancel"]; | |
[cancelButton setFrameOrigin:CGPointMake(150.0,80.0)]; | |
[cancelButton setAction:@selector(close)]; | |
[cancelButton setTarget:self]; | |
// Setup the transfer button | |
transferButton = [CPButton buttonWithTitle:@"Transfer"]; | |
[transferButton setFrameOrigin:CGPointMake( | |
CGRectGetMaxX([cancelButton bounds]) + 20.0, | |
CGRectGetMinY([cancelButton bounds]) | |
)]; | |
[transferButton setAction:@selector(transferToTargetURI:)]; | |
[transferButton setTarget:self]; | |
// Add the widgets. | |
[[self contentView] addSubview:targetURIField]; | |
[[self contentView] addSubview:cancelButton]; | |
[[self contentView] addSubview:transferButton]; | |
} | |
return self; | |
} | |
- (void)runModal | |
{ | |
[CPApp runModalForWindow:self]; | |
} | |
- (void)transferToTargetURI:(id)aSender | |
{ | |
[call transferTo:@"test"]; | |
} | |
@end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment