2015-12-30 06:41:46 +00:00
|
|
|
#if defined(Hiro_ListView)
|
|
|
|
|
2013-03-15 13:11:33 +00:00
|
|
|
@class CocoaListViewContent;
|
|
|
|
|
|
|
|
@interface CocoaListView : NSScrollView <NSTableViewDelegate, NSTableViewDataSource> {
|
|
|
|
@public
|
2015-12-30 06:41:46 +00:00
|
|
|
hiro::mListView* listView;
|
2013-05-02 11:25:45 +00:00
|
|
|
CocoaListViewContent* content;
|
|
|
|
NSFont* font;
|
2013-03-15 13:11:33 +00:00
|
|
|
}
|
2015-12-30 06:41:46 +00:00
|
|
|
-(id) initWith:(hiro::mListView&)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
|
|
|
|
|
2015-12-30 06:41:46 +00:00
|
|
|
namespace hiro {
|
2013-03-15 13:11:33 +00:00
|
|
|
|
2015-12-30 06:41:46 +00:00
|
|
|
struct pListView : pWidget {
|
|
|
|
Declare(ListView, Widget)
|
2013-03-15 13:11:33 +00:00
|
|
|
|
2015-12-30 06:41:46 +00:00
|
|
|
auto append(sListViewHeader header) -> void;
|
|
|
|
auto append(sListViewItem item) -> void;
|
|
|
|
auto remove(sListViewHeader header) -> void;
|
|
|
|
auto remove(sListViewItem item) -> void;
|
|
|
|
auto resizeColumns() -> void;
|
|
|
|
auto setAlignment(Alignment alignment) -> void;
|
|
|
|
auto setBackgroundColor(Color color) -> void;
|
|
|
|
auto setBatchable(bool batchable) -> void;
|
|
|
|
auto setBordered(bool bordered) -> void;
|
|
|
|
auto setFont(const Font& font) -> void override;
|
|
|
|
auto setForegroundColor(Color color) -> void;
|
2013-03-15 13:11:33 +00:00
|
|
|
|
2015-12-30 06:41:46 +00:00
|
|
|
CocoaListView* cocoaListView = nullptr;
|
2013-03-15 13:11:33 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|
2015-12-30 06:41:46 +00:00
|
|
|
|
|
|
|
#endif
|