Beispiel #1
0
/*======================================
 * key_util -- Return person's key value
 *====================================*/
void
key_util (void)
{
	RECORD indi = ask_for_indi(_("Whose key value do you want?"), NOASK1);
	if (!indi) return;
	msg_info("%s - %s", rmvat(nxref(nztop(indi))), indi_to_name(nztop(indi), 70));
}
Beispiel #2
0
/*==========================================================
 * ask_for_indi_key -- Have user identify person; return key
 *========================================================*/
STRING
ask_for_indi_key (STRING ttl, ASK1Q ask1)
{
	RECORD indi = ask_for_indi(ttl, ask1);
	if (!indi) return NULL;
	return rmvat(nxref(nztop(indi)));
}
Beispiel #3
0
/*==================================
 * prompt_add_child --  Add child to family
 * (with user interaction)
 *  child: [in] new child to add
 *  fam:   [in] family to which to add
 *================================*/
NODE
prompt_add_child (NODE child, NODE fam, RFMT rfmt)
{
	INT i;

	if (readonly) {
		message(_(qSronlye));
		return NULL;
	}

/* Identify child if caller did not */

	if (!child) child = nztop(ask_for_indi(_(qSidchld), DOASK1));
	if (!child) return NULL;

/* Warn if child to add is already in some family */
	if (FAMC(child)) {
		if (!ask_yes_or_no(_(qSiscinf)))
			return NULL;
	}

/* Identify family if caller did not */

	if (!fam) fam = nztop(ask_for_fam(_(qSidprnt), _(qSidsbln)));
	if (!fam) return NULL;

	i = ask_child_order(fam, ALWAYS_PROMPT, rfmt);
	if (i == -1) return NULL;

/* Add FAMC node to child */

	add_child_to_fam(child, fam, i);
	msg_status(_(qSgdcadd), indi_to_name(child, 35));
	return fam;
}
Beispiel #4
0
/*===========================================
 * ask_for_fam -- Ask user to identify family by spouses
 *  pttl: [IN]  title for prompt to identify spouse
 *  sttl: [IN]  title for prompt to identify sibling
 *=========================================*/
RECORD
ask_for_fam (STRING pttl, STRING sttl)
{
	RECORD sib=0, prn=0;
	prn = ask_for_indi(pttl, DOASK1);
	if (!prn)  {
		NODE fam=0;
		RECORD frec=0;
		sib = ask_for_indi(sttl, DOASK1);
		if (!sib) return NULL;
		fam = FAMC(nztop(sib));
		if (!fam) {
			message(_(qSntchld));
			return NULL;
		}
		frec = key_to_frecord(rmvat(nval(fam)));
		return frec;
	}
	if (!FAMS(nztop(prn))) {
		message(_(qSntprnt));
		return NULL;
	}
	return choose_family(prn, _(qSparadox), _(qSidfbrs), TRUE);
}