2013-03-15 13:11:33 +00:00
|
|
|
@class CocoaListViewContent;
|
|
|
|
|
|
|
|
@interface CocoaListView : NSScrollView <NSTableViewDelegate, NSTableViewDataSource> {
|
|
|
|
@public
|
|
|
|
phoenix::ListView *listView;
|
|
|
|
CocoaListViewContent *content;
|
|
|
|
NSFont *font;
|
|
|
|
}
|
2013-03-21 12:59:01 +00:00
|
|
|
-(id) initWith:(phoenix::ListView&)listView;
|
2013-03-15 13:11:33 +00:00
|
|
|
-(void) dealloc;
|
|
|
|
-(CocoaListViewContent*) content;
|
|
|
|
-(NSFont*) font;
|
2013-03-21 12:59:01 +00:00
|
|
|
-(void) setFont:(NSFont*)font;
|
2013-03-15 13:11:33 +00:00
|
|
|
-(void) reloadColumns;
|
2013-03-21 12:59:01 +00:00
|
|
|
-(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;
|
2013-03-15 13:11:33 +00:00
|
|
|
@end
|
|
|
|
|
|
|
|
@interface CocoaListViewContent : NSTableView {
|
|
|
|
}
|
2013-03-21 12:59:01 +00:00
|
|
|
-(void) keyDown:(NSEvent*)event;
|
2013-03-15 13:11:33 +00:00
|
|
|
@end
|
|
|
|
|
|
|
|
@interface CocoaListViewCell : NSTextFieldCell {
|
|
|
|
}
|
|
|
|
-(NSString*) stringValue;
|
2013-03-21 12:59:01 +00:00
|
|
|
-(void) drawWithFrame:(NSRect)frame inView:(NSView*)view;
|
2013-03-15 13:11:33 +00:00
|
|
|
@end
|
|
|
|
|
|
|
|
namespace phoenix {
|
|
|
|
|
|
|
|
struct pListView : public pWidget {
|
|
|
|
ListView &listView;
|
2013-03-21 12:59:01 +00:00
|
|
|
CocoaListView *cocoaListView = nullptr;
|
2013-03-15 13:11:33 +00:00
|
|
|
|
|
|
|
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(const 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();
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|