mirror of
https://github.com/gryf/wmaker.git
synced 2026-01-05 21:34:17 +01:00
added table widget
This commit is contained in:
35
WINGs/Extras/tabledelegates.c
Normal file
35
WINGs/Extras/tabledelegates.c
Normal file
@@ -0,0 +1,35 @@
|
||||
|
||||
|
||||
#include <WINGs.h>
|
||||
|
||||
#include "fieldeditor.h"
|
||||
#include "wtableview.h"
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
static void cellPainter(WMTableColumnDelegate *self, WMTableColumn *column,
|
||||
int row)
|
||||
{
|
||||
// WTStringDelegate *strdel = (WTStringDelegate*)self->data;
|
||||
WMTableView *table = WMGetTableColumnTableView(column);
|
||||
|
||||
WFStringEditorTableDraw(self->data,
|
||||
WMViewXID(WMGetTableViewDocumentView(table)),
|
||||
WMTableViewDataForCell(table, column, row),
|
||||
WMTableViewRectForCell(table, column, row));
|
||||
}
|
||||
|
||||
|
||||
|
||||
WMTableColumnDelegate *WTCreateStringDelegate(WMScreen *scr)
|
||||
{
|
||||
WMTableColumnDelegate *delegate = wmalloc(sizeof(WMTableColumnDelegate));
|
||||
|
||||
delegate->data = WFCreateStringEditor(scr);
|
||||
delegate->drawCell = cellPainter;
|
||||
delegate->editCell = NULL;
|
||||
|
||||
return delegate;
|
||||
}
|
||||
Reference in New Issue
Block a user