コード例 #1
0
ファイル: styleman.c プロジェクト: hsptools/hsp-wrap
Int2 Main ()
{
  WindoW w;
  w = FixedWindow(-50,-50,-10,-10,"Test",NULL);
  dlg1 = DialogText ( w, "", 10, NULL );
  dlg2 = DialogText ( w, "", 10, NULL );
  dlg3 = DialogText ( w, "", 10, NULL );
  dlg4 = DialogText ( w, "", 10, NULL );
  PushButton( w, "Manager", OnManager);
  PushButton( w, "GetParam", OnGetParam);
  PushButton( w, "Quit", OnQuit);
  Show(w);
  ProcessEvents();
  return 0;
}
コード例 #2
0
ファイル: cnsgnv.c プロジェクト: hsptools/hsp-wrap
static void ReadGIProc (ButtoN b)
{
  WindoW   w;
  GrouP    h, g;
  ButtoN   bt;
  TexT     pc;
  CharPtr  winprmt = "Entrez GI";
  XOSPtr   xosp;

  if ((xosp = (XOSPtr) GetObjectExtra (b)) != NULL)
  {
    w = MovableModalWindow (-60, -33, -10, -10, winprmt, CloseGIWindowProc);
    h = HiddenGroup (w, 1, 0, NULL);
    StaticPrompt (h, winprmt, StringWidth (winprmt),
                  dialogTextHeight, NULL, 'c');
    g = HiddenGroup (h, 2, 0, NULL);
    pc = DialogText (g, "", 8, NULL);
    bt = PushButton (h, "  Okay  ", SetGIProc);
    SetObjectExtra (pc, xosp, NULL);
    SetObjectExtra (bt, pc, NULL);
    Show (w);
    Select (w);
  }
  return;
}
コード例 #3
0
ファイル: cn3dxprt.c プロジェクト: hsptools/hsp-wrap
static void Cn3D_ExportPDB(IteM i)
{
    PDNMS pdnmsThis = NULL;
    PMSD pmsdThis = NULL;
    Char pcSavestr[60];
    Char pcSavename[32];
    CharPtr Cn3D_pcPDBName;
    GrouP g, g2, g3, g4;
    GrouP gMS;
    ButtoN b;

    if (Cn3D_Export_InUse)
        return;
    else
        Cn3D_Export_InUse = TRUE;

    pdnmsThis = GetSelectedModelstruc();
    if (!pdnmsThis) {
        Cn3D_Export_InUse = FALSE;
        return;
    }
    pmsdThis = (PMSD) pdnmsThis->data.ptrvalue;

    Cn3D_wPDBSave = ModalWindow(-20, -13, -10, -10, NULL);

    /* set up a group encolosing structures - models selection lists and - "info strings" */
    Cn3D_pcPDBName = StringSave(GetStrucStrings(pdnmsThis, PDB_ACC));
    sprintf(pcSavestr, "Save %s As a PDB Formatted File ...",
            Cn3D_pcPDBName);
    g = HiddenGroup(Cn3D_wPDBSave, 0, 3, NULL);
    SetGroupMargins(g, 10, 10);
    SetGroupSpacing(g, 10, 5);
    StaticPrompt(g, pcSavestr, 0, 0, systemFont, 'l');
    g2 = HiddenGroup(g, 2, 0, NULL);
    SetGroupMargins(g2, 10, 10);
    SetGroupSpacing(g2, 10, 5);
    StringNCpy(pcSavename, Cn3D_pcPDBName, 8);
    StringCat(pcSavename, ".pdb");
    Cn3D_tPDBSave =
        DialogText(g2, pcSavename, 18, (TxtActnProc) Cn3D_PDBEnableProc);
    MemFree(Cn3D_pcPDBName);

    Cn3D_bPDBBrowse =
        PushButton(g2, " browse...", (BtnActnProc) Cn3D_PDBBrowseProc);
    g3 = HiddenGroup(g, 2, 0, NULL);
    gMS = Cn3D_ModelSelect(g3, FALSE); /* no vector models for PDB files saves */
    g4 = HiddenGroup(g3, 0, 2, NULL);
    SetGroupMargins(g4, 10, 10);
    SetGroupSpacing(g4, 10, 5);
    Cn3D_bPDBOk = PushButton(g4, "OK", Cn3D_ExportPDBNow);
    b = PushButton(g4, "Cancel", Cn3D_CancelPDB);
    Cn3D_PDBEnableProc(NULL);
    Select(Cn3D_bPDBOk);
    /* disable appropriate stuff here */
    Cn3D_DisableFileOps();
    Show(Cn3D_wPDBSave);

    return;
}
コード例 #4
0
ファイル: dotmain.c プロジェクト: hsptools/hsp-wrap
static void DOT_SetupBlastParameters(GrouP g, DOTStartDataPtr sdata)
{
  GrouP g0, g1, g2, g3, g4, g5, gtotal;
  GrouP g_sub1, g_sub2;

  gtotal = HiddenGroup(g, 1, 6, NULL);

  sdata->plusorminus = NormalGroup(gtotal, 2,1, "",  systemFont,NULL);
  RadioButton(sdata->plusorminus, "both");
  RadioButton(sdata->plusorminus, "plus-plus");
  RadioButton(sdata->plusorminus, "plus-minus");
  SetValue(sdata->plusorminus, 1);
  
  g0 = HiddenGroup(gtotal, 2, 1, NULL);
  StaticPrompt(g0, "Program name: ", 0, 0, systemFont, 'l');
  sdata->progname = DialogText(g0, "blastn", 7, NULL);


  g1 = NormalGroup(gtotal, 4, 2, "",  systemFont,NULL);
  StaticPrompt(g1, "query start -- ", 0, 0, systemFont, 'l');
  sdata->querystart = DialogText(g1, "All", 5, NULL);
  StaticPrompt(g1, "query stop -- ", 0, 0, systemFont, 'l');
  sdata->querystop = DialogText(g1, "All", 5, NULL);
  StaticPrompt(g1, "subject start -- ", 0, 0, systemFont, 'l');
  sdata->subjectstart = DialogText(g1, "All", 5, NULL);
  StaticPrompt(g1, "subject stop -- ", 0, 0, systemFont, 'l');
  sdata->subjectstop = DialogText(g1, "All", 5, NULL);

  g3 = NormalGroup(gtotal, 1, 3, "Local Alignment Options", programFont, NULL);
  g_sub1 = NormalGroup(g3, 1,1, "",  programFont,NULL);
  g_sub2 = HiddenGroup(g_sub1, 3, 2, NULL);
  sdata->gapped = HiddenGroup(g_sub2, 0, 2, NULL);
  RadioButton(sdata->gapped, "gapped");
  RadioButton(sdata->gapped, "ungapped");
  SetValue(sdata->gapped, 1);
  
  g4 = NormalGroup(gtotal, 1,1, "Mask Regions",  programFont,NULL);
  g_sub1=HiddenGroup(g4, 0, 2, NULL);
  sdata->mask_repeats= CheckBox(g_sub1, "Mask Repeats", NULL);
  SetStatus(sdata->mask_repeats, FALSE);
  sdata->mask_simple = CheckBox(g_sub1, "Mask Simple Sequence", NULL);
  SetStatus(sdata->mask_simple, TRUE);
  
  sdata->megablast= CheckBox(gtotal, "Mega Blast", DOT_MegaBlast2Defaults);
  SetObjectExtra(sdata->megablast, (Pointer)sdata, NULL);
  SetStatus(sdata->megablast, FALSE);

  g5 = NormalGroup(gtotal, 1,1, "",  programFont,NULL);
  g_sub1 = HiddenGroup(g5, 2, 2, NULL);
  StaticPrompt(g_sub1, "E-value:  e-", 0, 0, programFont, 'l');
  sdata->eval = DialogText(g_sub1, "1", 5, NULL);
  StaticPrompt(g_sub1, "wordsize:", 0, 0, programFont, 'l');
  sdata->wordsize = DialogText(g_sub1, "11", 5, NULL);

}
コード例 #5
0
ファイル: dotmain.c プロジェクト: hsptools/hsp-wrap
static void DOT_SetupDotParameters(GrouP g, DOTStartDataPtr sdata, Boolean is_dot)
{
  GrouP g1, g2, g3, gtotal;

  if (is_dot == TRUE){
    gtotal = HiddenGroup(g, 1, 3, NULL);
    
    sdata->plusorminus = NormalGroup(gtotal, 2,1, "",  systemFont,NULL);
    RadioButton(sdata->plusorminus, "plus-plus");
    RadioButton(sdata->plusorminus, "plus-minus");
    SetValue(sdata->plusorminus, 1);
  }
  else
    gtotal = HiddenGroup(g, 1, 2, NULL);

  g2 = NormalGroup(gtotal, 4, 2, "",  systemFont,NULL);
  StaticPrompt(g2, "query start -- ", 0, 0, systemFont, 'l');
  sdata->querystart = DialogText(g2, "All", 5, NULL);
  StaticPrompt(g2, "query stop -- ", 0, 0, systemFont, 'l');
  sdata->querystop = DialogText(g2, "All", 5, NULL);
  StaticPrompt(g2, "subject start -- ", 0, 0, systemFont, 'l');
  sdata->subjectstart = DialogText(g2, "All", 5, NULL);
  StaticPrompt(g2, "subject stop -- ", 0, 0, systemFont, 'l');
  sdata->subjectstop = DialogText(g2, "All", 5, NULL);

  g3 = NormalGroup(gtotal, 2, 2, "",  systemFont,NULL);
  StaticPrompt(g3, "hitsize -- ", 0, 0, systemFont, 'l');
  sdata->hitsize = DialogText(g3, "100000", 5, NULL);
  StaticPrompt(g3, "wordsize -- ", 0, 0, systemFont, 'l');
  sdata->wordsize = DialogText(g3, "11", 5, NULL);
}
コード例 #6
0
ファイル: dotmain.c プロジェクト: hsptools/hsp-wrap
extern void DOT_readExisting(ButtoN b)
{
  WindoW  w;
  GrouP   g, g2, c;
  Char    szAppName  [10]={"D-Viewer"};
  DOTStartDataPtr sdata;

  sdata=(DOTStartDataPtr)GetObjectExtra(ParentWindow(b));
  if (!sdata) return;
  Hide(sdata->hStart);
  w = MovableModalWindow (-50, -33, -10, -10, "Local File", NULL);
  SetObjectExtra(w, (Pointer)sdata, NULL);
 if (w==NULL) return;
  g = NormalGroup(w, 1, 3, "File name:",  systemFont, NULL);
  SetGroupMargins(g, 10, 10);
  SetGroupSpacing(g, 10, 20);  
  g2=HiddenGroup(g, 2, 2, NULL);
  sdata->id1 = DialogText(g2,"",25, NULL);
  b = PushButton(g2, " browse...", DOT_OpenBrowse1Proc);
  SetObjectExtra (b, (Pointer) sdata, NULL);
  if (!GetStatus(sdata->seqa)){
    sdata->id2 = DialogText(g2,"",25, NULL);
    b = PushButton(g2, " browse...", DOT_OpenBrowse2Proc);
    SetObjectExtra (b, (Pointer) sdata, NULL);
    if (GetStatus(sdata->dot))
      DOT_SetupDotParameters(g, sdata, TRUE);
    else if (GetStatus(sdata->auto_blast))
      DOT_SetupDotParameters(g, sdata, FALSE);
    else 
      DOT_SetupBlastParameters(g, sdata);
  }
  c = HiddenGroup (g, 4, 0, NULL);
  DefaultButton(c, "OK",  DOT_OpenAcceptProc);
  PushButton(c, "Cancel",  DOT_CancelProc);
  Select(w);
  Show(w);
}
コード例 #7
0
ファイル: dotmain.c プロジェクト: hsptools/hsp-wrap
static void DOT_GetFromNetwork(ButtoN b)
{
  WindoW  w;
  GrouP   g, c;
  Char    szAppName  [10]={"D-Viewer"};
  DOTStartDataPtr sdata;

  sdata=(DOTStartDataPtr)GetObjectExtra(ParentWindow(b));
  if (!sdata) return;
  Hide(sdata->hStart);
  w = MovableModalWindow (-50, -33, -10, -10, "Download From NCBI", NULL);
  SetObjectExtra(w, (Pointer)sdata, NULL);
  if (w==NULL) return;
  SetGroupSpacing (w, 10, 10);
  /*accesion*/
  g = NormalGroup (w, 1, 4, "Entrez GI or Accession", systemFont,NULL);
  sdata->id1=DialogText (g, "", 10, NULL);
  sdata->id2=DialogText (g, "", 10, NULL);
  SetObjectExtra(w, (Pointer)sdata, NULL);
  if (GetStatus(sdata->dot))
    DOT_SetupDotParameters(g, sdata, TRUE);
  else if (GetStatus(sdata->auto_blast))
    DOT_SetupDotParameters(g, sdata, FALSE);
  else if (GetStatus(sdata->reg_blast))
    DOT_SetupBlastParameters(g, sdata);
  c = HiddenGroup (g, 4, 0, NULL);
  SetGroupMargins(c, 10, 10);
  SetGroupSpacing (c, 10, 20);
  DefaultButton (c, "Retrieve", DOT_AcceptNetworkProc);
  PushButton (c, "Cancel", DOT_CancelProc);
  AlignObjects (ALIGN_CENTER, (HANDLE) g, (HANDLE) c, NULL);
  RealizeWindow (w);
  Show (w);
  Select (w);
  Update ();
}
コード例 #8
0
ファイル: valdlg.c プロジェクト: hsptools/hsp-wrap
NLM_EXTERN DialoG CommentRuleDialog (GrouP h, Nlm_ChangeNotifyProc change_notify, Pointer change_userdata)
{
  CommentRuleDlgPtr dlg;
  GrouP             p, g1, g2;
  
  dlg = (CommentRuleDlgPtr) MemNew (sizeof (CommentRuleDlgData));
  if (dlg == NULL)
  {
    return NULL;
  }
  
  p = HiddenGroup (h, -1, 0, NULL);
  SetObjectExtra (p, dlg, StdCleanupExtraProc);

  dlg->dialog = (DialoG) p;
  dlg->todialog = CommentRuleToDialog;
  dlg->fromdialog = CommentRuleFromDialog;
  dlg->change_notify = change_notify;
  dlg->change_userdata = change_userdata;

  g1 = HiddenGroup (p, 2, 0, NULL);
  StaticPrompt (g1, "Prefix", 0, popupMenuHeight, programFont, 'r');
  dlg->prefix = DialogText (g1, "", 20, ChangeCommentRuleDialogPrefix);
  SetObjectExtra (dlg->prefix, dlg, NULL);

  g2 = HiddenGroup (p, 3, 0, NULL);
  StaticPrompt (g2, "Field Name", commentruleedit_widths[COMMENTRULEEDIT_FIELDNAME_COLUMN] * Nlm_stdCharWidth, popupMenuHeight, programFont, 'c');
  StaticPrompt (g2, "Match Expression", commentruleedit_widths[COMMENTRULEEDIT_MATCH_COLUMN] * Nlm_stdCharWidth, popupMenuHeight, programFont, 'c');
  StaticPrompt (g2, "Required", commentruleedit_widths[COMMENTRULEEDIT_REQUIRED_COLUMN] * Nlm_stdCharWidth, popupMenuHeight, programFont, 'c');

  dlg->fields_dlg = CommentRuleFieldsDialog (p);
  
  AlignObjects (ALIGN_CENTER, (HANDLE) g1, (HANDLE) g2, (HANDLE) dlg->fields_dlg, NULL);
  
  return (DialoG) p;
}
コード例 #9
0
ファイル: styleman.c プロジェクト: hsptools/hsp-wrap
/**************************************************************************
* NewStyleDialog()
**************************************************************************/
static Boolean
/*FCN*/NewStyleDialog (
  Int2 srcStyle
){
  GrouP g, tg;
  TexT  nsdDialogText;
  Char  newName[64];

  if ( nsdStatus & SM_DLG_UP ) return FALSE;
  nsdStatus = SM_DLG_UP;
  nsdWindow = FixedWindow (-50, -33, -10, -10, "Copy Style", NULL );
  g = HiddenGroup ( nsdWindow, 1, 2, NULL); 
  tg = HiddenGroup ( g, 2, 1, NULL); 
  StaticPrompt ( tg, "To:", 0, 0, systemFont, 'l');
  nsdDialogText = DialogText ( tg, "", 20, NULL );
  tg = HiddenGroup ( g, 2, 1, NULL);
  SetGroupMargins ( tg, 7*Nlm_stdCharWidth, 5 );
  PushButton ( tg, "OK", OnOKButton ),
  PushButton ( tg, "Cancel", OnCancelButton );
  RealizeWindow ( nsdWindow );
  Show ( nsdWindow );
  Select ( nsdWindow );
  Nlm_WaitForCondition ( nsdStatus & SM_DLG_UP);
  GetTitle ( nsdDialogText, newName, 64 );
  newName[63] = 0;
  Nlm_ProcessAnEvent ();
  Hide ( nsdWindow );
  Remove ( nsdWindow );
  Select ( window );
  if ( nsdStatus & SM_DLG_OK ){
    if ( Nlm_CopyMuskStyle ( newName, srcStyle ) != -1 ) 
      return TRUE;
    else Message ( MSG_ERROR, "Can not create style %s", newName );
  }
  return FALSE;
} /*End of NewStyleDialog() */
コード例 #10
0
ファイル: cn3dxprt.c プロジェクト: hsptools/hsp-wrap
static void Cn3D_ExportKin(IteM i)
{
    PDNMS pdnmsThis = NULL;
    PMSD pmsdThis = NULL;
    Char pcSavestr[60];
    Char pcSavename[32];
    CharPtr Cn3D_pcKinName;
    GrouP g, g2, g3, g4;
    GrouP gMS;
    ButtoN b;
    Int2 iCount;

    if (Cn3D_Export_InUse)
        return;
    else
        Cn3D_Export_InUse = TRUE;

    pdnmsThis = GetSelectedModelstruc();
    if (!pdnmsThis) {
        Cn3D_Export_InUse = FALSE;
        return;
    }
    pmsdThis = (PMSD) pdnmsThis->data.ptrvalue;

    Cn3D_wKinSave = ModalWindow(-20, -13, -10, -10, NULL);

    /* set up a group encolosing structures - models selection lists and - "info strings" */
    Cn3D_pcKinName = StringSave(GetStrucStrings(pdnmsThis, PDB_ACC));
    sprintf(pcSavestr, "Save %s As a Kinemage Rendered File ...",
            Cn3D_pcKinName);
    g = HiddenGroup(Cn3D_wKinSave, 0, 5, NULL);
    SetGroupMargins(g, 10, 10);
    SetGroupSpacing(g, 10, 5);
    StaticPrompt(g, pcSavestr, 0, 0, systemFont, 'l');
    g2 = HiddenGroup(g, 2, 0, NULL);
    SetGroupMargins(g2, 10, 10);
    SetGroupSpacing(g2, 10, 5);
    StringNCpy(pcSavename, Cn3D_pcKinName, 8);
    StringCat(pcSavename, ".kin");
    Cn3D_tKinSave =
        DialogText(g2, pcSavename, 18, (TxtActnProc) Cn3D_KinEnableProc);
    MemFree(Cn3D_pcKinName);

    Cn3D_bKinBrowse =
        PushButton(g2, " browse...", (BtnActnProc) Cn3D_KinBrowseProc);
    g3 = HiddenGroup(g, 2, 0, NULL);
    gMS = Cn3D_ModelSelect(g3, FALSE); /* no vector models for Kin files saves */
    g4 = HiddenGroup(g3, 0, 2, NULL);
    SetGroupMargins(g4, 10, 10);
    SetGroupSpacing(g4, 10, 5);
    Cn3D_bKinOk = PushButton(g4, "OK", Cn3D_ExportKinNow);
    b = PushButton(g4, "Cancel", Cn3D_CancelKin);

    Cn3D_gColorAtoms =
        NormalGroup(g, 2, 2, " color by...", systemFont, NULL);
    SetGroupMargins(Cn3D_gColorAtoms, 10, 10);
    SetGroupSpacing(Cn3D_gColorAtoms, 10, 5);
    RadioButton(Cn3D_gColorAtoms, "Molecule number");
    RadioButton(Cn3D_gColorAtoms, "Secondary Structure & Residue Type");
    RadioButton(Cn3D_gColorAtoms, "Thermal Factors");
    RadioButton(Cn3D_gColorAtoms, "Element");
    SetValue(Cn3D_gColorAtoms, 1);

    Cn3D_gRenderOpts =
        NormalGroup(g, 2, 3, " viewable subsets...", systemFont, NULL);
    Cn3D_bRender[0] = CheckBox(Cn3D_gRenderOpts, "Virtual Backbone", NULL);
    Cn3D_bRender[1] = CheckBox(Cn3D_gRenderOpts, "Real Backbone", NULL);
    Cn3D_bRender[2] = CheckBox(Cn3D_gRenderOpts, "Residues", NULL);
    Cn3D_bRender[3] = CheckBox(Cn3D_gRenderOpts, "Heterogens", NULL);
    Cn3D_bRender[4] =
        CheckBox(Cn3D_gRenderOpts, "Alternate Conformations", NULL);
    Cn3D_bRender[5] = CheckBox(Cn3D_gRenderOpts, "NMR Animations", NULL);
    for (iCount = 0; iCount < 6; iCount++)
        SetStatus(Cn3D_bRender[iCount], TRUE);

    Cn3D_KinEnableProc(NULL);
    Select(Cn3D_bKinOk);
    /* disable appropriate stuff here */
    Cn3D_DisableFileOps();
    Show(Cn3D_wKinSave);

    return;
}
コード例 #11
0
ファイル: sscawrd.c プロジェクト: fbtestrepo/hw
extern DialoG CreateBadgesDialog (
  GrouP prnt,
  SscTablesPtr stp
)

{
  GrouP       cts, tbl, g0, g1, g2, p;
  FonT        fnt;
  Int2        i, hgt, max, wid;
  SscBadgPtr  sbp;

  sbp = (SscBadgPtr) MemNew (sizeof (SscBadg));
  if (sbp == NULL) return NULL;

  p = HiddenGroup (prnt, -1, 0, NULL);
  SetGroupSpacing (p, 10, 10);

  SetObjectExtra (p, sbp, StdCleanupExtraProc);
  sbp->dialog = (DialoG) p;
  sbp->todialog = AwardDataPtrToAdjPage;
  sbp->fromdialog = AdjPageToAwardDataPtr;

  sbp->tables = stp;

  SelectFont (systemFont);
  hgt = LineHeight ();
  badgColFmt [0].pixWidth = 25 * StringWidth ("X") + 5;
  max = StringWidth ("Diamond Distance ");
  badgColFmt [1].pixWidth = max + 5;
  SelectFont (systemFont);

  wid = 0;
  for (i = 0; i < 2; i++) {
    wid += badgColFmt [i].pixWidth;
  }

  tbl = HiddenGroup (p, -1, 0, NULL);
  SetGroupSpacing (tbl, 10, 5);
  SetGroupMargins (tbl, 5, 5);

  g0 = HiddenGroup (tbl, 15, 0, NULL);
  SetGroupSpacing (g0, 0, 3);
#ifdef WIN_MSWIN
  fnt = systemFont;
#else
  fnt = programFont;
#endif
  StaticPrompt (g0, "Name", badgColFmt [0].pixWidth, 0, fnt, 'c');
  StaticPrompt (g0, "Award", badgColFmt [1].pixWidth, 0, fnt, 'c');

  sbp->badglog = DocumentPanel (tbl, wid + 2, NUM_BADGE_LINES * hgt + 2);
  SetObjectExtra (sbp->badglog, sbp, NULL);
  SetDocCache (sbp->badglog, NULL, NULL, NULL);
  SetDocNotify (sbp->badglog, ChangeBadgTableSelect);
  sbp->numBadgs = 0;

  for (i = 0; i < NUM_BADGE_LINES; i++) {
    AppendItem (sbp->badglog, PrintBadgTable, sbp, FALSE, 1,
                &badgParFmt, badgColFmt, systemFont);
  }

  cts = HiddenGroup (p, -1, 0, NULL);
  SetGroupSpacing (cts, 10, 10);
  SetGroupMargins (cts, 5, 5);

  g1 = HiddenGroup (cts, -10, 0, NULL);
  SetGroupSpacing (g1, 10, 5);

  StaticPrompt (g1, "Name", 0, popupMenuHeight, programFont, 'l');
  sbp->name = CreateEnumPopupDialog (g1, TRUE, ChangeName, stp->payers.alist, (UIEnum) 0, sbp);

  StaticPrompt (g1, "Award", 0, popupMenuHeight, programFont, 'l');
  sbp->reason = CreateEnumPopupDialog (g1, TRUE, ChangeReason, reason_alist, (UIEnum) 0, sbp);
  SetObjectExtra (sbp->reason, sbp, NULL);

  g2 = HiddenGroup (cts, -10, 0, NULL);
  SetGroupSpacing (g2, 10, 5);

  StaticPrompt (g2, "Comment", 0, dialogTextHeight, programFont, 'l');
  sbp->comment = DialogText (g2, "", 20, ChangeComment);
  SetObjectExtra (sbp->comment, sbp, NULL);

  AlignObjects (ALIGN_CENTER, (HANDLE) tbl, (HANDLE) cts, NULL);

  sbp->numBadgs = 0;
  sbp->currItem = 1;

  return (DialoG) p;
}
コード例 #12
0
ファイル: netcnfg.c プロジェクト: hsptools/hsp-wrap
extern void ShowNetConfigForm (WndActnProc activate, FormMessageFunc messages,
                               VoidProc accepted, VoidProc cancelled,
                               VoidProc turnedOff, Boolean netCurrentlyOn)
{
  ButtoN        b;
  GrouP         c;
  GrouP         g;
  GrouP         h;
  GrouP         j;
  Int2          len;
  NetConfigPtr  ncp;
  PrompT        ppt0, ppt1;
  ButtoN        rb;
  Char          str [256];
  WindoW        w;
  GrouP         x;
  GrouP         z;

  w = NULL;
  ncp = (NetConfigPtr) MemNew (sizeof (NetConfigData));
  if (ncp != NULL) {

    w = FixedWindow (-50, -33, -10, -10, "Network Configuration",
                     StdSendCloseWindowMessageProc);
    SetObjectExtra (w, ncp, StdCleanupFormProc);
    ncp->form = (ForM) w;
    ncp->formmessage = ConfigMessageProc;

    ncp->appmessage = messages;
    ncp->activate = activate;
    SetActivate (w, ConfigFormActivate);

    ncp->accepted = accepted;
    ncp->cancelled = cancelled;
    ncp->turnedOff = turnedOff;

    h = HiddenGroup (w, -1, 0, NULL);
    SetGroupSpacing (h, 5, 10);

    j = HiddenGroup (h, 2, 0, NULL);
    ppt0 = StaticPrompt (j, "Connection", 0, 0, programFont, 'l');
    ncp->srvConnMode = HiddenGroup (j, 4, 0, ChangeConnection);
    SetObjectExtra (ncp->srvConnMode, ncp, NULL);
    rb = RadioButton (ncp->srvConnMode, "None");
    RadioButton (ncp->srvConnMode, "Normal");
    RadioButton (ncp->srvConnMode, "Firewall");
    /* RadioButton (ncp->srvConnMode, "Stateless"); */
    SetValue (ncp->srvConnMode, 2);
    if (turnedOff == NULL) {
      Disable (rb);
    }
    AlignObjects (ALIGN_MIDDLE, (HANDLE) ppt0, (HANDLE) ncp->srvConnMode, NULL);

    ncp->netGroup = HiddenGroup (h, -1, 0, NULL);
    SetGroupSpacing (ncp->netGroup, 5, 10);
  
    SelectFont (programFont);
    len = StringWidth ("HTTP Proxy Server ") + 2;
    SelectFont (systemFont);

    z = HiddenGroup (ncp->netGroup, -2, 0, NULL);
    StaticPrompt (z, "HTTP Proxy Server", len, dialogTextHeight, programFont, 'l');
    ncp->proxyHost = DialogText (z, "", 12, ChangeProxy);
    SetObjectExtra (ncp->proxyHost, ncp, NULL);
    /*
    StaticPrompt (z, "", 0, 0, programFont, 'l');
    StaticPrompt (z, "", 0, 0, programFont, 'l');
    */
    ppt0 = StaticPrompt (z, "HTTP Proxy Port ", len, dialogTextHeight, programFont, 'l');
    ncp->proxyPort = DialogText (z, "", 3, NULL);
    x = MultiLinePrompt (z, "Non-transparent Proxy Server", len, programFont);
    ncp->firewallProxy = DialogText (z, "", 12, NULL);
    AlignObjects (ALIGN_MIDDLE, (HANDLE) x, (HANDLE) ncp->firewallProxy, NULL);
    /*
    AlignObjects (ALIGN_MIDDLE, (HANDLE) ppt0, (HANDLE) ncp->proxyPort,
                  (HANDLE) ncp->firewallProxy, NULL);
    */
    AlignObjects (ALIGN_RIGHT, (HANDLE) ncp->proxyHost, (HANDLE) ncp->firewallProxy, NULL);
    AlignObjects (ALIGN_LEFT, (HANDLE) ncp->proxyHost, (HANDLE) ncp->firewallProxy, NULL);

    g = HiddenGroup (ncp->netGroup, 5, 0, NULL);
    /*
    ppt0 = StaticPrompt (g, "Domain name server", 0, 0, programFont, 'l');
    ncp->dnsAvailable = CheckBox (g, "Available", NULL);
    */
    ncp->dnsAvailable = CheckBox (g, "Domain Name Server", NULL);
    SetStatus (ncp->dnsAvailable, TRUE);
    /* StaticPrompt (g, " ", 0, 0, programFont, 'l'); */
    ppt1 = StaticPrompt (g, "Timeout", 0, popupMenuHeight, programFont, 'l');
    ncp->timeOut = PopupList (g, TRUE, NULL);
    PopupItem (ncp->timeOut, "10 seconds");
    PopupItem (ncp->timeOut, "30 seconds");
    PopupItem (ncp->timeOut, "60 seconds");
    PopupItem (ncp->timeOut, " 5 minutes");
    SetValue (ncp->timeOut, 2);
    AlignObjects (ALIGN_MIDDLE, /* (HANDLE) ppt0, */ (HANDLE) ncp->dnsAvailable,
                  (HANDLE) ppt1, (HANDLE) ncp->timeOut, NULL);

    c = HiddenGroup (w, 4, 0, NULL);
    SetGroupSpacing (c, 10, 2);
    ncp->accept = PushButton (c, "Accept", AcceptNetConfigForm);
    SetObjectExtra (ncp->accept, ncp, NULL);
    b = PushButton (c, "Cancel", StdSendCancelButtonMessageProc);
    SetObjectExtra (b, ncp, NULL);

    /*
    AlignObjects (ALIGN_CENTER, (HANDLE) h, (HANDLE) c, NULL);
    */
    AlignObjects (ALIGN_CENTER, (HANDLE) j, (HANDLE) z, (HANDLE) g, (HANDLE) c, NULL);

    RealizeWindow (w);

    if (! netCurrentlyOn) {
      SafeSetValue (ncp->srvConnMode, 1);
      Hide (ncp->netGroup);
    } else if (GetAppParam ("NCBI", "CONN", "FIREWALL", NULL, str, sizeof (str))) {
      if (StringICmp (str, "TRUE") == 0) {
        SafeSetValue (ncp->srvConnMode, 3);
      }
    }
    if (GetAppParam ("NCBI", "CONN", "HTTP_PROXY_HOST", NULL, str, sizeof (str))) {
      if (! StringHasNoText (str)) {
        SafeSetTitle (ncp->proxyHost, str);
        if (GetValue (ncp->srvConnMode) == 2) {
          SafeSetValue (ncp->srvConnMode, 3);
        }
      }
    }
    if (GetAppParam ("NCBI", "CONN", "HTTP_PROXY_PORT", NULL, str, sizeof (str))) {
      if (! StringHasNoText (str)) {
        SafeSetTitle (ncp->proxyPort, str);
      }
    }
    if (GetAppParam ("NCBI", "CONN", "PROXY_HOST", NULL, str, sizeof (str))) {
      if (! StringHasNoText (str)) {
        SafeSetTitle (ncp->firewallProxy, str);
      }
    }
    if (GetAppParam ("NCBI", "CONN", "HOST", NULL, str, sizeof (str))) {
      if (StringICmp (str, "130.14.29.110") == 0) {
        SafeSetStatus (ncp->dnsAvailable, FALSE);
      }
    }
    if (GetAppParam ("NCBI", "CONN", "TIMEOUT", "30", str, sizeof (str))) {
      if (StringICmp (str, "10") == 0) {
        SafeSetValue (ncp->timeOut, 1);
      } else if (StringICmp (str, "60") == 0) {
        SafeSetValue (ncp->timeOut, 3);
      } else if (StringICmp (str, "300") == 0) {
        SafeSetValue (ncp->timeOut, 4);
      } else {
        SafeSetValue (ncp->timeOut, 2);
      }
    }

    ChangeConfigControls (ncp);

    Show (w);
    Select (w);
    Select (ncp->proxyHost);
  }
}
コード例 #13
0
ファイル: smdlg2.c プロジェクト: hsptools/hsp-wrap
GrouP 
/*FCN*/Nlm_CreateDlgGroup ( 
  GrouP gTop
){
  GrouP    g, glr, g1, g2;
  Handle   toAlign[3];

  g = HiddenGroup ( gTop, 2, 1, NULL);
  SetGroupSpacing ( g, 1, 1 );
  glr = NormalGroup ( g, 1, 2, "Groups:", systemFont, NULL );
#ifdef WIN_MOTIF
  SetGroupSpacing ( glr, 12, 12 );
  SetGroupMargins ( glr, 8, 8 );
#else
  SetGroupSpacing ( glr, 6, 6 );
  SetGroupMargins ( glr, 6, 6 );
#endif
  g1 = HiddenGroup ( glr, 2, 1, NULL );
  g2 = HiddenGroup ( g1, 1, 0, NULL );
  PushButton ( g2, "Top", OnGroupTop );
  PushButton ( g2, "Bottom", OnGroupBottom );
  groupHideButton = PushButton ( g2, "Hide", OnGroupHide );
  groupCompBox = CheckBox ( g2, "Compress", OnGroupCompress );
  groupDelButton = PushButton ( g2, "Delete", OnGroupDelete );
  groupList = SingleList ( g1, 10, 8, OnGroupList );
  curGroupInd = 0;
  LoadGroupArray();
  g2 = HiddenGroup ( glr, 3, 0, NULL );
  toAlign[2] = (Handle)PushButton ( g2, "Create", OnGroupNew );
  toAlign[0] = (Handle)StaticPrompt ( g2, "Group", 0, 0, systemFont, 'l');
#ifdef WIN_MOTIF
  groupDialog = DialogText ( g2, "", 7, OnText16 );
#else
  groupDialog = DialogText ( g2, "", 9, OnText16 );
#endif
  toAlign[1] = (Handle)groupDialog;
  AlignObjects ( ALIGN_CENTER, (HANDLE)g1, (HANDLE)g2, NULL );

  featGroup = glr = NormalGroup ( g, 1, 2, "Features:", systemFont, NULL );
#ifdef WIN_MOTIF
  SetGroupSpacing ( glr, 12, 12 );
  SetGroupMargins ( glr, 8, 8 );
#else
  SetGroupSpacing ( glr, 6, 6 );
  SetGroupMargins ( glr, 6, 6 );
#endif
  g1 = HiddenGroup ( glr, 2, 1, NULL );
  featList = SingleList ( g1, 10, 8, OnFeatureList );
  LoadFeatureArray();
  FillFeatList( FALSE );
  if ( totalFeatures == 0 ){
    curFeatureInd = -1;
  } else {
    curFeatureInd = 0;
    SetValue ( featList, 1 );
  }
  g2 = HiddenGroup ( g1, 1, 0, NULL );
  PushButton ( g2, "Top", OnFeatTop );
  PushButton ( g2, " Bottom ", OnFeatBottom );
  featHideButton = PushButton ( g2, "Hide", OnFeatHide );
  g2 = HiddenGroup ( glr, 3, 0, NULL );
#ifdef WIN_MOTIF
  SetGroupMargins ( g2, 8, 8 );
#endif
  toAlign[0] = (Handle)PushButton ( g2, "Move", OnFeatMove );
  toAlign[1] = (Handle)StaticPrompt ( g2, "To", 0, 0, systemFont, 'l');
  featPopup = PopupList ( g2, FALSE, NULL );
  toAlign[2] = (Handle)featPopup;
  FillGroupList(FALSE);
  SetGroupValue (curGroupInd);
  FillFeatPopup(FALSE);
  UpdateDlgControls ();
  return g;
}
コード例 #14
0
ファイル: dialogs.c プロジェクト: mingpen/OpenNT
BOOL FAR PASCAL GraphOptionDlg(HWND hDlg, WORD msg, DWORD wParam, LONG lParam)
/***************************************************************************/
{
static GRAPH_OPTIONS goLocalCopy ;

INT            iTimeMilliseconds ;
TCHAR          szBuff[MiscTextLen] ;
PGRAPHSTRUCT   lgraph;

   lParam ;
   lgraph = pGraphs;

   switch(msg)
      {

      case WM_INITDIALOG:

         dwCurrentDlgID = HC_PM_idDlgOptionChart ;

         // Init the Radio button, Check boxes and text fields.

         goLocalCopy.iGraphOrHistogram =
            lgraph->gOptions.iGraphOrHistogram ;
         if (lgraph->gOptions.iGraphOrHistogram == LINE_GRAPH)
            CheckRadioButton(hDlg, ID_GRAPH, ID_HISTOGRAM, ID_GRAPH) ;
         else
            CheckRadioButton(hDlg, ID_GRAPH, ID_HISTOGRAM, ID_HISTOGRAM) ;

         CheckDlgButton(hDlg, ID_LEGEND, lgraph->gOptions.bLegendChecked) ;
         if (!(lgraph->gOptions.bLegendChecked))
            {
            // can't display valuebar w/o legend
            DialogEnable (hDlg, IDD_CHARTOPTIONSVALUEBAR, FALSE) ;
            }

         CheckDlgButton(hDlg, ID_LABELS, lgraph->gOptions.bLabelsChecked) ;
         CheckDlgButton(hDlg, ID_VERT_GRID, lgraph->gOptions.bVertGridChecked) ;
         CheckDlgButton(hDlg, ID_HORZ_GRID, lgraph->gOptions.bHorzGridChecked) ;
         CheckDlgButton(hDlg, IDD_CHARTOPTIONSVALUEBAR,
            lgraph->gOptions.bStatusBarChecked) ;

         TSPRINTF(szBuff, TEXT("%d"), lgraph->gOptions.iVertMax) ;
         SendDlgItemMessage(hDlg, ID_VERT_MAX, WM_SETTEXT, 0, (LONG) szBuff) ;

         TSPRINTF(szBuff, TEXT("%3.3f"), lgraph->gOptions.eTimeInterval) ;
         ConvertDecimalPoint (szBuff);
         SendDlgItemMessage(hDlg, IDD_CHARTOPTIONSINTERVAL, WM_SETTEXT, 0, (LONG) szBuff) ;

         // Pickup a local copy of the Graph Options.

         goLocalCopy = lgraph->gOptions ;
         LocalManualRefresh = lgraph->bManualRefresh ;

         CheckRadioButton (hDlg,
               IDD_CHARTOPTIONSMANUALREFRESH,
               IDD_CHARTOPTIONSPERIODIC,
               LocalManualRefresh ? IDD_CHARTOPTIONSMANUALREFRESH :
               IDD_CHARTOPTIONSPERIODIC) ;

         if (lgraph->bManualRefresh)
            {
            DialogEnable (hDlg, IDD_CHARTOPTIONSINTERVALTEXT, FALSE) ;
            DialogEnable (hDlg, IDD_CHARTOPTIONSINTERVAL, FALSE) ;
            }
         else
            {
            DialogEnable (hDlg, IDD_CHARTOPTIONSINTERVALTEXT, TRUE) ;
            DialogEnable (hDlg, IDD_CHARTOPTIONSINTERVAL, TRUE) ;
            }

         EditSetLimit (GetDlgItem(hDlg, ID_VERT_MAX),
            sizeof(szBuff) / sizeof(TCHAR) - 1) ;

         EditSetLimit (GetDlgItem(hDlg, IDD_CHARTOPTIONSINTERVAL),
            ShortTextLen) ;

         WindowCenter (hDlg) ;
         return(TRUE);

      case WM_COMMAND:
         switch(LOWORD(wParam))
            {
            case ID_VERT_MAX:
               if (HIWORD(wParam) == EN_CHANGE)
                  {
                  DialogText(hDlg, ID_VERT_MAX, szBuff) ;
                  swscanf(szBuff, TEXT("%d"), &goLocalCopy.iVertMax) ;
                  }
               break ;


            case IDD_CHARTOPTIONSINTERVAL:
               if (HIWORD(wParam) == EN_CHANGE)
                  {
                  goLocalCopy.eTimeInterval =
                     DialogFloat (hDlg, IDD_CHARTOPTIONSINTERVAL, NULL) ;
                  }
               break ;

            case IDD_CHARTOPTIONSPERIODIC:
            case IDD_CHARTOPTIONSMANUALREFRESH:
               // check if the Manual refresh is currently checked.
               // Then toggle the ManualRefresh button
               LocalManualRefresh =
                  IsDlgButtonChecked (hDlg, IDD_CHARTOPTIONSMANUALREFRESH) ;
               CheckRadioButton (hDlg,
                  IDD_CHARTOPTIONSMANUALREFRESH,
                  IDD_CHARTOPTIONSPERIODIC,
                  LocalManualRefresh ? IDD_CHARTOPTIONSPERIODIC :
                  IDD_CHARTOPTIONSMANUALREFRESH) ;

               // gray out time interval if necessary...
               DialogEnable (hDlg, IDD_CHARTOPTIONSINTERVALTEXT,
                  LocalManualRefresh) ;
               DialogEnable (hDlg, IDD_CHARTOPTIONSINTERVAL,
                  LocalManualRefresh) ;
               LocalManualRefresh = !LocalManualRefresh ;
               break ;

            case IDD_CHARTOPTIONSVALUEBAR:
               if (goLocalCopy.bStatusBarChecked == TRUE)
                  goLocalCopy.bStatusBarChecked = FALSE ;
               else
                  goLocalCopy.bStatusBarChecked = TRUE ;
               break ;


            case ID_LEGEND:
               if (goLocalCopy.bLegendChecked == TRUE)
                  goLocalCopy.bLegendChecked = FALSE ;
               else
                  goLocalCopy.bLegendChecked = TRUE ;

               DialogEnable (hDlg, IDD_CHARTOPTIONSVALUEBAR,
                  goLocalCopy.bLegendChecked) ;

               break ;


            case ID_LABELS:
               if (goLocalCopy.bLabelsChecked == TRUE)
                  goLocalCopy.bLabelsChecked = FALSE ;
               else
                  goLocalCopy.bLabelsChecked = TRUE ;
               break ;


            case ID_VERT_GRID:
               if (goLocalCopy.bVertGridChecked == TRUE)
                  goLocalCopy.bVertGridChecked = FALSE ;
               else
                  goLocalCopy.bVertGridChecked = TRUE ;
               break ;


            case ID_HORZ_GRID:
               if (goLocalCopy.bHorzGridChecked == TRUE)
                  goLocalCopy.bHorzGridChecked = FALSE ;
               else
                  goLocalCopy.bHorzGridChecked = TRUE ;
               break ;


            case ID_GRAPH:
            case ID_HISTOGRAM:
               if (goLocalCopy.iGraphOrHistogram == BAR_GRAPH)
                  {
                  goLocalCopy.iGraphOrHistogram = LINE_GRAPH ;
                  }
               else
                  {
                  goLocalCopy.iGraphOrHistogram = BAR_GRAPH ;
                  }
               CheckRadioButton(hDlg, ID_GRAPH, ID_HISTOGRAM,
                  goLocalCopy.iGraphOrHistogram == LINE_GRAPH ?
                  ID_GRAPH : ID_HISTOGRAM) ;

               break ;

            case IDOK:
               //  verify some numeric entries first
               if (goLocalCopy.iVertMax > MAX_VERTICAL ||
                   goLocalCopy.iVertMax < MIN_VERTICAL)
                  {
                  DlgErrorBox (hDlg, ERR_BADVERTMAX) ;
                  SetFocus (DialogControl (hDlg, ID_VERT_MAX)) ;
                  EditSetTextEndPos (hDlg, ID_VERT_MAX) ;
                  return (FALSE) ;
                  break ;
                  }
               if (goLocalCopy.eTimeInterval > MAX_INTERVALSEC ||
                   goLocalCopy.eTimeInterval < MIN_INTERVALSEC)
                  {
                  DlgErrorBox (hDlg, ERR_BADTIMEINTERVAL) ;
                  SetFocus (DialogControl (hDlg, IDD_CHARTOPTIONSINTERVAL)) ;
                  EditSetTextEndPos (hDlg, IDD_CHARTOPTIONSINTERVAL) ;
                  return (FALSE) ;
                  break ;
                  }

               // We need to send a size message to the main window
               // so it can setup the redraw of the graph and legend.

               lgraph->gOptions.bLegendChecked    = goLocalCopy.bLegendChecked ;
               lgraph->gOptions.bStatusBarChecked = goLocalCopy.bStatusBarChecked ;

               if (lgraph->gOptions.eTimeInterval != goLocalCopy.eTimeInterval
                  && !LocalManualRefresh)
                  {
                  iTimeMilliseconds = (INT) (goLocalCopy.eTimeInterval * (FLOAT) 1000.0) ;
                  pGraphs->gInterval = iTimeMilliseconds ;
                  lgraph->bManualRefresh = LocalManualRefresh ;

                  }
               else if (LocalManualRefresh != lgraph->bManualRefresh)
                  {
                  ToggleGraphRefresh (hWndGraph) ;
                  }
               // Assign the local copy of the graph options to the
               // global copy.

               lgraph->gOptions = goLocalCopy ;

//               SizeGraphComponents (hWndGraph) ;
//               WindowInvalidate (hWndGraph) ;
               dwCurrentDlgID = 0 ;
               EndDialog (hDlg, 1) ;
               return (TRUE) ;
               break ;


            case IDCANCEL:
               dwCurrentDlgID = 0 ;
               EndDialog(hDlg,0);
               return(TRUE);

            case ID_HELP:
               CallWinHelp (dwCurrentDlgID) ;
               break ;

            default:
               break;
            }
         break;

      default:
         break;

      }
   return(FALSE);
   }
コード例 #15
0
ファイル: sscspec.c プロジェクト: fbtestrepo/hw
extern void CreateAddSpecialDialog (
  GrouP prnt,
  SscTablesPtr stp
)

{
  Char         buf [64];
  GrouP        g, h, m, p;
  MiscRatePtr  mrp;
  SscSpecPtr   ssp;
  Char         str [16];

  if (stp == NULL) return;
  mrp = stp->miscrate_table;
  if (mrp == NULL) return;

  ssp = (SscSpecPtr) MemNew (sizeof (SscSpec));
  if (ssp == NULL) return;

  p = HiddenGroup (prnt, -1, 0, NULL);
  SetGroupSpacing (p, 10, 10);

  SetObjectExtra (p, ssp, StdCleanupExtraProc);

  ssp->dialog = (DialoG) p;

  ssp->tables = stp;

  ssp->whichspec = HiddenGroup (p, 5, 0, ChangeSpecType);
  SetObjectExtra (ssp->whichspec, ssp, NULL);

  RadioButton (ssp->whichspec, "Visiting");
  RadioButton (ssp->whichspec, "Affiliated");
  RadioButton (ssp->whichspec, "Transient");

  ssp->namegroup = HiddenGroup (p, 15, 0, NULL);
  SetGroupSpacing (ssp->namegroup, 5, 3);

  StaticPrompt (ssp->namegroup, "Name", 0, dialogTextHeight, programFont, 'l');
  ssp->name = DialogText (ssp->namegroup,
                          "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
                          0, ChangeSpecName);
  SetObjectExtra (ssp->name, (Pointer) ssp, NULL);
  SetTitle (ssp->name, "");

  Hide (ssp->namegroup);

  h = HiddenGroup (p, 0, 0, NULL);
  SetGroupMargins (h, 10, 10);

  g = HiddenGroup (h, -1, 0, NULL);

  Hide (g);
  ssp->controls [EMPTY_PAGE] = g;

  g = HiddenGroup (h, -1, 0, NULL);

  if (PrintWholeDollar (mrp->visiting_fee, str)) {
    sprintf (buf, "Charge $%s Visiting Fee", str);
  } else {
    sprintf (buf, "Charge Visiting Fee");
  }
  ssp->visitfee = CheckBox (g, buf, NULL);
  SetStatus (ssp->visitfee, TRUE);

  Hide (g);
  ssp->controls [ADD_VISIT_PAGE] = g;

  g = HiddenGroup (h, -1, 0, NULL);

  if (PrintWholeDollar (mrp->affiliated_fee, str)) {
    sprintf (buf, "Charge $%s Affiliated Fee", str);
  } else {
    sprintf (buf, "Charge Affiliated Fee");
  }
  ssp->affilfee = CheckBox (g, buf, NULL);
  SetStatus (ssp->visitfee, TRUE);

  Hide (g);
  ssp->controls [ADD_AFFIL_PAGE] = g;

  g = HiddenGroup (h, -1, 0, NULL);
  SetGroupSpacing (g, 10, 10);

  m = HiddenGroup (g, 1, 0, NULL);
  SetGroupSpacing (m, 5, 3);

  ProrateDollarAmount (mrp->transient_fee, 1, FALSE, stp, &(ssp->proratedtrans));

  if (PrintWholeDollar (&(ssp->proratedtrans), str)) {
    sprintf (buf, "Charge $%s Transient Dues", str);
  } else {
    sprintf (buf, "Charge Transient Dues");
  }
  ssp->transfee = CheckBox (m, buf, NULL);
  SetStatus (ssp->transfee, TRUE);

  ProrateDollarAmount (mrp->ssa_regular, 5, TRUE, stp, &(ssp->proratedssa));

  if (PrintWholeDollar (&(ssp->proratedssa), str)) {
    sprintf (buf, "Charge $%s SSA Dues (Prorated May-Apr)", str);
  } else {
    sprintf (buf, "Charge SSA Dues");
  }
  ssp->transssa = CheckBox (m, buf, NULL);
  SetStatus (ssp->transssa, TRUE);

  ssp->jobs = CreateClubJobsDialog (g);

  AlignObjects (ALIGN_CENTER,
                (HANDLE) m,
                (HANDLE) ssp->jobs,
                NULL);

  Hide (g);
  ssp->controls [ADD_TRANS_FEE] = g;

  ssp->addspec = PushButton (p, "Add Special Member", AddSpecMember);
  SetObjectExtra (ssp->addspec, (Pointer) ssp, NULL);
  Disable (ssp->addspec);

  ssp->currPage = 0;

  AlignObjects (ALIGN_CENTER,
                (HANDLE) ssp->whichspec,
                (HANDLE) ssp->namegroup,
                (HANDLE) ssp->controls [EMPTY_PAGE],
                (HANDLE) ssp->controls [ADD_VISIT_PAGE],
                (HANDLE) ssp->controls [ADD_AFFIL_PAGE],
                (HANDLE) ssp->controls [ADD_TRANS_FEE],
                (HANDLE) ssp->addspec,
                NULL);
}
コード例 #16
0
ファイル: interface.c プロジェクト: hsptools/hsp-wrap
/*-------------- main starts here --------------------------*/
extern Int2 Main (void)
{

RecT r1, r2;

#ifdef WIN_MAC
    m = AppleMenu (NULL);
    DeskAccGroup(m);
    m = PulldownMenu(NULL,  "File");
  
    s = SubMenu(m, "Open");
    i = CommandItem(m, "Quit/Q", QuitProc);
#endif

    InitProc(GetArgc(), GetArgv());

    w = RoundWindow(-50, -33,  -10,  -10,  "PDBeast: Taxonomy Assignment",  NULL);

#ifndef WIN_MAC

    SetUpDrawingTools();
/*  Red();
    SetColor(5);  */
    InvertColors();

    wpdb = RoundWindow(-53, -33, -10,  -10, "PDB File Display", NULL);
    p = StaticPrompt(wpdb, "Pdb File", 0, dialogTextHeight,  systemFont,  '1');
    Advance(wpdb);
    PdbOpen = DefaultButton(wpdb, "Open", PdbOpenProc);
    Break(wpdb);

    p = StaticPrompt(wpdb, "Blast Search", 0, dialogTextHeight,  systemFont,  '1');
    Advance(wpdb);
    lBlastChain = SingleList(wpdb, 10, 3, ListBlastChainProc);
    Advance(wpdb);
    BlastSearchAccept = DefaultButton(wpdb, "Send Query", BlastSearchAcceptProc);
    Break(wpdb);
 
    p = StaticPrompt(wpdb, "String Search", 0, dialogTextHeight,  systemFont,  '1');
    Advance(wpdb);
    Pdbfile_string = DialogText(wpdb, "", 15, NULL);
    Advance(wpdb);
    Pdbfile_string_accept = DefaultButton(wpdb, "Find", PdbfileStringAcceptProc);
    Break(wpdb);

    pdbfile_panel = DocumentPanel(wpdb, 650, 20*stdLineHeight);
    Break(wpdb);
    p = StaticPrompt(wpdb,"                ", 0, dialogTextHeight,  systemFont,  '1');
    Advance(wpdb);
    PdbClose = PushButton(wpdb,"Close", PdbCloseProc);
    Break(wpdb);

    m = PulldownMenu(w, "File");
    s1 = SubMenu(m, "Open");
    i = CommandItem(s1, "Entry", EntryProc);
    s2 = SubMenu(s1, "List");
    c = ChoiceGroup(s2, ListOpenProc); 
    ChoiceItem(c, myargs[6].strvalue);
   
/*  s3 = SubMenu(m, "Update");
    c = ChoiceGroup(s3, ListUpdateProc);
    ChoiceItem(c, myargs[6].strvalue);    */
    
    i = CommandItem(m,  "Quit/Q",  QuitProc);

/*  edit = PulldownMenu(w, "Edit");
    i = CommandItem(edit, "cut", StdCutTextProc);
    i = CommandItem(edit, "copy", StdCopyTextProc);
    i = CommandItem(edit, "paste", StdPasteTextProc);   */
#endif

    infilemode = NormalGroup(w, 3, 0, "Data Mode of Input Entry",systemFont, InFileTypeProc);
    RadioButton(infilemode, "Text"); 
    RadioButton(infilemode, "Binary"); 
/*  SafeSetValue(infilemode, 2);  */
    GetPosition(infilemode, &r1);

    outfilemode = NormalGroup(w, 3, 0, "Data Mode of Output Entry",systemFont, OutFileTypeProc);
    RadioButton(outfilemode, "Text"); 
    RadioButton(outfilemode, "Binary"); 
/*  SafeSetValue(outfilemode, 2);  */
    r2.top = r1.top; r2.bottom = r1.bottom; 
    r2.left = r1.right + 80;
    r2. right = r2.left + r1.right - r1.left;
    SetPosition(outfilemode, &r2);      
    Break(w);

    p = StaticPrompt(w, "Seq-entry", 0, dialogTextHeight,  systemFont,  '1');
    Advance (w);
    l = SingleList(w, 20, 3, ListProc);
    Disable(l);
    Advance(w);
    ListEntry_start = DefaultButton(w, "Start", ListEntryStartProc);
    Disable(ListEntry_start);
    Advance(w);
    ListEntry_next = DefaultButton(w, "Next", ListEntryNextProc);
    Disable(ListEntry_next);
    Advance(w);
    ListEntry_specific = DefaultButton(w, "Specific", ListEntrySpecificProc);
    Disable(ListEntry_specific);
    Break(w);
 
    p = StaticPrompt(w, "Enter Entry Code", 0, dialogTextHeight,  systemFont,  '1');
    Advance (w);
    Entry_code = DialogText(w, "", 15, (TxtActnProc) EnableProc);
    Select(Entry_code);
    Advance (w);
    Entry_accept = DefaultButton(w, "Open", EntryOpenProc);    
    Disable(Entry_accept);
    Break(w);

    p = StaticPrompt(w, "Chain", 0, dialogTextHeight,  systemFont,  '1');
    chain_panel = DocumentPanel(w, 200, stdLineHeight);
    Break(w);
    p = StaticPrompt(w, "Pdb Source:", 0, dialogTextHeight,  systemFont,  '1');
    pdb_source = ScrollText(w, 38, 3, systemFont, TRUE, NULL);
    Advance(w);
    Break(w);
    p = StaticPrompt(w, "Taxonomy Data:", 0, dialogTextHeight,  systemFont,  '1');
    org = DocumentPanel(w,400,6*stdLineHeight);
    Break(w);
    
    p = StaticPrompt(w, "Taxonomy Accept?", 0, dialogTextHeight,  systemFont,  '1');
    Break(w);
    Tax_accept = DefaultButton(w, "Yes", TaxAcceptProc);
    Advance(w);
    p = StaticPrompt(w, "to    ", 0, dialogTextHeight,  systemFont,  '1');
    Advance(w);
    Tax_all_accept = DefaultButton(w, "All", TaxAllAcceptProc);
    Disable(Tax_all_accept);
    Advance(w);
    p = StaticPrompt(w, "         or          ", 0, dialogTextHeight,  systemFont,  '1');
    Advance(w);      
    Tax_part_accept = DefaultButton(w, "Chain", TaxPartAcceptProc);
    Disable(Tax_part_accept);
    Advance(w);
    lchain = SingleList(w, 2, 4, TaxPartAssignProc);
    Advance(w);
    Tax_finish = DefaultButton(w, "All Done", TaxFinishProc);
    Disable(Tax_finish);
    Break(w); 
    Tax_reject = DefaultButton(w, "No", ReLookupProc);
    Disable(Tax_accept);
    Disable(Tax_reject);
    Break(w);

    p = StaticPrompt(w, "Look up Taxonomy Database with another String?", 0, dialogTextHeight,  systemFont,  '1');
    Advance(w);
    ReLookup_accept = DefaultButton(w, "Yes", AddStringProc);
    Advance(w);
    ReLookup_reject = DefaultButton(w, "No", ReLookupRejectProc);
    Disable(ReLookup_accept);
    Disable(ReLookup_reject);
    Break(w);

    p = StaticPrompt(w,"Search Taxonomy Database with", 0, dialogTextHeight,  systemFont,  '1');
    Advance(w);
    Source_string = DialogText(w, "", 15, NULL);
    Advance(w);
    Source_string_accept = DefaultButton(w, "Start", SourceStringAcceptProc);
    Disable(Source_string_accept);
    Break(w);

    Show(w);
    Show(wpdb);
    ProcessEvents();

    return 0;
}
コード例 #17
0
ファイル: system.c プロジェクト: shuowen/OpenNT
PPERFSYSTEM
GetComputer (
    HDLG hDlg,
    WORD wControlID,
    BOOL bWarn,
    PPERFDATA *ppPerfData,
    PPERFSYSTEM *ppSystemFirst
)
/*
   Effect:        Attempt to set the current computer to the one in the
                  hWndComputers dialog edit box. If this computer system
                  can be found, load the objects, etc. for the computer
                  and set pSystem and ppPerfdata to the values for this
                  system.
*/
{   // GetComputer
    TCHAR          szComputer [MAX_SYSTEM_NAME_LENGTH + 1] ;
    PPERFSYSTEM    pSystem;
    TCHAR          tempBuffer [LongTextLen] ;
    DWORD          dwBufferSize = 0;
    LPTSTR         pBuffer = NULL ;
    DWORD          dwLastError;

    DialogText (hDlg, wControlID, szComputer) ;

    // If necessary, add the system to the lists for this view.
    pSystem = SystemGet (*ppSystemFirst, szComputer) ;
    if (!pSystem) {
        pSystem = SystemAdd (ppSystemFirst, szComputer, hDlg) ;
    }

    if (!pSystem && bWarn) {
        dwLastError = GetLastError();

        EditSetModified (GetDlgItem(hDlg, wControlID), FALSE) ;

        // unable to get specified computer so set to:
        //  the first computer in the system list if present
        //      -- or --
        //  set he local machine if not.

        pSystem = *ppSystemFirst;   // set to first in list

        if (pSystem == NULL) {
            // this would mean the user can't access the local
            // system since normally that would be the first one
            // so the machine name will be restored to the
            // local machine (for lack of a better one) but the
            // system won't be added unless they want to explicitly

            DialogSetString (hDlg, wControlID, LocalComputerName) ;
        } else {
            // set to name in system structure
            DialogSetString (hDlg, wControlID, pSystem->sysName);
        }

        if (dwLastError != ERROR_ACCESS_DENIED) {
            DlgErrorBox (hDlg, ERR_COMPUTERNOTFOUND) ;
        } else {
            // the appropriate error message has already been displayed
        }

        SetFocus (DialogControl(hDlg, wControlID)) ;
    }

    if (pSystem) {
        if (PlayingBackLog ()) {
            *ppPerfData =
                LogDataFromPosition (pSystem, &(PlaybackLog.StartIndexPos)) ;
        } else {
            if (pSystem->lpszValue) {
                // save the previous lpszValue string before
                // SetSystemValueNameToGlobal screw it up
                dwBufferSize = MemorySize (pSystem->lpszValue) ;
                if (dwBufferSize <= sizeof(tempBuffer)) {
                    pBuffer = tempBuffer ;
                } else {
                    pBuffer = MemoryAllocate (dwBufferSize) ;
                }
                memcpy (pBuffer, pSystem->lpszValue, dwBufferSize) ;
            }

            SetSystemValueNameToGlobal (pSystem);
            UpdateSystemData (pSystem, ppPerfData) ;

            if (pSystem->lpszValue) {
                // retore the previous lpszValue string
                memcpy (pSystem->lpszValue, pBuffer, dwBufferSize) ;
                if (pBuffer != tempBuffer) {
                    MemoryFree (pBuffer) ;
                }
            }
        }
    }
    return (pSystem) ;

}  // GetComputer