2020-03-31 01:55:39 +00:00
|
|
|
#ifndef __qwaq_ui_tableview_h
|
|
|
|
#define __qwaq_ui_tableview_h
|
|
|
|
|
2020-06-21 14:15:17 +00:00
|
|
|
#include "ruamoko/qwaq/ui/view.h"
|
2020-03-31 01:55:39 +00:00
|
|
|
|
|
|
|
@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;
|
2020-03-31 13:03:56 +00:00
|
|
|
int growMode; // Y flags ignored
|
2020-03-31 01:55:39 +00:00
|
|
|
}
|
|
|
|
+(TableViewColumn *)named:(string)name;
|
|
|
|
+(TableViewColumn *)named:(string)name width:(int)width;
|
2020-03-31 13:03:56 +00:00
|
|
|
|
|
|
|
-setGrowMode: (int) mode;
|
|
|
|
-(int)growMode;
|
|
|
|
|
2020-03-31 01:55:39 +00:00
|
|
|
-(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
|