| 1 |
@class CocoaListViewContent; |
| 2 |
|
| 3 |
@interface CocoaListView : NSScrollView <NSTableViewDelegate, NSTableViewDataSource> { |
| 4 |
@public |
| 5 |
phoenix::ListView* listView; |
| 6 |
CocoaListViewContent* content; |
| 7 |
NSFont* font; |
| 8 |
} |
| 9 |
-(id) initWith:(phoenix::ListView&)listView; |
| 10 |
-(void) dealloc; |
| 11 |
-(CocoaListViewContent*) content; |
| 12 |
-(NSFont*) font; |
| 13 |
-(void) setFont:(NSFont*)font; |
| 14 |
-(void) reloadColumns; |
| 15 |
-(NSInteger) numberOfRowsInTableView:(NSTableView*)table; |
| 16 |
-(id) tableView:(NSTableView*)table objectValueForTableColumn:(NSTableColumn*)tableColumn row:(NSInteger)row; |
| 17 |
-(BOOL) tableView:(NSTableView*)table shouldShowCellExpansionForTableColumn:(NSTableColumn*)tableColumn row:(NSInteger)row; |
| 18 |
-(NSString*) tableView:(NSTableView*)table toolTipForCell:(NSCell*)cell rect:(NSRectPointer)rect tableColumn:(NSTableColumn*)tableColumn row:(NSInteger)row mouseLocation:(NSPoint)mouseLocation; |
| 19 |
-(void) tableView:(NSTableView*)table setObjectValue:(id)object forTableColumn:(NSTableColumn*)tableColumn row:(NSInteger)row; |
| 20 |
-(void) tableView:(NSTableView*)tableView willDisplayCell:(id)cell forTableColumn:(NSTableColumn*)tableColumn row:(NSInteger)row; |
| 21 |
-(void) tableViewSelectionDidChange:(NSNotification*)notification; |
| 22 |
-(IBAction) activate:(id)sender; |
| 23 |
-(IBAction) doubleAction:(id)sender; |
| 24 |
@end |
| 25 |
|
| 26 |
@interface CocoaListViewContent : NSTableView { |
| 27 |
} |
| 28 |
-(void) keyDown:(NSEvent*)event; |
| 29 |
@end |
| 30 |
|
| 31 |
@interface CocoaListViewCell : NSTextFieldCell { |
| 32 |
} |
| 33 |
-(NSString*) stringValue; |
| 34 |
-(void) drawWithFrame:(NSRect)frame inView:(NSView*)view; |
| 35 |
@end |
| 36 |
|
| 37 |
namespace phoenix { |
| 38 |
|
| 39 |
struct pListView : public pWidget { |
| 40 |
ListView& listView; |
| 41 |
CocoaListView* cocoaListView = nullptr; |
| 42 |
|
| 43 |
void append(const lstring& text); |
| 44 |
void autoSizeColumns(); |
| 45 |
void remove(unsigned selection); |
| 46 |
void reset(); |
| 47 |
void setCheckable(bool checkable); |
| 48 |
void setChecked(unsigned selection, bool checked); |
| 49 |
void setFont(string font); |
| 50 |
void setHeaderText(const lstring& text); |
| 51 |
void setHeaderVisible(bool visible); |
| 52 |
void setImage(unsigned selection, unsigned position, const image& image); |
| 53 |
void setSelected(bool selected); |
| 54 |
void setSelection(unsigned selection); |
| 55 |
void setText(unsigned selection, unsigned position, string text); |
| 56 |
|
| 57 |
pListView(ListView& listView) : pWidget(listView), listView(listView) {} |
| 58 |
void constructor(); |
| 59 |
void destructor(); |
| 60 |
}; |
| 61 |
|
| 62 |
} |