-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathSSYPopUpTableHeaderCell.h
63 lines (45 loc) · 1.78 KB
/
SSYPopUpTableHeaderCell.h
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
53
54
55
56
57
58
59
60
61
62
63
#import <Cocoa/Cocoa.h>
#if DEBUG
#define LOG_UNREAL_SSY_POP_UP_TABLE_HEADER_CELLS 1
#endif
enum SSYPopupTableHeaderCellSortState_enum {
SSYPopupTableHeaderCellSortStateNotSorted = 0,
SSYPopupTableHeaderCellSortStateSortedAscending = 1,
SSYPopupTableHeaderCellSortStateSortedDescending = 2
} ;
typedef enum SSYPopupTableHeaderCellSortState_enum SSYPopupTableHeaderCellSortState ;
@protocol SSYPopupTableHeaderSortableColumn
- (void)sortAsAscending:(BOOL)ascending ;
- (NSFont*)headerFont ;
@end
@protocol SSYPopupTableHeaderCellTableSortableOrNot
- (BOOL)sortable ;
@end
/*!
@brief A table header cell that is a popup menu!
@details This class is based on Keith Blount's original work
http://www.cocoabuilder.com/archive/message/cocoa/2005/4/16/133285
or http://lists.apple.com/archives/cocoa-dev/2005/Apr/msg01223.html
but I've made enough improvements to it that I decided it deserves
to have my own SSY prefix.
*/
@interface SSYPopUpTableHeaderCell : NSPopUpButtonCell {
CGFloat lostWidth ;
}
/*!
@brief The width on the right side of the column header which
is not available for menu text because it is used by the popup arrows if used,
sorting controls if used, and whitespace to the right of the arrows.
*/
@property (readonly) CGFloat lostWidth ;
@property (assign) BOOL isUserDefined ;
/*!
@brief If not nil, the receiver behaves like a plain table header cell,
with no popup menu, but with a blue/black sort control, to match the
blue/black sort control of SSYPopUpTableHeaderCell that have popup menus.
@details Set this if you have a column in a table of user-defined popup
columns which you do *not* want to have a user-definfed popup menu.
*/
@property (copy) NSString* fixedNonMenuTitle ;
@property SSYPopupTableHeaderCellSortState sortState ;
@end