30 lines
1.1 KiB
C
30 lines
1.1 KiB
C
// widgetDataCtrl.h -- VB3-style Data control for database binding
|
|
|
|
#ifndef WIDGET_DATACTRL_H
|
|
#define WIDGET_DATACTRL_H
|
|
|
|
#include "dvxWidget.h"
|
|
|
|
typedef struct {
|
|
WidgetT *(*create)(WidgetT *parent);
|
|
void (*refresh)(WidgetT *w);
|
|
void (*moveFirst)(WidgetT *w);
|
|
void (*movePrev)(WidgetT *w);
|
|
void (*moveNext)(WidgetT *w);
|
|
void (*moveLast)(WidgetT *w);
|
|
const char *(*getField)(WidgetT *w, const char *colName);
|
|
} DataCtrlApiT;
|
|
|
|
static inline const DataCtrlApiT *dvxDataCtrlApi(void) {
|
|
return (const DataCtrlApiT *)wgtGetApi("data");
|
|
}
|
|
|
|
#define wgtDataCtrl(parent) dvxDataCtrlApi()->create(parent)
|
|
#define wgtDataCtrlRefresh(w) dvxDataCtrlApi()->refresh(w)
|
|
#define wgtDataCtrlMoveFirst(w) dvxDataCtrlApi()->moveFirst(w)
|
|
#define wgtDataCtrlMovePrev(w) dvxDataCtrlApi()->movePrev(w)
|
|
#define wgtDataCtrlMoveNext(w) dvxDataCtrlApi()->moveNext(w)
|
|
#define wgtDataCtrlMoveLast(w) dvxDataCtrlApi()->moveLast(w)
|
|
#define wgtDataCtrlGetField(w, col) dvxDataCtrlApi()->getField(w, col)
|
|
|
|
#endif // WIDGET_DATACTRL_H
|