projects
/
ncurses.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
ncurses 5.7 - patch 20090829
[ncurses.git]
/
form
/
frm_driver.c
diff --git
a/form/frm_driver.c
b/form/frm_driver.c
index 5208113010ccdf8c39b9e287dea6e9f9d780c806..8d9bd3ba6f5091ead1be0eb3aac5c0e9d2018284 100644
(file)
--- a/
form/frm_driver.c
+++ b/
form/frm_driver.c
@@
-1,5
+1,5
@@
/****************************************************************************
/****************************************************************************
- * Copyright (c) 1998-200
7,2008
Free Software Foundation, Inc. *
+ * Copyright (c) 1998-200
8,2009
Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
* copy of this software and associated documentation files (the *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
* copy of this software and associated documentation files (the *
@@
-32,7
+32,7
@@
#include "form.priv.h"
#include "form.priv.h"
-MODULE_ID("$Id: frm_driver.c,v 1.
87 2008/07/12 21:24:07
tom Exp $")
+MODULE_ID("$Id: frm_driver.c,v 1.
90 2009/08/29 19:02:25
tom Exp $")
/*----------------------------------------------------------------------------
This is the core module of the form library. It contains the majority
/*----------------------------------------------------------------------------
This is the core module of the form library. It contains the majority
@@
-188,7
+188,7
@@
static int FE_Delete_Previous(FORM *);
/* Macro to set the attributes for a fields window */
#define Set_Field_Window_Attributes(field,win) \
( wbkgdset((win),(chtype)((field)->pad | (field)->back)), \
/* Macro to set the attributes for a fields window */
#define Set_Field_Window_Attributes(field,win) \
( wbkgdset((win),(chtype)((field)->pad | (field)->back)), \
- wattrset((win),(field)->fore) )
+
(void)
wattrset((win),(field)->fore) )
/* Logic to decide whether or not a field really appears on the form */
#define Field_Really_Appears(field) \
/* Logic to decide whether or not a field really appears on the form */
#define Field_Really_Appears(field) \
@@
-1073,9
+1073,13
@@
Display_Or_Erase_Field(FIELD *field, bool bEraseFlag)
else
{
if (field->opts & O_VISIBLE)
else
{
if (field->opts & O_VISIBLE)
- Set_Field_Window_Attributes(field, win);
+ {
+ Set_Field_Window_Attributes(field, win);
+ }
else
else
- wattrset(win, WINDOW_ATTRS(fwin));
+ {
+ (void)wattrset(win, WINDOW_ATTRS(fwin));
+ }
werase(win);
}
werase(win);
}
@@
-4333,15
+4337,6
@@
set_field_buffer(FIELD *field, int buffer, const char *value)
len = Buffer_Length(field);
len = Buffer_Length(field);
- if (buffer == 0)
- {
- for (i = 0; (value[i] != '\0') && (i < len); ++i)
- {
- if (iscntrl(UChar(value[i])))
- RETURN(E_BAD_ARGUMENT);
- }
- }
-
if (Growable(field))
{
/* for a growable field we must assume zero terminated strings, because
if (Growable(field))
{
/* for a growable field we must assume zero terminated strings, because
@@
-4356,14
+4351,6
@@
set_field_buffer(FIELD *field, int buffer, const char *value)
* field->cols))))
RETURN(E_SYSTEM_ERROR);
* field->cols))))
RETURN(E_SYSTEM_ERROR);
- /* in this case we also have to check, whether or not the remaining
- characters in value are also printable for buffer 0. */
- if (buffer == 0)
- {
- for (i = len; i < vlen; i++)
- if (iscntrl(UChar(value[i])))
- RETURN(E_BAD_ARGUMENT);
- }
len = vlen;
}
}
len = vlen;
}
}
@@
-4376,6
+4363,14
@@
set_field_buffer(FIELD *field, int buffer, const char *value)
* There should be a better way, but this handles nonspacing characters
* and other special cases that we really do not want to handle here.
*/
* There should be a better way, but this handles nonspacing characters
* and other special cases that we really do not want to handle here.
*/
+#if NCURSES_EXT_FUNCS
+ if (wresize(field->working, field->drows, field->dcols) == ERR)
+#endif
+ {
+ delwin(field->working);
+ field->working = newpad(field->drows, field->dcols);
+ }
+ len = Buffer_Length(field);
wclear(field->working);
mvwaddstr(field->working, 0, 0, value);
wclear(field->working);
mvwaddstr(field->working, 0, 0, value);
@@
-4385,7
+4380,12
@@
set_field_buffer(FIELD *field, int buffer, const char *value)
}
else
{
}
else
{
- mvwin_wchnstr(field->working, 0, 0, widevalue, (int)len);
+ for (i = 0; i < (unsigned)field->drows; ++i)
+ {
+ mvwin_wchnstr(field->working, i, 0,
+ widevalue + (i * field->dcols),
+ field->dcols);
+ }
for (i = 0; i < len; ++i)
{
if (CharEq(myZEROS, widevalue[i]))
for (i = 0; i < len; ++i)
{
if (CharEq(myZEROS, widevalue[i]))