quakeforge/ruamoko/qwaq/ui/tableview.h
Bill Currie a1f67b5d6f [qwaq] Implement a very simple table view class
It's nowhere near as sophisticated as NSTableView, but this is text, not
graphics.
2020-03-31 14:40:22 +09:00

44 lines
891 B
Objective-C

#ifndef __qwaq_ui_tableview_h
#define __qwaq_ui_tableview_h
#include "ui/view.h"
@class DrawBuffer;
@class TableView;
@class TableViewColumn;
@class Array;
@protocol TableViewDataSource
-(int)numberOfRows:(TableView *)tableview;
-(View *)tableView:(TableView *)tableView
forColumn:(TableViewColumn *)column
row:(int)row;
-retain;
-release;
@end
@interface TableViewColumn : Object
{
string name;
int width;
}
+(TableViewColumn *)named:(string)name;
+(TableViewColumn *)named:(string)name width:(int)width;
-(string)name;
-(int)width;
@end
@interface TableView : View
{
Array *columns;
DrawBuffer *buffer;
int columns_dirty;
id<TableViewDataSource> dataSource;
Point base;
}
+(TableView *)withRect:(Rect)rect;
-addColumn:(TableViewColumn *)column;
-setDataSource:(id<TableViewDataSource>)dataSource;
@end
#endif//__qwaq_ui_tableview_h