| | 94 | * @brief If escape or return are pressed inside one of our text views, pass the action on to our buttons |
|---|
| | 95 | */ |
|---|
| | 96 | - (BOOL)textView:(NSTextView *)aTextView doCommandBySelector:(SEL)aSelector |
|---|
| | 97 | { |
|---|
| | 98 | NSButton *equivalentButton = nil; |
|---|
| | 99 | |
|---|
| | 100 | if (aSelector == @selector(cancelOperation:)) { |
|---|
| | 101 | equivalentButton = button_cancel; |
|---|
| | 102 | |
|---|
| | 103 | } else if ((aSelector == @selector(insertNewline:)) || (aSelector == @selector(insertNewlineIgnoringFieldEditor:))) { |
|---|
| | 104 | equivalentButton = button_okay; |
|---|
| | 105 | } |
|---|
| | 106 | |
|---|
| | 107 | if (equivalentButton) { |
|---|
| | 108 | [equivalentButton performClick:aTextView]; |
|---|
| | 109 | return YES; |
|---|
| | 110 | |
|---|
| | 111 | } else { |
|---|
| | 112 | return NO; |
|---|
| | 113 | } |
|---|
| | 114 | } |
|---|
| | 115 | |
|---|
| | 116 | /*! |
|---|