From: ewt Date: Mon, 17 Jun 1996 15:16:00 +0000 (+0000) Subject: added newtFormGetCurrent() X-Git-Tag: 0-1~7 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=2a2998a0bce4969d7c18ec065c094ad4ceac5b49;p=thirdparty%2Fnewt.git added newtFormGetCurrent() --- diff --git a/form.c b/form.c index 5f70988..5ca5491 100644 --- a/form.c +++ b/form.c @@ -1,3 +1,4 @@ +#include #include #include @@ -82,6 +83,12 @@ newtComponent newtForm(newtComponent vertScrollbar) { return co; } +newtComponent newtFormGetCurrent(newtComponent co) { + struct form * form = co->data; + + return form->elements[form->currComp].co; +} + void newtFormSetHeight(newtComponent co, int height) { struct form * form = co->data; @@ -108,10 +115,6 @@ void newtFormAddComponent(newtComponent co, newtComponent newco) { form->numComps++; - if ((newco->top + newco->height - co->top) > form->numRows) { - form->numRows = newco->top + newco->height - co->top; - } - if (co->left == -1) { co->left = newco->left; co->top = newco->top; @@ -141,6 +144,11 @@ void newtFormAddComponent(newtComponent co, newtComponent newco) { co->height = (newco->top + newco->height) - co->top; } } + + if ((newco->top + newco->height - co->top) > form->numRows) { + form->numRows = newco->top + newco->height - co->top; + } + } void newtFormAddComponents(newtComponent co, ...) {