home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
QBasic & Borland Pascal & C
/
Delphi5.iso
/
C
/
Samples
/
CSAPE32.ARJ
/
SOURCE
/
CSSRC
/
MENUTFFG.C
< prev
next >
Wrap
C/C++ Source or Header
|
1990-03-28
|
1KB
|
51 lines
/*
menutffg.c 4/10/88
% menu_TakeFieldFromGrid
C-scape 3.2
Copyright (c) 1988, by Oakland Group, Inc.
ALL RIGHTS RESERVED.
Revision History:
-----------------
6/24/88 jmd converted to new xarray/iarray calls
3/28/90 jmd ansi-fied
*/
#include "menu.h"
void menu_TakeFieldFromGrid(menu_type menu, int fieldno)
/*
Removes a field from the menu's field grid.
*/
{
int row, rfldno, lfldno, temp;
field_type field, rfield;
field = menu_GetField(menu, fieldno);
rfldno = field_GetRight(field);
lfldno = field_GetLeft(field);
if (lfldno == -1) {
/* adjust row array */
row = field_GetRow(field);
temp = rfldno + 1; /* make ia_Put macro work correctly */
ia_Put((menu)->fgrid, row, temp);
}
else {
field_SetRight(menu_GetField(menu, lfldno), rfldno);
}
if (rfldno >= 0) {
field_SetLeft(menu_GetField(menu, rfldno), lfldno);
/* adjust the gcols for the rest of the line */
while (rfldno >= 0) {
field_DecGCol(rfield = menu_GetField(menu, rfldno));
rfldno = field_GetRight(rfield);
}
}
}