OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CHROME_BROWSER_COCOA_MENU_BUTTON_H_ | 5 #ifndef CHROME_BROWSER_COCOA_MENU_BUTTON_H_ |
6 #define CHROME_BROWSER_COCOA_MENU_BUTTON_H_ | 6 #define CHROME_BROWSER_COCOA_MENU_BUTTON_H_ |
7 | 7 |
8 #import <Cocoa/Cocoa.h> | 8 #import <Cocoa/Cocoa.h> |
9 | 9 |
10 // This a button which displays a user-provided menu "attached" below it upon | 10 // This a button which displays a user-provided menu "attached" below it upon |
11 // being clicked or dragged (or clicked and held). It expects a | 11 // being clicked or dragged (or clicked and held). It expects a |
12 // |ClickHoldButtonCell| as cell. | 12 // |ClickHoldButtonCell| as cell. |
13 @interface MenuButton : NSButton { | 13 @interface MenuButton : NSButton { |
14 @private | 14 @private |
15 IBOutlet NSMenu* menu_; | 15 IBOutlet NSMenu* attachedMenu_; |
16 } | 16 } |
17 | 17 |
18 // The menu to display. Note that it should have no (i.e., a blank) title and | 18 // The menu to display. Note that it should have no (i.e., a blank) title and |
19 // that the 0-th entry should be blank (and won't be displayed). (This is | 19 // that the 0-th entry should be blank (and won't be displayed). (This is |
20 // because we use a pulldown list, for which Cocoa uses the 0-th item as "title" | 20 // because we use a pulldown list, for which Cocoa uses the 0-th item as "title" |
21 // in the button. This might change if we ever switch to a pop-up. Our direct | 21 // in the button. This might change if we ever switch to a pop-up. Our direct |
22 // use of the given NSMenu object means that the one can set and use NSMenu's | 22 // use of the given NSMenu object means that the one can set and use NSMenu's |
23 // delegate as usual.) | 23 // delegate as usual.) |
24 @property(assign, nonatomic) NSMenu* menu; | 24 @property(assign, nonatomic) NSMenu* attachedMenu; |
25 | 25 |
26 @end // @interface MenuButton | 26 @end // @interface MenuButton |
27 | 27 |
28 #endif // CHROME_BROWSER_COCOA_MENU_BUTTON_H_ | 28 #endif // CHROME_BROWSER_COCOA_MENU_BUTTON_H_ |
OLD | NEW |