Exemplo n.º 1
0
static Pointer DatePageToCalendarDatePtr (
  DialoG d
)

{
  CalendarDatePtr  cdp;
  UIEnum           day;
  DatePagePtr      dpp;
  UIEnum           month;
  UIEnum           year;

  cdp = NULL;
  dpp = (DatePagePtr) GetObjectExtra (d);
  if (dpp == NULL) return NULL;
  cdp = CalendarDateNew ();
  if (cdp != NULL) {

    if (GetEnumPopup (dpp->month, months_alist, &month)) {
      cdp->month = (Int4) month;
    } else {
      cdp->month = -1;
    }

    if (GetEnumPopup (dpp->day, days_alist, &day)) {
      cdp->day = (Int4) day;
    } else {
      cdp->day = -1;
    }

    if (GetEnumPopup (dpp->year, years_alist, &year)) {
      cdp->year = (Int4) year;
    } else {
      cdp->year = -1;
    }

    /*
    if (cdp->month == -1 || cdp->day == -1 || cdp->year == -1) {
      cdp = CalendarDateFree (cdp);
    }
    */
  }
  return (Pointer) cdp;
}
Exemplo n.º 2
0
static void ChangeReason (
  PopuP p
)

{
  IntBadgPtr  ibp;
  SscBadgPtr  sbp;
  UIEnum      val;

  sbp = (SscBadgPtr) GetObjectExtra (p);
  if (sbp == NULL) return;
  ibp = GetBadgInfo (sbp, sbp->currItem);
  if (ibp == NULL) return;

  if (GetEnumPopup (sbp->reason, reason_alist, &val)) {
    ibp->reason = (Int4) val;
  }

  UpdateDocument (sbp->badglog, sbp->currItem, sbp->currItem);
  Update ();

  CheckExtendTable (sbp);
}