25 lines
939 B
C
25 lines
939 B
C
// widgetScrollPane.h -- ScrollPane widget API
|
|
#ifndef WIDGET_SCROLLPANE_H
|
|
#define WIDGET_SCROLLPANE_H
|
|
|
|
#include "../core/dvxWidget.h"
|
|
|
|
typedef struct {
|
|
WidgetT *(*create)(WidgetT *parent);
|
|
void (*scrollToChild)(WidgetT *sp, const WidgetT *child);
|
|
void (*setNoBorder)(WidgetT *w, bool noBorder);
|
|
void (*scrollToTop)(WidgetT *w);
|
|
} ScrollPaneApiT;
|
|
|
|
static inline const ScrollPaneApiT *dvxScrollPaneApi(void) {
|
|
static const ScrollPaneApiT *sApi;
|
|
if (!sApi) { sApi = (const ScrollPaneApiT *)wgtGetApi("scrollpane"); }
|
|
return sApi;
|
|
}
|
|
|
|
#define wgtScrollPane(parent) dvxScrollPaneApi()->create(parent)
|
|
#define wgtScrollPaneScrollToChild(sp, child) dvxScrollPaneApi()->scrollToChild((sp), (child))
|
|
#define wgtScrollPaneSetNoBorder(w, noBorder) dvxScrollPaneApi()->setNoBorder((w), (noBorder))
|
|
#define wgtScrollPaneScrollToTop(w) dvxScrollPaneApi()->scrollToTop(w)
|
|
|
|
#endif // WIDGET_SCROLLPANE_H
|