| OLD | NEW |
| (Empty) | |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #import <Cocoa/Cocoa.h> |
| 6 |
| 7 // Class for buttons that can be drag sources. If the mouse is clicked and moved |
| 8 // more than a given distance, this class will call |-beginDrag:| instead of |
| 9 // |-performClick:|. Subclasses should override these two methods. |
| 10 @interface DraggableButton : NSButton { |
| 11 @private |
| 12 BOOL draggable_; // Is this a draggable type of button? |
| 13 BOOL mayDragStart_; // Set to YES on mouse down, NO on up or drag. |
| 14 BOOL beingDragged_; |
| 15 |
| 16 // Initial mouse-down to prevent a hair-trigger drag. |
| 17 NSPoint initialMouseDownLocation_; |
| 18 } |
| 19 |
| 20 // Enable or disable dragability for special buttons like "Other Bookmarks". |
| 21 @property BOOL draggable; |
| 22 |
| 23 // Called when a drag starts. Subclasses must override this. |
| 24 - (void)beginDrag:(NSEvent*)dragEvent; |
| 25 |
| 26 // Subclasses should call this method to notify DraggableButton when a drag is |
| 27 // over. |
| 28 - (void)endDrag; |
| 29 |
| 30 @end // @interface DraggableButton |
| OLD | NEW |