* *
* 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 *
/*----------------------------------------------------------------------------
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
instead of a derived window because it contains invisible parts.
This is true for non-public fields and for scrollable fields. */
#define Has_Invisible_Parts(field) \
instead of a derived window because it contains invisible parts.
This is true for non-public fields and for scrollable fields. */
#define Has_Invisible_Parts(field) \
(((field)->just != NO_JUSTIFICATION) && \
(Single_Line_Field(field)) && \
(((field)->dcols == (field)->cols) && \
(((field)->just != NO_JUSTIFICATION) && \
(Single_Line_Field(field)) && \
(((field)->dcols == (field)->cols) && \
/* Logic to determine whether or not a dynamic field may still grow */
#define Growable(field) ((field)->status & _MAY_GROW)
/* Logic to determine whether or not a dynamic field may still grow */
#define Growable(field) ((field)->status & _MAY_GROW)
/* 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)), \
/* Logic to decide whether or not a field really appears on the form */
#define Field_Really_Appears(field) \
((field->form) &&\
(field->form->status & _POSTED) &&\
/* Logic to decide whether or not a field really appears on the form */
#define Field_Really_Appears(field) \
((field->form) &&\
(field->form->status & _POSTED) &&\
(field->page == field->form->curpage))
/* Logic to determine whether or not we are on the first position in the
(field->page == field->form->curpage))
/* Logic to determine whether or not we are on the first position in the
form->status |= _FCHECK_REQUIRED;
Window_To_Buffer(form, form->current);
wmove(form->w, form->currow, form->curcol);
form->status |= _FCHECK_REQUIRED;
Window_To_Buffer(form, form->current);
wmove(form->w, form->currow, form->curcol);
growth = Minimum(field->maxgrow - field->dcols, growth);
field->dcols += growth;
if (field->dcols == field->maxgrow)
growth = Minimum(field->maxgrow - field->dcols, growth);
field->dcols += growth;
if (field->dcols == field->maxgrow)
growth = Minimum(field->maxgrow - field->drows, growth);
field->drows += growth;
if (field->drows == field->maxgrow)
growth = Minimum(field->maxgrow - field->drows, growth);
field->drows += growth;
if (field->drows == field->maxgrow)
}
/* drows, dcols changed, so we get really the new buffer length */
new_buflen = Buffer_Length(field);
}
/* drows, dcols changed, so we get really the new buffer length */
new_buflen = Buffer_Length(field);
/* means we have to copy whole range */
first_modified_row = form->toprow;
first_unmodified_row = first_modified_row + field->rows;
/* means we have to copy whole range */
first_modified_row = form->toprow;
first_unmodified_row = first_modified_row + field->rows;
{
if (Justification_Allowed(field))
Perform_Justification(field, win);
else
Buffer_To_Window(field, win);
}
{
if (Justification_Allowed(field))
Perform_Justification(field, win);
else
Buffer_To_Window(field, win);
}
Undo_Justification(field, form->w);
else
Buffer_To_Window(field, form->w);
Undo_Justification(field, form->w);
else
Buffer_To_Window(field, form->w);
{
if (Justification_Allowed(field))
Undo_Justification(field, form->w);
{
if (Justification_Allowed(field))
Undo_Justification(field, form->w);
Set_Field_Window_Attributes(field, form->w);
if (Has_Invisible_Parts(field))
Set_Field_Window_Attributes(field, form->w);
if (Has_Invisible_Parts(field))
(!Single_Line_Field(field)) && /* must be multi-line */
(There_Is_No_Room_For_A_Char_In_Line(form)) && /* line is full */
(!Last_Row || Growable(field))) /* there are more lines */
(!Single_Line_Field(field)) && /* must be multi-line */
(There_Is_No_Room_For_A_Char_In_Line(form)) && /* line is full */
(!Last_Row || Growable(field))) /* there are more lines */
First_Position_In_Current_Field(form))
{
res = Inter_Field_Navigation(FN_Previous_Field, form);
First_Position_In_Current_Field(form))
{
res = Inter_Field_Navigation(FN_Previous_Field, form);
First_Position_In_Current_Field(form))
{
res = Inter_Field_Navigation(FN_Next_Field, form);
First_Position_In_Current_Field(form))
{
res = Inter_Field_Navigation(FN_Next_Field, form);
returnCode(E_REQUEST_DENIED);
wmove(form->w, form->currow, form->curcol);
wclrtoeol(form->w);
returnCode(E_REQUEST_DENIED);
wmove(form->w, form->currow, form->curcol);
wclrtoeol(form->w);
returnCode(E_REQUEST_DENIED);
returnCode(Inter_Field_Navigation(FN_Next_Field, form));
}
returnCode(E_REQUEST_DENIED);
returnCode(Inter_Field_Navigation(FN_Next_Field, form));
}
EM_Insert_Mode(FORM *form)
{
T((T_CALLED("EM_Insert_Mode(%p)"), (void *)form));
EM_Insert_Mode(FORM *form)
{
T((T_CALLED("EM_Insert_Mode(%p)"), (void *)form));
{
if (!Check_Field(form, field->type, field, (TypeArgument *)(field->arg)))
return FALSE;
{
if (!Check_Field(form, field->type, field, (TypeArgument *)(field->arg)))
return FALSE;
{
/* This means, there is also no visible field on the page.
So we propose the first one and hope the very best...
{
/* This means, there is also no visible field on the page.
So we propose the first one and hope the very best...
FIELD *last_field, *field_on_page;
werase(Get_Form_Window(form));
FIELD *last_field, *field_on_page;
werase(Get_Form_Window(form));
int result = E_REQUEST_DENIED;
T((T_CALLED("Data_Entry(%p,%s)"), (void *)form, _tracechtype((chtype)c)));
int result = E_REQUEST_DENIED;
T((T_CALLED("Data_Entry(%p,%s)"), (void *)form, _tracechtype((chtype)c)));
First_Position_In_Current_Field(form) &&
!(form->status & _FCHECK_REQUIRED) &&
!(form->status & _WINDOW_MODIFIED))
First_Position_In_Current_Field(form) &&
!(form->status & _FCHECK_REQUIRED) &&
!(form->status & _WINDOW_MODIFIED))
NULL /* Choice Request is generic */
};
size_t nMethods = (sizeof(Generic_Methods) / sizeof(Generic_Methods[0]));
NULL /* Choice Request is generic */
};
size_t nMethods = (sizeof(Generic_Methods) / sizeof(Generic_Methods[0]));
if (Growable(field))
{
/* for a growable field we must assume zero terminated strings, because
somehow we have to detect the length of what should be copied.
*/
if (Growable(field))
{
/* for a growable field we must assume zero terminated strings, because
somehow we have to detect the length of what should be copied.
*/
wclear(field->working);
(void)mvwaddstr(field->working, 0, 0, value);
wclear(field->working);
(void)mvwaddstr(field->working, 0, 0, value);
- (void)mvwin_wchnstr(field->working, 0, i * field->dcols,
- widevalue + (i * field->dcols),
+ (void)mvwin_wchnstr(field->working, 0, (int)i * field->dcols,
+ widevalue + ((int)i * field->dcols),