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 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 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); } }