-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMovePanelController.j
52 lines (43 loc) · 1.1 KB
/
MovePanelController.j
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
// (c) 2010-2011 by Anton Korenyushkin
@import "PanelController.j"
@import "Alert.j"
@implementation MovePanelController : PanelController
{
id target;
SEL action;
@outlet CPTextField moveLabel;
@outlet CPTextField pathField;
@outlet CPButton moveButton;
}
- (id)initWithTarget:(id)aTarget action:(SEL)anAction // public
{
if (self = [super initWithWindowCibName:"MovePanel"]) {
target = aTarget;
action = anAction;
}
return self;
}
- (void)awakeFromCib // private
{
[moveButton setKeyEquivalent:CPCarriageReturnCharacter];
}
- (void)showWindowWithDescription:(CPString)description // public
{
[CPApp runModalForWindow:[self window]];
[moveLabel setStringValue:"Move the " + description + " to:"];
[pathField setStringValue:""];
[moveButton setEnabled:NO];
}
- (void)controlTextDidChange:(id)sender // private
{
[moveButton setEnabled:[pathField stringValue]];
}
- (@action)submit:(id)sender // private
{
objj_msgSend(target, action, [pathField stringValue]);
}
- (void)windowWillClose:(id)sender // private
{
[CPApp stopModal];
}
@end