/****************************************************************************
- * Copyright 2020 Thomas E. Dickey *
+ * Copyright 2020-2021,2024 Thomas E. Dickey *
* Copyright 1998-2010,2013 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
#include "form.priv.h"
-MODULE_ID("$Id: frm_data.c,v 1.17 2020/02/02 23:34:34 tom Exp $")
+MODULE_ID("$Id: frm_data.c,v 1.22 2024/07/27 18:35:02 tom Exp $")
/*---------------------------------------------------------------------------
-| Facility : libnform
+| Facility : libnform
| Function : bool data_behind(const FORM *form)
-|
+|
| Description : Check for off-screen data behind. This is nearly trivial
| because the beginning of a field is fixed.
|
| Return Values : TRUE - there are off-screen data behind
| FALSE - there are no off-screen data behind
+--------------------------------------------------------------------------*/
-NCURSES_EXPORT(bool)
+FORM_EXPORT(bool)
data_behind(const FORM *form)
{
bool result = FALSE;
if (form && (form->status & _POSTED) && form->current)
{
- FIELD *field;
+ const FIELD *field;
field = form->current;
if (!Single_Line_Field(field))
}
/*---------------------------------------------------------------------------
-| Facility : libnform
+| Facility : libnform
| Function : static char * Only_Padding(
| WINDOW *w,
| int len,
| int pad)
-|
+|
| Description : Test if 'length' cells starting at the current position
| contain a padding character.
|
}
}
#else
- cell = (FIELD_CELL) winch(w);
+ cell = (FIELD_CELL)winch(w);
if (ChCharOf(cell) != ChCharOf(pad))
{
result = FALSE;
}
/*---------------------------------------------------------------------------
-| Facility : libnform
+| Facility : libnform
| Function : bool data_ahead(const FORM *form)
-|
+|
| Description : Check for off-screen data ahead. This is more difficult
-| because a dynamic field has a variable end.
+| because a dynamic field has a variable end.
|
| Return Values : TRUE - there are off-screen data ahead
| FALSE - there are no off-screen data ahead
+--------------------------------------------------------------------------*/
-NCURSES_EXPORT(bool)
+FORM_EXPORT(bool)
data_ahead(const FORM *form)
{
bool result = FALSE;
if (form && (form->status & _POSTED) && form->current)
{
- FIELD *field;
+ const FIELD *field;
bool cursor_moved = FALSE;
int pos;
if (Single_Line_Field(field))
{
- int check_len;
-
pos = form->begincol + field->cols;
while (pos < field->dcols)
{
- check_len = field->dcols - pos;
+ int check_len = field->dcols - pos;
+
if (check_len >= field->cols)
check_len = field->cols;
cursor_moved = TRUE;