mirror of
https://gitea.nishi.boats/pyrite-dev/milsko
synced 2026-01-06 17:39:45 +00:00
cleaner
git-svn-id: http://svn2.nishi.boats/svn/milsko/trunk@277 b9cfdab3-6d41-4d17-bbe4-086880011989
This commit is contained in:
@@ -135,7 +135,7 @@ else
|
||||
L_CFLAGS += -DUSE_STB_IMAGE
|
||||
endif
|
||||
|
||||
EXAMPLES = examples/example$(EXEC) examples/rotate$(EXEC) examples/image$(EXEC) examples/scrollbar$(EXEC) examples/checkbox$(EXEC) examples/messagebox$(EXEC)
|
||||
EXAMPLES = examples/example$(EXEC) examples/rotate$(EXEC) examples/image$(EXEC) examples/scrollbar$(EXEC) examples/checkbox$(EXEC) examples/messagebox$(EXEC) examples/viewport$(EXEC)
|
||||
|
||||
ifeq ($(OPENGL),1)
|
||||
L_OBJS += src/widget/opengl.o
|
||||
|
||||
@@ -187,7 +187,10 @@ static void mouse_down(MwWidget handle, void* ptr) {
|
||||
}
|
||||
|
||||
static void prop_change(MwWidget handle, const char* key) {
|
||||
if(strcmp(key, MwNminValue) == 0 || strcmp(key, MwNvalue) == 0 || strcmp(key, MwNmaxValue) == 0 || strcmp(key, MwNareaShown) == 0) MwForceRender(handle);
|
||||
if(strcmp(key, MwNminValue) == 0 || strcmp(key, MwNvalue) == 0 || strcmp(key, MwNmaxValue) == 0 || strcmp(key, MwNareaShown) == 0) {
|
||||
if(handle->prop_event) MwDispatchUserHandler(handle, MwNchangedHandler, NULL);
|
||||
MwForceRender(handle);
|
||||
}
|
||||
}
|
||||
|
||||
MwClassRec MwScrollBarClassRec = {
|
||||
|
||||
@@ -36,8 +36,8 @@ static void resize(MwWidget handle) {
|
||||
viewport_t* vp = handle->internal;
|
||||
int w = MwGetInteger(handle, MwNwidth);
|
||||
int h = MwGetInteger(handle, MwNheight);
|
||||
int iw, ix;
|
||||
int ih, iy;
|
||||
int iw;
|
||||
int ih;
|
||||
if(vp->vscroll == NULL) {
|
||||
vp->vscroll = MwVaCreateWidget(MwScrollBarClass, "vscroll", handle, w - 16, 0, 16, h - 16, NULL);
|
||||
MwAddUserHandler(vp->vscroll, MwNchangedHandler, vscroll_changed, vp);
|
||||
@@ -77,24 +77,15 @@ static void resize(MwWidget handle) {
|
||||
iw = MwGetInteger(vp->inframe, MwNwidth);
|
||||
ih = MwGetInteger(vp->inframe, MwNheight);
|
||||
|
||||
iy = MwGetInteger(vp->vscroll, MwNvalue);
|
||||
if(iy > ih) iy = ih;
|
||||
MwVaApply(vp->vscroll,
|
||||
MwNareaShown, h - 16,
|
||||
MwNmaxValue, ih,
|
||||
MwNvalue, iy,
|
||||
NULL);
|
||||
|
||||
ix = MwGetInteger(vp->hscroll, MwNvalue);
|
||||
if(ix > iw) ix = iw;
|
||||
MwVaApply(vp->hscroll,
|
||||
MwNareaShown, w - 16,
|
||||
MwNmaxValue, iw,
|
||||
MwNvalue, ix,
|
||||
NULL);
|
||||
|
||||
vscroll_changed(vp->vscroll, vp, NULL);
|
||||
hscroll_changed(vp->hscroll, vp, NULL);
|
||||
}
|
||||
|
||||
static int create(MwWidget handle) {
|
||||
|
||||
Reference in New Issue
Block a user