libui/redo/darwin/progressbar.m

41 lines
837 B
Mathematica
Raw Normal View History

// 11 june 2015
2015-07-11 16:02:01 -05:00
#include "uipriv_darwin.h"
struct progressbar {
uiProgressBar p;
2015-07-11 16:02:01 -05:00
OSTYPE *OSHANDLE;
};
uiDefineControlType(uiProgressBar, uiTypeProgressBar, struct progressbar)
static uintptr_t progressbarHandle(uiControl *c)
{
struct progressbar *p = (struct progressbar *) c;
return (uintptr_t) (p->OSHANDLE);
}
static void progressbarSetValue(uiProgressBar *pp, int value)
{
struct progressbar *p = (struct progressbar *) pp;
if (value < 0 || value > 100)
complain("value %d out of range in progressbarSetValue()", value);
PUT_CODE_HERE;
}
uiProgressBar *uiNewProgressBar(void)
{
struct progressbar *p;
p = (struct progressbar *) MAKE_CONTROL_INSTANCE(uiTypeProgressBar());
PUT_CODE_HERE;
uiControl(p)->Handle = progressbarHandle;
uiProgressBar(p)->SetValue = progressbarSetValue;
return uiProgressBar(p);
}