Ejemplo n.º 1
0
extern void GetCalendarDate (
  DialoG d,
  Int4Ptr month,
  Int4Ptr day,
  Int4Ptr year
)

{
  CalendarDatePtr  cdp;

  if (d == NULL || month == NULL || day == NULL || year == NULL) return;

  cdp = (CalendarDatePtr) DialogToPointer (d);
  if (cdp != NULL) {
    *month = cdp->month;
    *day = cdp->day;
    *year = cdp->year;
    cdp = CalendarDateFree (cdp);
    return;
  }

  *month = -1;
  *day = -1;
  *year = -1;
}
Ejemplo n.º 2
0
static Pointer EndPointDialogToEndPointValNode (DialoG d)
{
  EndPointsDialogPtr epp;
  ValNodePtr         eplist;

  epp = (EndPointsDialogPtr) GetObjectExtra (d);
  if (epp != NULL)
  {
    eplist = (ValNodePtr) DialogToPointer (epp->dep);
  }
  return (Pointer) eplist;
}
Ejemplo n.º 3
0
static void UpdateRuleList (Pointer data)
{
  CommentSetDlgPtr dlg;
  CommentRulePtr new_cr, last_cr = NULL;

  dlg = (CommentSetDlgPtr) data;
  if (dlg == NULL) {
    return;
  }

  new_cr = DialogToPointer (dlg->rule_editor);

  ReplaceNthCommentRule (&(dlg->rule_list), new_cr, dlg->curr_item);
  ListRules (dlg->rule_list_dlg, dlg->rule_list, dlg->font);  
}
Ejemplo n.º 4
0
static Pointer CommentRuleFromDialog (DialoG d)
{
  CommentRuleDlgPtr dlg;
  CommentRulePtr    rule;

  dlg = (CommentRuleDlgPtr) GetObjectExtra (d);
  if (dlg == NULL) {
    return NULL;
  }

  rule = CommentRuleNew ();
  rule->prefix = SaveStringFromText (dlg->prefix);
  rule->fields = DialogToPointer (dlg->fields_dlg);
  return rule;
}
Ejemplo n.º 5
0
static void ClickRulesDoc (DoC d, PoinT pt)
{
  Int2               item, row, col, match;
  RecT               rct;
  CommentSetDlgPtr   dlg;
  BaR                sb_vert = NULL;
  Int2               scroll_pos = 0;
  CommentRulePtr     cr, last_cr = NULL;
  
  dlg = (CommentSetDlgPtr) GetObjectExtra (d);
  if (dlg == NULL || dlg->rule_list == NULL) return;
  
  MapDocPoint (d, pt, &item, &row, &col, &rct);
  if (item == 0 && dlg->rule_list == NULL) {
    cr = CommentRuleNew ();
    dlg->rule_list = cr;
    dlg->curr_item = 1;
    PointerToDialog (dlg->rule_editor, cr);
    ListRules (dlg->rule_list_dlg, dlg->rule_list, dlg->font);
  } else if (item > 0 && row > 0) {
    if (item != dlg->curr_item) {
      cr = DialogToPointer (dlg->rule_editor);
      ReplaceNthCommentRule (&(dlg->rule_list), cr, dlg->curr_item);

      cr = dlg->rule_list;
      match = 1;
      while (match < item && cr != NULL) {
        match++;
        last_cr = cr;
        cr = cr->next;
      }
      if (cr == NULL) {
        cr = CommentRuleNew ();
        if (last_cr == NULL) {
          dlg->rule_list = cr;
        } else {
          last_cr->next = cr;
        }
      }

      PointerToDialog (dlg->rule_editor, cr);
      dlg->curr_item = item;
      ListRules (dlg->rule_list_dlg, dlg->rule_list, dlg->font);
    }
  }
}
Ejemplo n.º 6
0
static void AcceptPrefsProc (ButtoN b)

{
  EntrezPrefsPtr  epp;
  PrefsFormPtr    pfp;

  pfp = (PrefsFormPtr) GetObjectExtra (b);
  if (pfp == NULL) return;
  Hide (pfp->form);
  epp = (EntrezPrefsPtr) DialogToPointer (pfp->prefs);
  if (epp != NULL) {
    entrezglobals.persistDefault = epp->persistDefault;
    entrezglobals.alignDefault = epp->alignDefault;
    entrezglobals.lookupDirect = epp->lookupDirect;
    entrezglobals.showAsn = epp->showAsn;
    ReplaceString (&entrezglobals.initDatabase, epp->initDatabase);
    ReplaceString (&entrezglobals.initField, epp->initField);
    ReplaceString (&entrezglobals.initMode, epp->initMode);
    ReplaceString (&medviewprocs.initMedLabel, epp->initMedLabel);
    ReplaceString (&seqviewprocs.initNucLabel, epp->initNucLabel);
    ReplaceString (&seqviewprocs.initProtLabel, epp->initProtLabel);
    ReplaceString (&seqviewprocs.initGenomeLabel, epp->initGenomeLabel);
    SetEntrezAppParamTF ("PREFERENCES", "PARENTSPERSIST", entrezglobals.persistDefault);
    SetEntrezAppParamTF ("PREFERENCES", "ALIGNCHECKED", entrezglobals.alignDefault);
    SetEntrezAppParamTF ("PREFERENCES", "LOOKUPDIRECT", entrezglobals.lookupDirect);
    SetEntrezAppParamTF ("PREFERENCES", "SHOWASNPAGE", entrezglobals.showAsn);
    SetEntrezAppParam ("SETTINGS", "DATABASE", entrezglobals.initDatabase);
    SetEntrezAppParam ("SETTINGS", "FIELD", entrezglobals.initField);
    SetEntrezAppParam ("SETTINGS", "MODE", entrezglobals.initMode);
    SetEntrezAppParam ("SETTINGS", "MEDPAGE", medviewprocs.initMedLabel);
    SetEntrezAppParam ("SETTINGS", "NUCPAGE", seqviewprocs.initNucLabel);
    SetEntrezAppParam ("SETTINGS", "PRTPAGE", seqviewprocs.initProtLabel);
    SetEntrezAppParam ("SETTINGS", "GENMPAGE", seqviewprocs.initGenomeLabel);
  }
  EntrezPrefsFree (epp);
  Remove (pfp->form);
}