@class CocoaListViewContent; @interface CocoaListView : NSScrollView { @public phoenix::ListView* listView; CocoaListViewContent* content; NSFont* font; } -(id) initWith:(phoenix::ListView&)listView; -(void) dealloc; -(CocoaListViewContent*) content; -(NSFont*) font; -(void) setFont:(NSFont*)font; -(void) reloadColumns; -(NSInteger) numberOfRowsInTableView:(NSTableView*)table; -(id) tableView:(NSTableView*)table objectValueForTableColumn:(NSTableColumn*)tableColumn row:(NSInteger)row; -(BOOL) tableView:(NSTableView*)table shouldShowCellExpansionForTableColumn:(NSTableColumn*)tableColumn row:(NSInteger)row; -(NSString*) tableView:(NSTableView*)table toolTipForCell:(NSCell*)cell rect:(NSRectPointer)rect tableColumn:(NSTableColumn*)tableColumn row:(NSInteger)row mouseLocation:(NSPoint)mouseLocation; -(void) tableView:(NSTableView*)table setObjectValue:(id)object forTableColumn:(NSTableColumn*)tableColumn row:(NSInteger)row; -(void) tableView:(NSTableView*)tableView willDisplayCell:(id)cell forTableColumn:(NSTableColumn*)tableColumn row:(NSInteger)row; -(void) tableViewSelectionDidChange:(NSNotification*)notification; -(IBAction) activate:(id)sender; -(IBAction) doubleAction:(id)sender; @end @interface CocoaListViewContent : NSTableView { } -(void) keyDown:(NSEvent*)event; @end @interface CocoaListViewCell : NSTextFieldCell { } -(NSString*) stringValue; -(void) drawWithFrame:(NSRect)frame inView:(NSView*)view; @end namespace phoenix { struct pListView : public pWidget { ListView& listView; CocoaListView* cocoaListView = nullptr; void append(const lstring& text); void autoSizeColumns(); bool checked(unsigned row); void modify(unsigned row, const lstring& text); void remove(unsigned row); void reset(); bool selected(); unsigned selection(); void setCheckable(bool checkable); void setChecked(unsigned row, bool checked); void setFont(string font); void setHeaderText(const lstring& text); void setHeaderVisible(bool visible); void setImage(unsigned row, unsigned column, const image& image); void setSelected(bool selected); void setSelection(unsigned row); pListView(ListView& listView) : pWidget(listView), listView(listView) {} void constructor(); void destructor(); }; }