static void CommentFieldsToDialog (DialoG d, Pointer data) { TagListPtr tlp; ValNodePtr fields, vnp; CharPtr str; tlp = (TagListPtr) GetObjectExtra (d); if (tlp == NULL) { return; } fields = (ValNodePtr) data; tlp->vnp = ValNodeFreeData (tlp->vnp); SendMessageToDialog (tlp->dialog, VIB_MSG_RESET); for (vnp = fields; vnp != NULL; vnp = vnp->next) { str = TagStringFromFieldRule (vnp->data.ptrvalue); if (str != NULL) { ValNodeAddPointer (&(tlp->vnp), 0, str); } } SendMessageToDialog (tlp->dialog, VIB_MSG_REDRAW); tlp->max = MAX ((Int2) 0, (Int2) (ValNodeLen (tlp->vnp) - tlp->rows)); CorrectBarMax (tlp->bar, tlp->max); CorrectBarPage (tlp->bar, tlp->rows - 1, tlp->rows - 1); if (tlp->max > 0) { SafeShow (tlp->bar); } else { SafeHide (tlp->bar); } }
static void ChangeConfigControls (NetConfigPtr ncp) { Boolean hasProxy; Int2 val; if (ncp == NULL) return; val = GetValue (ncp->srvConnMode); if (val == 1) { SafeHide (ncp->netGroup); } if (val == 3) { if (! Enabled (ncp->proxyHost)) { SafeSetTitle (ncp->proxyHost, ncp->proxyValue); } Enable (ncp->proxyHost); if (! Enabled (ncp->firewallProxy)) { SafeSetTitle (ncp->firewallProxy, ncp->firewallValue); } Enable (ncp->firewallProxy); } else { if (Enabled (ncp->proxyHost)) { GetTitle (ncp->proxyHost, ncp->proxyValue, sizeof (ncp->proxyValue)); SafeSetTitle (ncp->proxyHost, NULL); } Disable (ncp->proxyHost); if (Enabled (ncp->firewallProxy)) { GetTitle (ncp->firewallProxy, ncp->firewallValue, sizeof (ncp->firewallValue)); SafeSetTitle (ncp->firewallProxy, NULL); } Disable (ncp->firewallProxy); } hasProxy = (Boolean) (! TextHasNoText (ncp->proxyHost)); if (hasProxy) { if (! Enabled (ncp->proxyHost)) { SafeSetTitle (ncp->proxyHost, ncp->proxyValue); } Enable (ncp->proxyHost); if (! Enabled (ncp->proxyPort)) { SafeSetTitle (ncp->proxyPort, ncp->portValue); } Enable (ncp->proxyPort); } else { if (Enabled (ncp->proxyPort)) { GetTitle (ncp->proxyPort, ncp->portValue, sizeof (ncp->portValue)); SafeSetTitle (ncp->proxyPort, NULL); } Disable (ncp->proxyPort); } if (val != 1) { SafeShow (ncp->netGroup); } }
static void ChangeSpecType ( GrouP g ) { SscSpecPtr ssp; ssp = (SscSpecPtr) GetObjectExtra (g); if (ssp == NULL) return; SafeHide (ssp->controls [ssp->currPage]); Update (); ssp->currPage = GetValue (g); SafeShow (ssp->controls [ssp->currPage]); SafeShow (ssp->namegroup); Select (ssp->name); Update (); }
static void AddSpecMember ( ButtoN b ) { Char buf [128]; DollarAmountPtr dap; Int2 days = 0; MiscRatePtr mrp; SscSpecPtr ssp; SscTablesPtr stp; Int2 which; ssp = (SscSpecPtr) GetObjectExtra (b); if (ssp == NULL) return; stp = ssp->tables; if (stp == NULL) return; mrp = stp->miscrate_table; if (mrp == NULL) return; GetTitle (ssp->name, buf, sizeof (buf)); if (StringHasNoText (buf)) return; TrimSpacesAroundString (buf); if (! NormalizeAuthorCaps (buf)) return; which = GetValue (ssp->whichspec); if (which < 1) return; switch (which) { case 1 : days = mrp->special_memb_days; if (days < 0) { days = 0; } if (AddToTempMemberList (stp, buf, days)) { AddToContactList (stp->new_contacts, buf, VISITING_MEMBER); if (GetStatus (ssp->visitfee)) { dap = mrp->visiting_fee; if (dap != NULL) { AddFeeItem (stp->fees, buf, 0, NULL, dap->dollars, dap->cents, VISITING_MEMB_FEE, NULL, NULL); } } } break; case 2 : days = mrp->special_memb_days; if (days < 0) { days = 0; } if (AddToTempMemberList (stp, buf, days)) { AddToContactList (stp->new_contacts, buf, AFFIL_MEMBER); if (GetStatus (ssp->affilfee)) { dap = mrp->affiliated_fee; if (dap != NULL) { AddFeeItem (stp->fees, buf, 0, NULL, dap->dollars, dap->cents, AFFIL_MEMB_FEE, NULL, NULL); } } } break; case 3 : if (AddToFullMemberList (stp, buf, ssp->jobs)) { AddToContactList (stp->new_contacts, buf, TRANSIENT_MEMBER); if (GetStatus (ssp->transfee)) { dap = &(ssp->proratedtrans); if (dap != NULL) { AddFeeItem (stp->fees, buf, 0, NULL, dap->dollars, dap->cents, TRANS_MEMB_FEE, NULL, NULL); } } if (GetStatus (ssp->transssa)) { dap = &(ssp->proratedssa); if (dap != NULL) { AddFeeItem (stp->fees, buf, 0, NULL, dap->dollars, dap->cents, SSA_DUES_FEE, NULL, NULL); } } } break; default : break; } SafeHide (ssp->namegroup); SafeHide (ssp->controls [ssp->currPage]); SafeSetValue (ssp->whichspec, 0); ssp->currPage = 0; SetTitle (ssp->name, ""); SetStatus (ssp->visitfee, TRUE); SetStatus (ssp->affilfee, TRUE); SetStatus (ssp->transfee, TRUE); SetStatus (ssp->transssa, TRUE); SetClubJobs (ssp->jobs, FALSE, FALSE, FALSE, FALSE); Disable (b); Update (); }