home *** CD-ROM | disk | FTP | other *** search
- /*
- menusfb.c
-
- % menu_SetFieldBob
-
- C-scape 3.2
- Copyright (c) 1988, by Oakland Group, Inc.
- ALL RIGHTS RESERVED.
-
- Revision History:
- -----------------
- 12/15/88 jmd Added setting of owner ptr.
- 3/27/89 jdc added bob_Do(SETPARENT)
- 6/22/89 jmd Removed dependency check before bob_Do(SETPARENT)
- 8/10/89 jmd Converted bobs to wins
- 10/07/89 jdc Fixed so can use to swap bobs
- 3/28/90 jmd ansi-fied
- 6/25/90 jdc now old bob's lose their parents
- */
-
- #include "sed.h"
-
- boolean menu_SetFieldBob(menu_type menu, int fld, bob_type bob)
- /*
- add bob to list, attach it to field
- the list contains the field no the bob is attached to
- sets the bob's owner to the menu's sedptr.
- */
- {
- sed_type sed;
- int i;
-
- if (bob != NULL) {
-
- if (field_GetBob(menu_GetField(menu, fld)) != NULL) {
- /* find the bob */
- for (i = 0; ia_Get(menu->boba, i) != fld; i++) {
- ;
- }
- /* orphan the old bob */
- bob_SetParent(field_GetBob(menu_GetField(menu, fld)), NULL);
- }
- else {
- i = menu->bobcount;
- menu->bobcount++;
- }
- ia_Put(menu->boba, i, fld);
- field_SetBob(menu_GetField(menu, fld), bob);
-
- if ((sed = menu_GetSed(menu)) != NULL) {
- bob_SetParent(bob, sed);
- }
- return(TRUE);
- }
-
- return(FALSE);
- }
-
-