From 2a2998a0bce4969d7c18ec065c094ad4ceac5b49 Mon Sep 17 00:00:00 2001 From: ewt Date: Mon, 17 Jun 1996 15:16:00 +0000 Subject: [PATCH] added newtFormGetCurrent() --- form.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) 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, ...) { -- 2.47.2