2002-08-02 15:48:02 +04:00
|
|
|
/* $NetBSD: driver.c,v 1.14 2002/08/02 11:48:02 blymn Exp $ */
|
2000-12-17 15:04:30 +03:00
|
|
|
|
|
|
|
/*-
|
|
|
|
* Copyright (c) 1998-1999 Brett Lymn
|
|
|
|
* (blymn@baea.com.au, brett_lymn@yahoo.com.au)
|
|
|
|
* All rights reserved.
|
|
|
|
*
|
|
|
|
* This code has been donated to The NetBSD Foundation by the Author.
|
|
|
|
*
|
|
|
|
* Redistribution and use in source and binary forms, with or without
|
|
|
|
* modification, are permitted provided that the following conditions
|
|
|
|
* are met:
|
|
|
|
* 1. Redistributions of source code must retain the above copyright
|
|
|
|
* notice, this list of conditions and the following disclaimer.
|
|
|
|
* 2. The name of the author may not be used to endorse or promote products
|
2001-06-13 14:45:57 +04:00
|
|
|
* derived from this software without specific prior written permission
|
2000-12-17 15:04:30 +03:00
|
|
|
*
|
|
|
|
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
|
|
|
|
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
|
|
|
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
|
|
|
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
|
|
|
|
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
|
|
|
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
|
|
|
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
|
|
|
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
|
|
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
|
|
|
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
|
|
*
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <ctype.h>
|
|
|
|
#include "form.h"
|
|
|
|
#include "internals.h"
|
|
|
|
|
|
|
|
static int
|
|
|
|
traverse_form_links(FORM *form, int direction);
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Traverse the links of the current field in the given direction until
|
|
|
|
* either a active & visible field is found or we return to the current
|
|
|
|
* field. Direction is the REQ_{LEFT,RIGHT,UP,DOWN}_FIELD driver commands.
|
|
|
|
* The function returns E_OK if a valid field is found, E_REQUEST_DENIED
|
|
|
|
* otherwise.
|
|
|
|
*/
|
|
|
|
static int
|
|
|
|
traverse_form_links(FORM *form, int direction)
|
|
|
|
{
|
2001-12-31 04:04:46 +03:00
|
|
|
unsigned idx;
|
2000-12-17 15:04:30 +03:00
|
|
|
|
2001-12-31 04:04:46 +03:00
|
|
|
idx = form->cur_field;
|
2000-12-17 15:04:30 +03:00
|
|
|
|
|
|
|
do {
|
|
|
|
switch (direction) {
|
|
|
|
case REQ_LEFT_FIELD:
|
2001-12-31 04:04:46 +03:00
|
|
|
if (form->fields[idx]->left == NULL)
|
2000-12-17 15:04:30 +03:00
|
|
|
return E_REQUEST_DENIED;
|
2001-12-31 04:04:46 +03:00
|
|
|
idx = form->fields[idx]->left->index;
|
2000-12-17 15:04:30 +03:00
|
|
|
break;
|
|
|
|
|
|
|
|
case REQ_RIGHT_FIELD:
|
2001-12-31 04:04:46 +03:00
|
|
|
if (form->fields[idx]->right == NULL)
|
2000-12-17 15:04:30 +03:00
|
|
|
return E_REQUEST_DENIED;
|
2001-12-31 04:04:46 +03:00
|
|
|
idx = form->fields[idx]->right->index;
|
2000-12-17 15:04:30 +03:00
|
|
|
break;
|
|
|
|
|
|
|
|
case REQ_UP_FIELD:
|
2001-12-31 04:04:46 +03:00
|
|
|
if (form->fields[idx]->up == NULL)
|
2000-12-17 15:04:30 +03:00
|
|
|
return E_REQUEST_DENIED;
|
2001-12-31 04:04:46 +03:00
|
|
|
idx = form->fields[idx]->up->index;
|
2000-12-17 15:04:30 +03:00
|
|
|
break;
|
|
|
|
|
|
|
|
case REQ_DOWN_FIELD:
|
2001-12-31 04:04:46 +03:00
|
|
|
if (form->fields[idx]->down == NULL)
|
2000-12-17 15:04:30 +03:00
|
|
|
return E_REQUEST_DENIED;
|
2001-12-31 04:04:46 +03:00
|
|
|
idx = form->fields[idx]->down->index;
|
2000-12-17 15:04:30 +03:00
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
|
|
|
return E_REQUEST_DENIED;
|
|
|
|
}
|
|
|
|
|
2001-12-31 04:04:46 +03:00
|
|
|
if ((form->fields[idx]->opts & (O_ACTIVE | O_VISIBLE))
|
2000-12-17 15:04:30 +03:00
|
|
|
== (O_ACTIVE | O_VISIBLE)) {
|
2001-12-31 04:04:46 +03:00
|
|
|
form->cur_field = idx;
|
2000-12-17 15:04:30 +03:00
|
|
|
return E_OK;
|
|
|
|
}
|
2001-12-31 04:04:46 +03:00
|
|
|
} while (idx != form->cur_field);
|
2000-12-17 15:04:30 +03:00
|
|
|
|
|
|
|
return E_REQUEST_DENIED;
|
|
|
|
}
|
|
|
|
|
|
|
|
int
|
|
|
|
form_driver(FORM *form, int c)
|
|
|
|
{
|
|
|
|
FIELD *fieldp;
|
|
|
|
int update_page, update_field, old_field, old_page, status;
|
2001-04-06 08:40:43 +04:00
|
|
|
int start_field;
|
2000-12-17 15:04:30 +03:00
|
|
|
unsigned int pos;
|
|
|
|
|
|
|
|
if (form == NULL)
|
|
|
|
return E_BAD_ARGUMENT;
|
|
|
|
|
|
|
|
if ((form->fields == NULL) || (*(form->fields) == NULL))
|
|
|
|
return E_INVALID_FIELD;
|
|
|
|
|
|
|
|
if (form->posted != 1)
|
|
|
|
return E_NOT_POSTED;
|
|
|
|
|
|
|
|
if (form->in_init == 1)
|
|
|
|
return E_BAD_STATE;
|
|
|
|
|
|
|
|
|
2001-04-06 08:40:43 +04:00
|
|
|
old_field = start_field = form->cur_field;
|
2001-01-30 09:44:42 +03:00
|
|
|
fieldp = form->fields[form->cur_field];
|
2000-12-17 15:04:30 +03:00
|
|
|
update_page = update_field = 0;
|
2001-01-30 09:44:42 +03:00
|
|
|
status = E_OK;
|
2000-12-17 15:04:30 +03:00
|
|
|
|
|
|
|
if (c < REQ_MIN_REQUEST) {
|
2002-05-20 19:00:11 +04:00
|
|
|
if (isprint(c) || isblank(c)) {
|
2001-02-06 02:59:52 +03:00
|
|
|
do {
|
2002-05-20 19:00:11 +04:00
|
|
|
pos = fieldp->start_char + fieldp->row_xpos
|
2001-05-11 18:04:48 +04:00
|
|
|
+ fieldp->lines[fieldp->start_line + fieldp->cursor_ypos].start;
|
2000-12-17 15:04:30 +03:00
|
|
|
|
2001-04-06 08:40:43 +04:00
|
|
|
/* check if we are allowed to edit this field */
|
2001-02-06 02:59:52 +03:00
|
|
|
if ((fieldp->opts & O_EDIT) != O_EDIT)
|
2000-12-17 15:04:30 +03:00
|
|
|
return E_REQUEST_DENIED;
|
|
|
|
|
2001-02-06 02:59:52 +03:00
|
|
|
if ((status =
|
|
|
|
(_formi_add_char(fieldp, pos, c)))
|
|
|
|
== E_REQUEST_DENIED) {
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Need to check here if we
|
|
|
|
* want to autoskip. we
|
|
|
|
* call the form driver
|
|
|
|
* recursively to pos us on
|
|
|
|
* the next field and then
|
|
|
|
* we loop back to ensure
|
|
|
|
* the next field selected
|
|
|
|
* can have data added to it
|
|
|
|
*/
|
|
|
|
if ((fieldp->opts & O_AUTOSKIP)
|
|
|
|
!= O_AUTOSKIP)
|
|
|
|
return E_REQUEST_DENIED;
|
|
|
|
status = form_driver(form,
|
|
|
|
REQ_NEXT_FIELD);
|
|
|
|
if (status != E_OK)
|
|
|
|
return status;
|
2001-04-06 08:40:43 +04:00
|
|
|
|
|
|
|
/*
|
|
|
|
* check if we have looped
|
|
|
|
* around all the fields.
|
|
|
|
* This can easily happen if
|
|
|
|
* all the fields are full.
|
|
|
|
*/
|
|
|
|
if (start_field == form->cur_field)
|
|
|
|
return E_REQUEST_DENIED;
|
|
|
|
|
2001-02-06 02:59:52 +03:00
|
|
|
old_field = form->cur_field;
|
|
|
|
fieldp = form->fields[form->cur_field];
|
2001-04-06 08:40:43 +04:00
|
|
|
status = _formi_add_char(fieldp,
|
|
|
|
fieldp->start_char
|
|
|
|
+ fieldp->cursor_xpos,
|
|
|
|
c);
|
2001-02-06 02:59:52 +03:00
|
|
|
} else if (status == E_INVALID_FIELD)
|
|
|
|
/* char failed validation, just
|
|
|
|
* return the status.
|
|
|
|
*/
|
|
|
|
return status;
|
2001-05-16 15:51:16 +04:00
|
|
|
else if (status == E_NO_ROOM)
|
|
|
|
/* we will get this if the line
|
|
|
|
* wrapping fails. Deny the
|
|
|
|
* request.
|
|
|
|
*/
|
|
|
|
return E_REQUEST_DENIED;
|
2001-02-06 02:59:52 +03:00
|
|
|
}
|
|
|
|
while (status != E_OK);
|
|
|
|
update_field = (status == E_OK);
|
2000-12-17 15:04:30 +03:00
|
|
|
} else
|
|
|
|
return E_REQUEST_DENIED;
|
|
|
|
} else {
|
|
|
|
if (c > REQ_MAX_COMMAND)
|
|
|
|
return E_UNKNOWN_COMMAND;
|
|
|
|
|
2001-01-30 09:44:42 +03:00
|
|
|
if ((c >= REQ_NEXT_PAGE) && (c <= REQ_DOWN_FIELD)) {
|
|
|
|
/* first check the field we are in is ok */
|
|
|
|
if (_formi_validate_field(form) != E_OK)
|
|
|
|
return E_INVALID_FIELD;
|
|
|
|
|
|
|
|
if (form->field_term != NULL)
|
|
|
|
form->field_term(form);
|
|
|
|
|
|
|
|
/*
|
|
|
|
* if we have a page movement then the form term
|
|
|
|
* needs to be called too
|
|
|
|
*/
|
|
|
|
if ((c <= REQ_LAST_PAGE) && (form->form_term != NULL))
|
|
|
|
form->form_term(form);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2000-12-17 15:04:30 +03:00
|
|
|
switch (c) {
|
|
|
|
case REQ_NEXT_PAGE:
|
|
|
|
if (form->page < form->max_page) {
|
|
|
|
old_page = form->page;
|
|
|
|
form->page++;
|
|
|
|
update_page = 1;
|
|
|
|
if (_formi_pos_first_field(form) != E_OK) {
|
|
|
|
form->page = old_page;
|
2001-01-30 09:44:42 +03:00
|
|
|
status = E_REQUEST_DENIED;
|
2000-12-17 15:04:30 +03:00
|
|
|
}
|
|
|
|
} else
|
2001-01-30 09:44:42 +03:00
|
|
|
status = E_REQUEST_DENIED;
|
2000-12-17 15:04:30 +03:00
|
|
|
break;
|
|
|
|
|
|
|
|
case REQ_PREV_PAGE:
|
|
|
|
if (form->page > 0) {
|
|
|
|
old_page = form->page;
|
|
|
|
form->page--;
|
|
|
|
update_page = 1;
|
|
|
|
if (_formi_pos_first_field(form) != E_OK) {
|
|
|
|
form->page = old_page;
|
2001-01-30 09:44:42 +03:00
|
|
|
status = E_REQUEST_DENIED;
|
2000-12-17 15:04:30 +03:00
|
|
|
}
|
|
|
|
} else
|
2001-01-30 09:44:42 +03:00
|
|
|
status = E_REQUEST_DENIED;
|
2000-12-17 15:04:30 +03:00
|
|
|
break;
|
|
|
|
|
|
|
|
case REQ_FIRST_PAGE:
|
|
|
|
old_page = form->page;
|
|
|
|
form->page = 0;
|
|
|
|
update_page = 1;
|
|
|
|
if (_formi_pos_first_field(form) != E_OK) {
|
|
|
|
form->page = old_page;
|
2001-01-30 09:44:42 +03:00
|
|
|
status = E_REQUEST_DENIED;
|
2000-12-17 15:04:30 +03:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case REQ_LAST_PAGE:
|
|
|
|
old_page = form->page;
|
|
|
|
form->page = form->max_page - 1;
|
|
|
|
update_page = 1;
|
|
|
|
if (_formi_pos_first_field(form) != E_OK) {
|
|
|
|
form->page = old_page;
|
2001-01-30 09:44:42 +03:00
|
|
|
status = E_REQUEST_DENIED;
|
2000-12-17 15:04:30 +03:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case REQ_NEXT_FIELD:
|
|
|
|
status = _formi_pos_new_field(form, _FORMI_FORWARD,
|
|
|
|
FALSE);
|
|
|
|
update_field = 1;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case REQ_PREV_FIELD:
|
|
|
|
status = _formi_pos_new_field(form, _FORMI_BACKWARD,
|
|
|
|
FALSE);
|
|
|
|
update_field = 1;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case REQ_FIRST_FIELD:
|
|
|
|
form->cur_field = 0;
|
|
|
|
update_field = 1;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case REQ_LAST_FIELD:
|
|
|
|
form->cur_field = form->field_count - 1;
|
|
|
|
update_field = 1;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case REQ_SNEXT_FIELD:
|
|
|
|
status = _formi_pos_new_field(form, _FORMI_FORWARD,
|
|
|
|
TRUE);
|
|
|
|
update_field = 1;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case REQ_SPREV_FIELD:
|
|
|
|
status = _formi_pos_new_field(form, _FORMI_BACKWARD,
|
|
|
|
TRUE);
|
|
|
|
update_field = 1;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case REQ_SFIRST_FIELD:
|
|
|
|
fieldp = CIRCLEQ_FIRST(&form->sorted_fields);
|
|
|
|
form->cur_field = fieldp->index;
|
|
|
|
update_field = 1;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case REQ_SLAST_FIELD:
|
|
|
|
fieldp = CIRCLEQ_LAST(&form->sorted_fields);
|
|
|
|
form->cur_field = fieldp->index;
|
|
|
|
update_field = 1;
|
|
|
|
break;
|
|
|
|
|
|
|
|
/*
|
|
|
|
* The up, down, left and right field traversals
|
|
|
|
* are rolled up into a single function, allow a
|
|
|
|
* fall through to that function.
|
|
|
|
*/
|
|
|
|
/* FALLTHROUGH */
|
|
|
|
case REQ_LEFT_FIELD:
|
|
|
|
case REQ_RIGHT_FIELD:
|
|
|
|
case REQ_UP_FIELD:
|
|
|
|
case REQ_DOWN_FIELD:
|
|
|
|
status = traverse_form_links(form, c);
|
|
|
|
update_field = 1;
|
|
|
|
break;
|
|
|
|
|
|
|
|
/* the following commands modify the buffer, check if
|
|
|
|
this is allowed first before falling through. */
|
|
|
|
/* FALLTHROUGH */
|
2001-01-23 04:59:29 +03:00
|
|
|
case REQ_DEL_PREV:
|
|
|
|
/*
|
|
|
|
* need to check for the overloading of this
|
|
|
|
* request. If overload flag set and we are
|
|
|
|
* at the start of field this request turns
|
|
|
|
* into a previous field request. Otherwise
|
|
|
|
* fallthrough to the field handler.
|
|
|
|
*/
|
|
|
|
if ((form->opts & O_BS_OVERLOAD) == O_BS_OVERLOAD) {
|
|
|
|
if ((fieldp->start_char == 0) &&
|
|
|
|
(fieldp->start_line == 0) &&
|
2002-07-29 09:17:37 +04:00
|
|
|
(fieldp->row_xpos == 0)) {
|
2001-01-23 04:59:29 +03:00
|
|
|
update_field =
|
|
|
|
_formi_manipulate_field(form,
|
|
|
|
REQ_PREV_FIELD);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* FALLTHROUGH */
|
|
|
|
case REQ_NEW_LINE:
|
|
|
|
/*
|
|
|
|
* need to check for the overloading of this
|
|
|
|
* request. If overload flag set and we are
|
|
|
|
* at the start of field this request turns
|
|
|
|
* into a next field request. Otherwise
|
|
|
|
* fallthrough to the field handler.
|
|
|
|
*/
|
|
|
|
if ((form->opts & O_NL_OVERLOAD) == O_NL_OVERLOAD) {
|
|
|
|
if ((fieldp->start_char == 0) &&
|
|
|
|
(fieldp->start_line == 0) &&
|
2002-07-29 09:17:37 +04:00
|
|
|
(fieldp->row_xpos == 0)) {
|
2001-01-23 04:59:29 +03:00
|
|
|
update_field =
|
|
|
|
_formi_manipulate_field(form,
|
|
|
|
REQ_NEXT_FIELD);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* FALLTHROUGH */
|
2000-12-17 15:04:30 +03:00
|
|
|
case REQ_INS_CHAR:
|
|
|
|
case REQ_INS_LINE:
|
|
|
|
case REQ_DEL_CHAR:
|
|
|
|
case REQ_DEL_LINE:
|
|
|
|
case REQ_DEL_WORD:
|
|
|
|
case REQ_CLR_EOL:
|
|
|
|
case REQ_CLR_EOF:
|
|
|
|
case REQ_CLR_FIELD:
|
|
|
|
case REQ_OVL_MODE:
|
|
|
|
case REQ_INS_MODE:
|
|
|
|
/* check if we are allowed to edit the field and fall
|
|
|
|
* through if we are.
|
|
|
|
*/
|
|
|
|
if ((form->fields[form->cur_field]->opts & O_EDIT) != O_EDIT)
|
|
|
|
return E_REQUEST_DENIED;
|
|
|
|
|
|
|
|
/* the following manipulate the field contents, bundle
|
|
|
|
them into one function.... */
|
|
|
|
/* FALLTHROUGH */
|
|
|
|
case REQ_NEXT_CHAR:
|
|
|
|
case REQ_PREV_CHAR:
|
|
|
|
case REQ_NEXT_LINE:
|
|
|
|
case REQ_PREV_LINE:
|
|
|
|
case REQ_NEXT_WORD:
|
|
|
|
case REQ_PREV_WORD:
|
|
|
|
case REQ_BEG_FIELD:
|
|
|
|
case REQ_END_FIELD:
|
|
|
|
case REQ_BEG_LINE:
|
|
|
|
case REQ_END_LINE:
|
|
|
|
case REQ_LEFT_CHAR:
|
|
|
|
case REQ_RIGHT_CHAR:
|
|
|
|
case REQ_UP_CHAR:
|
|
|
|
case REQ_DOWN_CHAR:
|
|
|
|
case REQ_SCR_FLINE:
|
|
|
|
case REQ_SCR_BLINE:
|
|
|
|
case REQ_SCR_FPAGE:
|
|
|
|
case REQ_SCR_BPAGE:
|
|
|
|
case REQ_SCR_FHPAGE:
|
|
|
|
case REQ_SCR_BHPAGE:
|
|
|
|
case REQ_SCR_FCHAR:
|
|
|
|
case REQ_SCR_BCHAR:
|
|
|
|
case REQ_SCR_HFLINE:
|
|
|
|
case REQ_SCR_HBLINE:
|
|
|
|
case REQ_SCR_HFHALF:
|
|
|
|
case REQ_SCR_HBHALF:
|
|
|
|
update_field = _formi_manipulate_field(form, c);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case REQ_VALIDATION:
|
|
|
|
return _formi_validate_field(form);
|
|
|
|
/* NOTREACHED */
|
|
|
|
break;
|
|
|
|
|
|
|
|
case REQ_PREV_CHOICE:
|
|
|
|
case REQ_NEXT_CHOICE:
|
|
|
|
update_field = _formi_field_choice(form, c);
|
2002-07-29 09:17:37 +04:00
|
|
|
/* reinit the cursor pos just in case */
|
|
|
|
if (update_field == 1) {
|
|
|
|
_formi_init_field_xpos(fieldp);
|
|
|
|
fieldp->row_xpos = 0;
|
|
|
|
}
|
2000-12-17 15:04:30 +03:00
|
|
|
break;
|
|
|
|
|
|
|
|
default: /* should not need to do this, but.... */
|
|
|
|
return E_UNKNOWN_COMMAND;
|
|
|
|
/* NOTREACHED */
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
2001-01-30 09:44:42 +03:00
|
|
|
|
|
|
|
/* call the field and form init functions if required. */
|
|
|
|
if ((c >= REQ_NEXT_PAGE) && (c <= REQ_DOWN_FIELD)) {
|
|
|
|
if (form->field_init != NULL)
|
|
|
|
form->field_init(form);
|
|
|
|
|
|
|
|
/*
|
|
|
|
* if we have a page movement then the form init
|
|
|
|
* needs to be called too
|
|
|
|
*/
|
|
|
|
if ((c <= REQ_LAST_PAGE) && (form->form_init != NULL))
|
|
|
|
form->form_init(form);
|
|
|
|
|
|
|
|
/*
|
|
|
|
* if there was an error just return now...
|
|
|
|
*/
|
|
|
|
if (status != E_OK)
|
|
|
|
return status;
|
2001-02-03 15:33:17 +03:00
|
|
|
|
|
|
|
/* if we have no error, reset the various offsets */
|
|
|
|
fieldp = form->fields[form->cur_field];
|
|
|
|
fieldp->start_char = 0;
|
|
|
|
fieldp->start_line = 0;
|
2002-05-20 19:00:11 +04:00
|
|
|
fieldp->row_xpos = 0;
|
2001-02-03 15:33:17 +03:00
|
|
|
fieldp->cursor_ypos = 0;
|
2002-07-29 09:17:37 +04:00
|
|
|
_formi_init_field_xpos(fieldp);
|
2001-01-30 09:44:42 +03:00
|
|
|
}
|
2000-12-17 15:04:30 +03:00
|
|
|
|
|
|
|
if (update_field < 0)
|
|
|
|
return update_field;
|
|
|
|
|
|
|
|
if (update_field == 1)
|
|
|
|
update_page |= _formi_update_field(form, old_field);
|
|
|
|
|
|
|
|
if (update_page == 1)
|
|
|
|
_formi_draw_page(form);
|
|
|
|
|
|
|
|
pos_form_cursor(form);
|
2002-08-02 15:48:02 +04:00
|
|
|
|
|
|
|
if ((update_page == 1) || (update_field == 1))
|
|
|
|
wrefresh(form->scrwin);
|
|
|
|
|
2000-12-17 15:04:30 +03:00
|
|
|
return E_OK;
|
|
|
|
}
|