libui/redo/test/page4.c

38 lines
788 B
C
Raw Normal View History

// 19 may 2015
#include "test.h"
static uiSpinbox *spinbox;
2015-05-20 09:29:57 -05:00
static uiSlider *slider;
2015-05-19 20:05:18 -05:00
static uiProgressBar *pbar;
2015-05-19 17:17:30 -05:00
#define CHANGED(what) \
static void on ## what ## Changed(ui ## what *this, void *data) \
{ \
2015-05-19 20:05:18 -05:00
uintmax_t value; \
2015-05-19 17:17:30 -05:00
printf("on %s changed\n", #what); \
2015-05-19 20:05:18 -05:00
value = ui ## what ## Value(this); \
uiProgressBarSetValue(pbar, value); \
2015-05-19 17:17:30 -05:00
}
CHANGED(Spinbox)
2015-05-20 09:29:57 -05:00
CHANGED(Slider)
2015-05-19 17:17:30 -05:00
uiBox *makePage4(void)
{
uiBox *page4;
page4 = newVerticalBox();
spinbox = uiNewSpinbox();
2015-05-19 17:17:30 -05:00
uiSpinboxOnChanged(spinbox, onSpinboxChanged, NULL);
uiBoxAppend(page4, uiControl(spinbox), 0);
2015-05-20 09:29:57 -05:00
slider = uiNewSlider();
uiSliderOnChanged(slider, onSliderChanged, NULL);
uiBoxAppend(page4, uiControl(slider), 0);
2015-05-19 20:05:18 -05:00
pbar = uiNewProgressBar();
uiBoxAppend(page4, uiControl(pbar), 0);
return page4;
}