Exemple #1
0
Int2 Main (void)
{
  WindoW  w;
  GrouP   g;
  ButtoN  b1, b2, b3, b4, b5;
  XOSPtr  xosp;

  ProcessUpdatesFirst (FALSE);

  xosp = SetUp ();

  w = FixedWindow (-50, -33, -10, -10,
                   "Consign", CloseConsignParentProc);
  g = HiddenGroup (w, 7, 0, NULL);
  b1 = PushButton (g, "  Input GI ", ReadGIProc);
  b2 = PushButton (g, "Input FastA", ReadFileProc);
  b3 = PushButton (g, " Parameters", ConsignParamProc);
  b4 = PushButton (g, "  Consign  ", ConsignProc);
  b5 = PushButton (g, "   Finish  ", EndProg);

  SetObjectExtra (w,  xosp, NULL);
  SetObjectExtra (b1, xosp, NULL);
  SetObjectExtra (b2, xosp, NULL);
  SetObjectExtra (b3, xosp, NULL);
  SetObjectExtra (b4, xosp, NULL);
  SetObjectExtra (b5, xosp, NULL);

  Show (w);
  ProcessEvents ();
  return 0;
}
Exemple #2
0
/**************************************************************************
* Nlm_MuskStyleManager()
*   call manager
**************************************************************************/
void LIBCALL Nlm_MuskStyleManager (
  void
){
  GrouP tg,bg,lg,rg;

  if ( managerStatus & SM_DLG_UP ) {
    Hide(window);
    Show(window);
    return;
  }
  managerStatus = SM_DLG_UP;
  window = FixedWindow (-50, -33, -10, -10, "Style manager", NULL);
  tg = HiddenGroup (window, 2, 1, NULL); 
  lg = HiddenGroup (tg, 1, 2, NULL); 
  StaticPrompt (lg, "Styles:", 0, 0, systemFont, 'l');
  namesList = SingleList (lg, 15, 8, OnSelectName);
  rg = HiddenGroup (tg, 1, 6, NULL); 
  PushButton (rg, "Close", OnCloseButton );
  StaticPrompt (rg, "", 0, 0, systemFont, 'l');
  PushButton (rg, "Set", OnSetCurrentButton);
  PushButton (rg, "Copy...", OnNewButton);
  modifyButton = PushButton (rg, "Modify...", OnModifyButton);
  deleteButton = PushButton (rg, "Delete", OnDeleteButton);
  bg = HiddenGroup (tg, 1, 1, NULL); 
  currentPrompt = StaticPrompt (bg, MakePromptVal(), 0, 0, systemFont, 'l');
  ReloadNames();
  RealizeWindow (window);
  Show (window);
  Select (window);
  Nlm_WaitForCondition ( managerStatus & SM_DLG_UP);
  Nlm_ProcessAnEvent ();
  Hide (window);  
  Remove (window);
} /* End of Nlm_MuskStyleManager() */
Exemple #3
0
static void push(int item,int inout)
{
   switch(item)
   {
   case -1:
      break;
   case 5:
      RasterOp(zREPz);
      if (samecharges)
         InvertInsides(&tools[(item-5)/3].t->TB);
      else
         PushButton(&chargeR,inout);
      break;
   case 8:
   case 11:
   case 14:
   case 17:
   case 20:
      RasterOp(zREPz);
      InvertInsides(&tools[(item-5)/3].t->TB);
      break;
   case 25:
   case 26:
      RasterOp(zREPz);
      PushOrDoublePress(mainR[item],inout,item-25 == stopped);
      break;
   default:
      RasterOp(zREPz);
      PushButton(mainR[item],inout);
      break;
   }
   if (item == 4)
      ExtraHilite(mainR[item],inout);
}
Exemple #4
0
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;
}
Exemple #5
0
static void ConsortParamProc (ButtoN b)
{
  WindoW           w;
  GrouP            h, h1, g, g1;
  ButtoN           b1, b2, b3;
  XOSPtr           xosp;

  SeqScrollDataPtr ssdp = NULL;

  if ((xosp = (XOSPtr) GetObjectExtra (b)) == NULL)
    return;
  if (xosp->flagParamWindow)
    return;

  w = FixedWindow (-75, -10, -10, -10,
                   "Consort Parameters", CloseParamWindowProc);
  h = HiddenGroup (w, 1, 0, NULL);
  h1 = HiddenGroup (h, 2, 0, NULL);

  g1 = HiddenGroup (h1, 1, 0, NULL);
  g = HiddenGroup (g1, 1, 0, NULL);
  StaticPrompt (g, "xdelta", StringWidth ("1234567890"), dialogTextHeight,
                NULL, 'c');
  g = HiddenGroup (g1, 2, 0, NULL);
  AddScrollControl (&ssdp, g, (Int2) xosp->xdeltaval,
                    (Int2) xosp->xdeltamin, (Int2) xosp->xdeltamax, 24);

  g1 = HiddenGroup (h1, 1, 0, NULL);
  g = HiddenGroup (g1, 1, 0, NULL);
  StaticPrompt (g, "ydelta", StringWidth ("1234567890"), dialogTextHeight,
                NULL, 'c');
  g = HiddenGroup (g1, 2, 0, NULL);
  AddScrollControl (&ssdp, g, (Int2) xosp->ydeltaval,
                    (Int2) xosp->ydeltamin, (Int2) xosp->ydeltamax, 24);

  SetObjectExtra (w, ssdp, NULL);

  h1 = HiddenGroup (h, 1, 0, NULL);
  StaticPrompt (h1, "tree style", 0, dialogTextHeight, NULL, 'l');
  g = HiddenGroup (h1, 1, 0, NULL);
  RadioButton (g, "LR");
  RadioButton (g, "TB");
  SetValue (g, 1);
  xosp->gstyle = g;

  h1 = HiddenGroup (h, 3, 0, NULL);
  b1 = PushButton (h1, "Accept", AcceptParamProc);
  SetObjectExtra (b1, xosp, NULL);
  b2 = PushButton (h1, "Apply ", UpdateParamProc);
  SetObjectExtra (b2, xosp, NULL);
  b3 = PushButton (h1, "Cancel", CancelParamProc);
  SetObjectExtra (b3, xosp, NULL);

  Show (w);
  Select (w);
  xosp->flagParamWindow = TRUE;
  return;
}
void RDCdPlayer::play(int track)
{
  if((cdrom_state!=RDCdPlayer::Paused)||(cdrom_track!=track)) {
    PushButton(RDCdPlayer::Play,track);
  }
  else {
    PushButton(RDCdPlayer::Resume);
  }
}
Exemple #7
0
NLM_EXTERN void LaunchCommentRulesEditor (IteM i)
{
  BaseFormPtr         bfp;
  WindoW              w;
  DialoG              d;
  CommentSetDlgPtr    dlg;
  GrouP               h, c;
  MenU                m;
  ButtoN              b;

#ifdef WIN_MAC
  bfp = currentFormDataPtr;
#else
  bfp = GetObjectExtra (i);
#endif
  if (bfp == NULL) return;

  dlg = (CommentSetDlgPtr) MemNew (sizeof (CommentSetDlgData));
  if (dlg == NULL) return;
    
  w = FixedWindow (-50, -33, -10, -10, "Comment Rules Editor", StdCloseWindowProc);

#if 0
  m = PulldownMenu (w, "File");
  FormCommandItem (m, "Open", (BaseFormPtr)f, VIB_MSG_OPEN);
  FormCommandItem (m, "Import", (BaseFormPtr)f, VIB_MSG_IMPORT);
  FormCommandItem (m, "Save", (BaseFormPtr)f, VIB_MSG_SAVE);
  FormCommandItem (m, "Save As", (BaseFormPtr)f, VIB_MSG_SAVE_AS);
  SeparatorItem (m);
  FormCommandItem (m, "Quit", (BaseFormPtr)f, VIB_MSG_QUIT);
  m = PulldownMenu (w, "Edit");
  FormCommandItem (m, "Copy All to Clipboard", (BaseFormPtr) f, VIB_MSG_COPY);
#endif
  h = HiddenGroup (w, -1, 0, NULL);
  SetGroupSpacing (h, 10, 10);

  d = CommentSetDialog (h);
  dlg = GetObjectExtra (d);

  PointerToDialog (d, LoadCommentRuleSet());

  c = HiddenGroup (h, 3, 0, NULL);
  b = PushButton (c, "Accept", SaveRuleChanges);
  SetObjectExtra (b, d, NULL);
  PushButton (c, "Cancel", StdCancelButtonProc);

  AlignObjects (ALIGN_CENTER, (HANDLE) d, (HANDLE) c, NULL);
  Show (w);
}
Exemple #8
0
static void DustParamProc (ButtoN b)
{
  WindoW           w;
  GrouP            h, g;
  ButtoN           b1, b2, b3;
  XOSPtr           xosp;

  SeqScrollDataPtr ssdp_dust = NULL;

  if ((xosp = (XOSPtr) GetObjectExtra (b)) == NULL)
    return;
  if (xosp->flagParamWindow)
    return;

  w = FixedWindow (-50, -10, -10, -10,
                   "Dust Parameters", CloseParamWindowProc);

  h = HiddenGroup (w, 4, 0, NULL);
  StaticPrompt (h, "window", StringWidth ("window"), dialogTextHeight,
                NULL, 'c');
  StaticPrompt (h, "cutoff", StringWidth ("cutoff"), dialogTextHeight,
                NULL, 'c');
  StaticPrompt (h, "minwin", StringWidth ("minwin"), dialogTextHeight,
                NULL, 'c');
  StaticPrompt (h, "linker", StringWidth ("linker"), dialogTextHeight,
                NULL, 'c');
  g = HiddenGroup (h, 2, 0, NULL);
  AddScrollControl (&ssdp_dust, g, 64, 8, 256, 24);
  g = HiddenGroup (h, 2, 0, NULL);
  AddScrollControl (&ssdp_dust, g, 20, 2, 64, 24);
  g = HiddenGroup (h, 2, 0, NULL);
  AddScrollControl (&ssdp_dust, g, 4, 4, 128, 24);
  g = HiddenGroup (h, 2, 0, NULL);
  AddScrollControl (&ssdp_dust, g, 1, 1, 32, 24);
  SetObjectExtra (w, ssdp_dust, NULL);

  b1 = PushButton (h, "Accept", AcceptParamProc);
  SetObjectExtra (b1, xosp, NULL);
  b2 = PushButton (h, "Apply ", UpdateParamProc);
  SetObjectExtra (b2, xosp, NULL);
  b3 = PushButton (h, "Cancel", CancelParamProc);
  SetObjectExtra (b3, xosp, NULL);

  Show (w);
  Select (w);
  xosp->flagParamWindow = TRUE;

  return;
}
Exemple #9
0
static void ConsignParamProc (ButtoN b)
{
  WindoW           w;
  GrouP            h, h1, g, g1;
  ButtoN           b1, b2, b3;
  XOSPtr           xosp;

  SeqScrollDataPtr ssdp = NULL;

  if ((xosp = (XOSPtr) GetObjectExtra (b)) == NULL)
    return;
  if (xosp->flagParamWindow)
    return;

  w = FixedWindow (-75, -10, -10, -10,
                   "Consign Parameters", CloseParamWindowProc);
  h = HiddenGroup (w, 1, 0, NULL);
  h1 = HiddenGroup (h, 2, 0, NULL);

  g1 = HiddenGroup (h1, 1, 0, NULL);
  g = HiddenGroup (g1, 1, 0, NULL);
  StaticPrompt (g, "CU cut", StringWidth ("12345678"), dialogTextHeight,
                NULL, 'c');
  g = HiddenGroup (g1, 2, 0, NULL);
  AddScrollControl (&ssdp, g, (Int2) xosp->cutoff,
                    (Int2) xosp->cutoffmin, (Int2) xosp->cutoffmax, 24);

  g1 = HiddenGroup (h1, 1, 0, NULL);
  g = HiddenGroup (g1, 1, 0, NULL);
  StaticPrompt (g, "CU win", StringWidth ("12345678"), dialogTextHeight,
                NULL, 'c');
  g = HiddenGroup (g1, 2, 0, NULL);
  AddScrollControl (&ssdp, g, (Int2) xosp->window,
                    (Int2) xosp->windowmin, (Int2) xosp->windowmax, 24);
  SetObjectExtra (w, ssdp, NULL);

  h1 = HiddenGroup (h, 3, 0, NULL);
  b1 = PushButton (h1, "Accept", AcceptParamProc);
  SetObjectExtra (b1, xosp, NULL);
  b2 = PushButton (h1, "Apply ", UpdateParamProc);
  SetObjectExtra (b2, xosp, NULL);
  b3 = PushButton (h1, "Cancel", CancelParamProc);
  SetObjectExtra (b3, xosp, NULL);

  Show (w);
  Select (w);
  xosp->flagParamWindow = TRUE;
  return;
}
Exemple #10
0
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;
}
Exemple #11
0
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;
}
Exemple #12
0
static void push(int n, int inout)
{
	switch (n)
	{
		case -1:
		break;
	case 0:
	case 1:
	case 2:
		PushOrDoublePress(bR[n], inout, our_flocktype == n);
		break;
	case 3:
	case 4:
		PushOrDoublePress(bR[n], inout, our_tracetype == n - 3);
		break;
	case 6:
		InvertInsides((text_button *) bR[n]);
		break;
	case 15:
		ExtraHilite(bR[n], inout);
		/* deliberate flow through */
	default:
		PushButton(bR[n], inout);
		break;
	}
}
Exemple #13
0
Wt::WWidget *FormWidgets::pushButton()
{
  Wt::WTemplate *result = new TopicTemplate("forms-pushButton");
  result->bindWidget("PushButton", PushButton());
  result->bindWidget("PushButtonOnce", PushButtonOnce());
  result->bindWidget("PushButtonLink", PushButtonLink());
  result->bindWidget("PushButtonDropdownAppended",
                     PushButtonDropdownAppended());
  result->bindWidget("PushButtonColor", PushButtonColor());
  result->bindWidget("PushButtonSize", PushButtonSize());
  result->bindWidget("PushButtonPrimary", PushButtonPrimary());
  result->bindWidget("PushButtonAction", PushButtonAction());

  // Show the XML-templates as text
  result->bindString("appendedDropdownButton-template",
                     reindent(tr("appendedDropdownButton-template")),
                     Wt::PlainText);
  result->bindString("pushButtonColor-template",
                     reindent(tr("pushButtonColor-template")), Wt::PlainText);
  result->bindString("pushButtonSize-template",
                     reindent(tr("pushButtonSize-template")), Wt::PlainText);
  result->bindString("pushButtonAction-template",
                     reindent(tr("pushButtonAction-template")), Wt::PlainText);
  return result;
}
void DrawButton(const ShaderState *data, float2 pos, float2 r, uint bgColor, uint fgColor, float alpha)
{
    if (alpha < epsilon)
        return;
    DMesh::Handle h(theDMesh());
    PushButton(&h.mp.tri, &h.mp.line, pos, r, bgColor, fgColor, alpha);
    h.Draw(*data);
}
Exemple #15
0
static void CcpParamProc (ButtoN b)
{
  WindoW           w;
  GrouP            h, g, h1;
  ButtoN           b1, b2, b3;
  XOSPtr           xosp;

  SeqScrollDataPtr ssdp_ccp = NULL;

  if ((xosp = (XOSPtr) GetObjectExtra (b)) == NULL)
    return;
  if (xosp->flagParamWindow)
    return;

  w = FixedWindow (-50, -10, -10, -10,
                   "Ccp Parameters", CloseParamWindowProc);

  h = HiddenGroup (w, 1, 0, NULL);
  h1 = HiddenGroup (h, 2, 0, NULL);
  StaticPrompt (h1, "window", StringWidth ("window"), dialogTextHeight,
                NULL, 'c');
  StaticPrompt (h1, "linker", StringWidth ("linker"), dialogTextHeight,
                NULL, 'c');
  h1 = HiddenGroup (h, 2, 0, NULL);
  g = HiddenGroup (h1, 2, 0, NULL);
  AddScrollControl (&ssdp_ccp, g, 22, 7, 42, 24);
  g = HiddenGroup (h1, 2, 0, NULL);
  AddScrollControl (&ssdp_ccp, g, 0, 0, 64, 24);
  SetObjectExtra (w, ssdp_ccp, NULL);

  h1 = HiddenGroup (h, 3, 0, NULL);
  b1 = PushButton (h1, "Accept", AcceptParamProc);
  SetObjectExtra (b1, xosp, NULL);
  b2 = PushButton (h1, "Apply ", UpdateParamProc);
  SetObjectExtra (b2, xosp, NULL);
  b3 = PushButton (h1, "Cancel", CancelParamProc);
  SetObjectExtra (b3, xosp, NULL);

  Show (w);
  Select (w);
  xosp->flagParamWindow = TRUE;

  return;
}
Exemple #16
0
static void PreferencesProc (IteM i)

{
  ButtoN          b;
  GrouP           c;
  EntrezPrefsPtr  epp;
  GrouP           g;
  PrefsFormPtr    pfp;
  WindoW          w;

  pfp = (PrefsFormPtr) MemNew (sizeof (PrefsForm));
  if (pfp == NULL) return;
  w = FixedWindow (-50, -33, -10, -10, "Preferences", StdCloseWindowProc);
  SetObjectExtra (w, pfp, StdCleanupFormProc);
  pfp->form = (ForM) w;
  pfp->formmessage = DefaultMessageProc;
  g = HiddenGroup (w, -1, 0, NULL);
  SetGroupSpacing (g, 10, 10);
  pfp->prefs = CreateEntrezPrefsDialog (g, NULL);
  c = HiddenGroup (g, 2, 0, NULL);
  b = PushButton (c, "Accept", AcceptPrefsProc);
  SetObjectExtra (b, pfp, NULL);
  PushButton (c, "Cancel", StdCancelButtonProc);
  AlignObjects (ALIGN_CENTER, (HANDLE) pfp->prefs, (HANDLE) c, NULL);
  RealizeWindow (w);
  epp = EntrezPrefsNew ();
  if (epp != NULL) {
    epp->persistDefault = entrezglobals.persistDefault;
    epp->alignDefault = entrezglobals.alignDefault;
    epp->lookupDirect = entrezglobals.lookupDirect;
    epp->showAsn = entrezglobals.showAsn;
    epp->initDatabase = StringSaveNoNull (entrezglobals.initDatabase);
    epp->initField = StringSaveNoNull (entrezglobals.initField);
    epp->initMode = StringSaveNoNull (entrezglobals.initMode);
    epp->initMedLabel = StringSaveNoNull (medviewprocs.initMedLabel);
    epp->initNucLabel = StringSaveNoNull (seqviewprocs.initNucLabel);
    epp->initProtLabel = StringSaveNoNull (seqviewprocs.initProtLabel);
    epp->initGenomeLabel = StringSaveNoNull (seqviewprocs.initGenomeLabel);
  }
  PointerToDialog (pfp->prefs, (Pointer) epp);
  EntrezPrefsFree (epp);
  Show (w);
  Select (w);
}
Exemple #17
0
//
// Handle left button down events
//
void Grabber::OnLeftDown(wxMouseEvent & event)
{
   // Button should be drawn pushed
   PushButton(true);

   // Notify parent
   SendEvent(EVT_GRABBER_CLICKED, event.GetPosition(), false);

   event.Skip();
}
Exemple #18
0
static void DOT_StartupWindow(void)
{

  WindoW  w;
  GrouP   c, cg;
  DOTStartDataPtr sdata;
  PaneL   p;

  w = FixedWindow (-50, -33, -10, -10, "Welcome to D-Viewer", StdCloseWindowProc);

  p = SimplePanel (w, 28 * stdCharWidth, 4 * stdLineHeight, DOT_DrawAbout);
  sdata=(DOTStartDataPtr)MemNew(sizeof(DOTStartData));
  sdata->hStart=w;
  cg=HiddenGroup(w, 4, 0, NULL);
  sdata->dot=CheckBox(cg, "Dot plot", DOT_CheckDot);
  SetStatus(sdata->dot, TRUE);
  
  sdata->reg_blast=CheckBox(cg, "Bl2Seqs", DOT_CheckRegBlast);
  SetStatus(sdata->reg_blast, FALSE);
  sdata->auto_blast = CheckBox(cg, "Scoop", DOT_CheckAutoBlast);
  SetStatus(sdata->auto_blast, FALSE);

  sdata->seqa=CheckBox(cg, "SeqAnnote File", DOT_CheckSA);
  SetStatus(sdata->seqa, FALSE);
  c = HiddenGroup (w, 1, 3, NULL);
  SetGroupMargins(c, 10, 10);
  SetGroupSpacing (c, 10, 10);
  sdata->entrez=PushButton (c, "Fetch from Entrez", DOT_GetFromNetwork);
  Enable(sdata->entrez);
  sdata->file=PushButton (c, "Open Local Files", DOT_readExisting);
  Enable(sdata->file);
  PushButton (c, "Quit Program", DOT_quitProgram);
    
  SetObjectExtra(w, (Pointer)sdata, StdCleanupExtraProc);
  AlignObjects (ALIGN_CENTER, (HANDLE) p, (HANDLE) c, NULL,  NULL);
  Select(w);
  Show(w);
  ProcessEvents();
}
Exemple #19
0
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);
}
Exemple #20
0
static void AboutProc (IteM i)

{
  GrouP    c;
  CharPtr  info;
  PaneL    p;
  WindoW   w;

  w = ModalWindow (-50, -33, -1, -1, StdCloseWindowProc);
  p = SimplePanel (w, AboutBoxWidth (), 14 * stdLineHeight, DrawAbout);
  SetPanelClick (p, NULL, NULL, NULL, CloseAboutPanelProc);
  c = HiddenGroup (w, 2, 0, NULL);
  SetGroupSpacing (c, 20, 2);
  SetGroupMargins (c, 5, 5);
  PushButton (c, "Done", StdCancelButtonProc);
  info = EntrezDetailedInfo ();
  if (info != NULL) {
    PushButton (c, "More", AboutMoreProc);
  }
  AlignObjects (ALIGN_CENTER, (HANDLE) p, (HANDLE) c, NULL);
  RealizeWindow (w);
  Show (w);
  Select (w);
}
Exemple #21
0
/**************************************************************************
* 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() */
Exemple #22
0
static void AboutMoreProc (ButtoN b)

{
  DoC      d;
  CharPtr  info;
  WindoW   w;

  Remove (ParentWindow (b));
  w = ModalWindow (-50, -33, -1, -1, StdCloseWindowProc);
  d = DocumentPanel (w, 30 * stdCharWidth, 16 * stdLineHeight);
  b = PushButton (w, "Done", StdCancelButtonProc);
  AlignObjects (ALIGN_CENTER, (HANDLE) d, (HANDLE) b, NULL);
  RealizeWindow (w);
  info = EntrezDetailedInfo ();
  if (info == NULL) {
    info = "No detailed information available\n";
  }
  AppendText (d, info, NULL, NULL, programFont);
  Show (w);
  Select (w);
}
Exemple #23
0
void PaintQuitButton(int inout)
{
	rect R = QuitButtonR;
	int cx, cy;

	HideCursor();
   RasterOp(zREPz);
	Centers(&R, &cx, &cy);
	PaintRadioButton(&R, inout, inout, "");
	TextAlign(alignCenter, alignTop);
	PenColor(WHITE);
	BackColor(inout ? RED : DARKGRAY);
	MoveTo(cx, R.Ymin + 4);
	DrawString("Alt-X");
	MoveTo(cx, R.Ymin + FontHeight + 4);
	DrawString("to Exit");
	PushButton(&R, inout);
	ExtraHilite(&R, inout);
	if (inout)
		DoublePress(&R, true, RED);
	ShowCursor();
}
Exemple #24
0
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 ();
}
Exemple #25
0
/*---------------------------------------------------------*/
GrouP LIBCALL DisplayControls(Nlm_GrouP prnt)
{
    GrouP g, h;
    PrompT ppt1, /*ppt2,*/ ppt3, ppt4;

    g = HiddenGroup(prnt, -1, 0, NULL);
    if (!g)
        return NULL;
    SetGroupSpacing(g, 3, 9);
#ifdef WIN_MOTIF
    SetGroupMargins(g, 4, 1);
    SetGroupSpacing(g, 2, 1);
#else
    SetGroupMargins(g, 1, 1);
    SetGroupSpacing(g, 0, 0);
#endif

    StaticPrompt(g, "", 0, stdLineHeight, systemFont, 'l');
    StaticPrompt(g, "", 0, stdLineHeight, systemFont, 'l');

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

    ppt1 =
        StaticPrompt(h, "Molecule", 0, stdLineHeight + 5, systemFont, 'c');
    Cn3D_lStruc = MultiList(h, 6, 10, FillFeatureListProc);
    StaticPrompt(h, "", 0, stdLineHeight, systemFont, 'l');
    StaticPrompt(h, "", 0, stdLineHeight, systemFont, 'l');
    AlignObjects(ALIGN_LEFT, (HANDLE) ppt1, (HANDLE) Cn3D_lStruc, NULL);

    ppt3 =
        StaticPrompt(h, "Domain", 0, stdLineHeight + 5, systemFont, 'c');
    Cn3D_bDisplayAlignedDomain =
        CheckBox(h, "Aligned Domain Only", Cn3D_ListAlignedDomainProc);
    Cn3D_lFeature = MultiList(h, 6, 8, Cn3D_SelectDomainProc);
    StaticPrompt(h, "", 0, stdLineHeight, systemFont, 'l');
    AlignObjects(ALIGN_LEFT, (HANDLE) ppt3, (HANDLE) Cn3D_lFeature, NULL);

    ppt4 =
        StaticPrompt(h, "Residue", 0, stdLineHeight + 5, systemFont, 'c');
    Cn3D_bAlignOn = CheckBox(h, "Aligned", NULL);
    Cn3D_bUnalignOn = CheckBox(h, "Unaligned", NULL);
    Cn3D_bDisplayHighlight =
        CheckBox(h, "Show Selected Only", NULL);
    AlignObjects(ALIGN_LEFT, (HANDLE) ppt4,
                 (HANDLE) Cn3D_bDisplayHighlight, NULL);
    SetStatus(Cn3D_bDisplayHighlight, FALSE);
    SetStatus(Cn3D_bAlignOn, Cn3D_fAlignOn);
    SetStatus(Cn3D_bUnalignOn, Cn3D_fUnalignOn);

    Cn3D_altConfIdOverlay = CheckBox(g, 
        "Overlay uncorrelated conformer ensembles", NULL);
    AlignObjects(ALIGN_CENTER, (HANDLE) Cn3D_altConfIdOverlay, (HANDLE) g, NULL);
    SetStatus(Cn3D_altConfIdOverlay, TRUE);

    StaticPrompt(g, "", 0, stdLineHeight + 5, systemFont, 'c');
    Cn3D_bDisplayApply = PushButton(g, "Apply!", Cn3D_DisplayProc);
    AlignObjects(ALIGN_CENTER, (HANDLE) Cn3D_bDisplayApply, (HANDLE) h,
                 NULL);

    ResetDisplayCtrls();

    return g;
}
Exemple #26
0
static void ConsortProc (ButtoN b)
{
  XOSPtr         xosp;
  XISPtr         xisp;
  TreeNodePtr    ptrNode;

  WindoW      w;
  VieweR      v;
  GrouP       g;
  SegmenT     seg;
  Int4        xmax, xmin;
  Int4        xoffset, yoffset;

  if ((xosp = (XOSPtr) GetObjectExtra (b)) == NULL)
    return;

  if (xosp->sep == NULL)
  {
    ErrPostEx (SEV_ERROR, TOP_ERROR, 101, "No SeqEntry");
    ErrShow ();
    return;
  }

  WatchCursor ();

  xoffset = xosp->xdeltaval;
  yoffset = xosp->ydeltaval;

  ptrNode = ConsortSeqEntry (xosp->sep);
  SetAllLeftRightRootedTreeNeighbors (ptrNode);
  SetAllPivotNodes (ptrNode);
  switch (xosp->treestyle)
  {
   default:
   case 0:
    SetAllTheoreticalCoordinates (ptrNode, 300, 50);
    AdjustAllTheoreticalCoordinates (ptrNode, 300);
    ChangeTreeScale (ptrNode, 300, 50, (FloatHi) xoffset, (FloatHi) yoffset);
    break;
   case 1:
    SetAllCoordinates (ptrNode, 300, 50, xoffset, yoffset);
    break;
  }
  xmin = GetMinimumTreeXcoord (ptrNode);
  if (xmin-50 > 0)
    ShiftTree (ptrNode, (-1*(xmin-50)), 0);
  if (xmin < 0)
    ShiftTree (ptrNode, ((-1*xmin)+50), 0);

  xmin = GetMinimumTreeXcoord (ptrNode);
  xmax = GetMaximumTreeXcoord (ptrNode);
  if (xmin < 0)
    xmin *= -1;
  if (xmax < 0)
    xmax *= -1;
  xisp = (XISPtr) MemNew (sizeof (XIS));
  if (xmax > xmin)
    xisp->Xdelta = (2*(xmax+100)) + 10;
  else
    xisp->Xdelta = (2*(xmin+100)) + 10;
  seg = DrawTree (ptrNode);
  xisp->picture = seg;

  w = FixedWindow (10, 10, 640, 640, "Consort", CloseGraphWindowProc);
  SetObjectExtra (w, xisp, CleanUpGraphWindow);
  g = HiddenGroup (w, -1, 0, NULL);
  v = CreateViewer (g, 560, 560, TRUE, TRUE);
  AttachPicture (v, seg, INT4_MIN, INT4_MAX, UPPER_LEFT, 1, 1, NULL);
  PushButton (g, "Close", CloseGraphWindowButton);
  RealizeWindow (w);
  ArrowCursor ();
  Show (w);

  return;
}
Exemple #27
0
static void ConsignProc (ButtoN b)
{
  XOSPtr         xosp;
  XISPtr         xisp;

  ComPatPtr      cpp, cpph;
  ValNodePtr     orflist;
  SeqLocPtr      slp, slpn;
  Int4           start, stop;
  Uint1          strand;
  SeqPortPtr     spp;
  Uint1Ptr       aaseq;
  Int4           ntpos, aapos;
  Uint1          cdn[3];

  SeqAlignPtr    sap, sapn;

  FloatHi        probcut;
  Int4           clustmin, findmin;

  Int4           i, n, endpos, XLength, XScale, shift;
  Int4           iframe, frame, top, orftop[6];
  FloatHiPtr     score, expandscore;
  FloatHi        maxscore;
  Int4Ptr        tableGlobal;

  SeqGraphPtr  sgp, sgpn;
  WindoW       w;
  VieweR       v;
  GrouP        g;
  SegmenT      seg;
  GraphSentPtr gsp;
  Char         numberbuffer[32];

  if ((xosp = (XOSPtr) GetObjectExtra (b)) == NULL)
    return;

  if (xosp->bsp == NULL)
  {
    ErrPostEx (SEV_ERROR, TOP_ERROR, 101, "No Bioseq");
    ErrShow ();
    return;
  }

  WatchCursor ();
  cpph = cpp = ReadPrositePattern (xosp->pattern_file, TRUE, -1, NULL, NULL);
  if (cpph == NULL)
  {
    ErrPostEx (SEV_ERROR, TOP_ERROR, 101,
               "read failed %s", xosp->pattern_file);
    ErrShow ();
    ArrowCursor ();
    return;
  }

  xosp->orflist =  GetOrfList (xosp->bsp, (Int2) (xosp->orfcut));
  xosp->orflist =  ClearNonMetOrfs (xosp->orflist);
  orflist = xosp->orflist;
  while (orflist != NULL)
  {
    slp = (SeqLocPtr) orflist->data.ptrvalue;
    if (slp->choice == 0)
    {
      orflist = orflist->next;
      continue;
    }
    if (slp->choice == SEQLOC_MIX)
      slp = (SeqLocPtr) slp->data.ptrvalue;
    start = SeqLocStart (slp);
    stop = SeqLocStop (slp);
    strand = SeqLocStrand (slp);
    if (strand != Seq_strand_both)
      strand = Seq_strand_both;
    if (stop - start + 1 >= xosp->minimumseed)
    {
      spp = SeqPortNew (xosp->bsp, start, stop, strand, Seq_code_ncbi4na);
      aaseq = (Uint1Ptr) MemNew ((size_t)
                                 (sizeof (Uint1) * (((stop-start)/3)+2)));
      ntpos = start;
      aapos = 0;
      while (ntpos < start+3)
      {
        cdn[0] = SeqPortGetResidue (spp);
        ntpos++;
        cdn[1] = SeqPortGetResidue (spp);
        ntpos++;
        cdn[2] = SeqPortGetResidue (spp);
        ntpos++;
        aaseq[aapos] = AAForCodon (cdn, xosp->gcdi);
        aapos++;
      }
      while (ntpos <= stop)
      {
        cdn[0] = SeqPortGetResidue (spp);
        ntpos++;
        cdn[1] = SeqPortGetResidue (spp);
        ntpos++;
        cdn[2] = SeqPortGetResidue (spp);
        ntpos++;
        aaseq[aapos] = AAForCodon (cdn, xosp->gcd);
        aapos++;
      }
      SeqPortFree (spp);
      aaseq[aapos] = 0;
      cpp = cpph;
      while (cpp != NULL)
      {
        sap = PatternMatch (aaseq, 0, Seq_strand_plus, SeqLocId (slp),
                            cpp, 0, Seq_strand_unknown, FALSE);
        if (sap != NULL)
          break;
        cpp = cpp->nextpattern;
      }
      MemFree (aaseq);
      if (sap != NULL)
      {
        SeqLocLink (&(xosp->slps), SeqLocDup (slp));
      }
      while (sap != NULL)
      {
        sapn = sap->next;
        SeqAlignFree (sap);
        sap = sapn;
      }
    }
    orflist = orflist->next;
  }
  ComPatFree (cpph);

  orflist = xosp->orflist;
  while (orflist != NULL)
  {
    slp = (SeqLocPtr) orflist->data.ptrvalue;
    if (slp->choice > 0)
      SeqLocLink (&(xosp->slpa), SeqLocDup (slp));
    while (slp != NULL)
    {
      slpn = slp->next;
      SeqLocFree (slp);
      slp = slpn;
    }
    orflist->data.ptrvalue = NULL;
    orflist = orflist->next;
  }
  xosp->orflist = ValNodeFree (xosp->orflist);

  probcut = xosp->probcut;
  clustmin = xosp->clustmin;
  findmin = xosp->findmin;

  xosp->slpb = FindSimilarBiasOrfs (xosp->sep, probcut, clustmin, findmin,
                                    xosp->slps, xosp->slpa);

  tableGlobal = CodonTableFromSeqLoc (xosp->bsp, xosp->slpb);
  seg = NULL;
  top = 0;
  xisp = (XISPtr) MemNew (sizeof (XIS));
  frame = 0;
  for (iframe = 0; iframe < 6; iframe++)
  {
    endpos = (xosp->bsp->length + 3 - frame - xosp->window) / 3;
    if (iframe < 3)
      score = BiasScoreBioseq (xosp->bsp, tableGlobal, xosp->window,
                               frame, Seq_strand_plus);
    else
      score = BiasScoreBioseq (xosp->bsp, tableGlobal, xosp->window,
                               frame, Seq_strand_minus);
    maxscore = 0.0;
    for (i = 0; i < endpos; i++)
      if (score[i] > maxscore)
        maxscore = score[i];
    expandscore = (FloatHiPtr) MemNew (sizeof (FloatHi) * xosp->bsp->length);
    for (i = 0; i < xosp->window/2; i++)
      expandscore[i] = maxscore;
    n = 0;
    while (i < xosp->bsp->length)
    {
      if (n < endpos)
        expandscore[i] = score[n];
      else
        expandscore[i] = maxscore;
      i++;
      if (i%3 == 0)
        n++;
    }
    MemFree (score);
    score = expandscore;
    sgp = SeqGraphNew ();
    if (xisp->sgp == NULL)
    {
      xisp->sgp = sgp;
    }
    else
    {
      sgpn = xisp->sgp;
      while (sgpn->next != NULL)
        sgpn = sgpn->next;
      sgpn->next = sgp;
    }
    XLength = xosp->bsp->length;
    if (XLength > 1200)
      XLength = 1200;
    XScale = xosp->bsp->length / XLength;
    if (xosp->bsp->length % XLength != 0)
      XScale++;
    sgp->loc = SeqLocIntNew (0, xosp->bsp->length-1, xosp->bsp->strand,
                             xosp->bsp->id);
    sgp->flags[2] = 1;
    sgp->numval = xosp->bsp->length;
    sgp->values = (Pointer) score;
    sgp->max.realvalue = maxscore;
    sgp->min.realvalue = 0.0;
    sgp->flags[1] = 1;
    sgp->a = 4.0;
    sgp->b = 0.0;
    if (seg == NULL)
      seg = CreatePicture ();
    if ((gsp = AddGraphSentinelToPicture (sgp, xosp->bsp, seg, 0,
                                          top, 0, NULL)) != NULL)
    {
      sprintf (numberbuffer, "%ld", 1L);
      AddLabel (seg, gsp->box.left, gsp->bottom-20,
                numberbuffer, SMALL_TEXT, 0, MIDDLE_CENTER, 0);
      sprintf (numberbuffer, "%ld", (long) xosp->bsp->length);
      AddLabel (seg, gsp->box.left+xosp->bsp->length, gsp->bottom-20,
                numberbuffer, SMALL_TEXT, 0, MIDDLE_CENTER, 0);
    }
    shift = (Int4) (maxscore*sgp->a);
    orftop[iframe] = top - shift - 38;
    top -= (shift+56);
    frame++;
    if (frame == 3)
    {
      top -= 24;
      frame = 0;
    }
  }
  frame = 0;
  for (iframe = 0; iframe < 6; iframe++)
  {
    if (iframe < 3)
      strand = Seq_strand_plus;
    else
      strand = Seq_strand_minus;
    shift = 0;
    if (xosp->slpa != NULL)
    {
      AddOrfClass (xosp->slpa, seg, orftop, iframe, frame,
                   shift, strand, YELLOW_COLOR, 5);
      shift += 4;
    }
    if (xosp->slpk != NULL)
    {
      AddOrfClass (xosp->slpk, seg, orftop, iframe, frame,
                   shift, strand, GREEN_COLOR, 5);
      shift += 4;
    }
    if (xosp->slpb != NULL)
    {
      AddOrfClass (xosp->slpb, seg, orftop, iframe, frame,
                   shift, strand, BLUE_COLOR, 5);
      shift += 4;
    }
    if (xosp->slps != NULL)
    {
      AddOrfClass (xosp->slps, seg, orftop, iframe, frame,
                   shift, strand, RED_COLOR, 5);
    }
    frame++;
    if (frame == 3)
      frame = 0;
  }
  MemFree (tableGlobal);

  start = 20;
  stop = 20 + (50*XScale);
  top = orftop[5] - 40;
  if (xosp->slpa != NULL)
  {
    top -= 12;
    AddAttribute (seg, (COLOR_ATT|STYLE_ATT|SHADING_ATT|WIDTH_ATT),
                  YELLOW_COLOR, SOLID_LINE, SOLID_SHADING, 5,
                  0);
    AddLine (seg, start, top, stop, top, FALSE, 0);
    AddAttribute (seg, (COLOR_ATT|STYLE_ATT|SHADING_ATT|WIDTH_ATT),
                  BLACK_COLOR, SOLID_LINE, SOLID_SHADING, STD_PEN_WIDTH,
                  0);
    AddLabel (seg, stop+(20*XScale), top,
              "All Met-init'd ORFs equal to or greater than 50 codons",
              SMALL_TEXT, 0, MIDDLE_RIGHT, 0);
  }
  if (xosp->slpk != NULL)
  {
    top -= 12;
    AddAttribute (seg, (COLOR_ATT|STYLE_ATT|SHADING_ATT|WIDTH_ATT),
                  GREEN_COLOR, SOLID_LINE, SOLID_SHADING, 5,
                  0);
    AddLine (seg, start, top, stop, top, FALSE, 0);
    AddAttribute (seg, (COLOR_ATT|STYLE_ATT|SHADING_ATT|WIDTH_ATT),
                  BLACK_COLOR, SOLID_LINE, SOLID_SHADING, STD_PEN_WIDTH,
                  0);
    AddLabel (seg, stop+(20*XScale), top, "Annotated (reported) ORFs",
              SMALL_TEXT, 0, MIDDLE_RIGHT, 0);
  }
  if (xosp->slpb != NULL)
  {
    top -= 12;
    AddAttribute (seg, (COLOR_ATT|STYLE_ATT|SHADING_ATT|WIDTH_ATT),
                  BLUE_COLOR, SOLID_LINE, SOLID_SHADING, 5,
                  0);
    AddLine (seg, start, top, stop, top, FALSE, 0);
    AddAttribute (seg, (COLOR_ATT|STYLE_ATT|SHADING_ATT|WIDTH_ATT),
                  BLACK_COLOR, SOLID_LINE, SOLID_SHADING, STD_PEN_WIDTH,
                  0);
    AddLabel (seg, stop+(20*XScale), top, "Similar codon usage bias ORFs to seed ORFs",
              SMALL_TEXT, 0, MIDDLE_RIGHT, 0);
  }
  if (xosp->slps != NULL)
  {
    top -= 12;
    AddAttribute (seg, (COLOR_ATT|STYLE_ATT|SHADING_ATT|WIDTH_ATT),
                  RED_COLOR, SOLID_LINE, SOLID_SHADING, 5,
                  0);
    AddLine (seg, start, top, stop, top, FALSE, 0);
    AddAttribute (seg, (COLOR_ATT|STYLE_ATT|SHADING_ATT|WIDTH_ATT),
                  BLACK_COLOR, SOLID_LINE, SOLID_SHADING, STD_PEN_WIDTH,
                  0);
    AddLabel (seg, stop+(20*XScale), top, "Pattern match seed ORFs",
              SMALL_TEXT, 0, MIDDLE_RIGHT, 0);
  }

  xisp->picture = seg;

  w = FixedWindow (10, 10, 640, 720, "Consign", CloseGraphWindowProc);
  SetObjectExtra (w, xisp, CleanUpGraphWindow);
  g = HiddenGroup (w, -1, 0, NULL);
  v = CreateViewer (g, 560, 640, TRUE, TRUE);
  AttachPicture (v, seg, INT4_MIN, INT4_MAX, UPPER_LEFT, XScale, 1, NULL);
  PushButton (g, "Close", CloseGraphWindowButton);
  RealizeWindow (w);
  ArrowCursor ();
  Show (w);

  return;
}
Exemple #28
0
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);
}
Exemple #29
0
static void manager (struct plc * plc, signed count, signed pause)

{
	while (count--)
	{
		if (_anyset (plc->flags, PLC_VERSION))
		{
			VersionInfo1 (plc);
		}
		if (_anyset (plc->flags, PLC_ATTRIBUTES))
		{
			Attributes1 (plc);
		}
		if (_anyset (plc->flags, PLC_WATCHDOG_REPORT))
		{
			WatchdogReport (plc);
		}
		if (_anyset (plc->flags, PLC_NVRAM_INFO))
		{
			NVRAMInfo (plc);
		}
		if (_anyset (plc->flags, PLC_SDRAM_INFO))
		{
			SDRAMInfo (plc);
		}
		if (_anyset (plc->flags, PLC_READ_IDENTITY))
		{
			Identity1 (plc);
		}
		if (_anyset (plc->flags, PLC_NETWORK))
		{
			NetInfo1 (plc);
		}
		if (_anyset (plc->flags, PLC_SDRAM_CONFIG))
		{
			WriteCFG (plc);
		}
		if (_anyset (plc->flags, PLC_WRITE_MAC))
		{
			WriteNVM (plc);
		}
		if (_anyset (plc->flags, PLC_READ_MAC))
		{
			ReadFirmware1 (plc);
		}
		if (_anyset (plc->flags, PLC_WRITE_PIB))
		{
			WritePIB (plc);
		}
		if (_anyset (plc->flags, PLC_READ_PIB))
		{
			ReadParameters1 (plc);
		}
		if (_anyset (plc->flags, PLC_HOST_ACTION))
		{
			HostActionResponse (plc);
		}
		if (_anyset (plc->flags, PLC_PUSH_BUTTON))
		{
			PushButton (plc);
		}
		if (_anyset (plc->flags, (PLC_SETLOCALKEY | PLC_SETREMOTEKEY)))
		{
			SetNMK (plc);
		}
		if (_anyset (plc->flags, PLC_FACTORY_DEFAULTS))
		{
			FactoryDefaults (plc);
		}
		if (_anyset (plc->flags, PLC_FLASH_DEVICE))
		{
			FlashNVM (plc);
			WaitForRestart (plc);
		}
		if (_anyset (plc->flags, PLC_RESET_DEVICE))
		{
			ResetDevice (plc);
		}
		sleep (pause);
	}
	return;
}
Exemple #30
0
/*-------------- 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;
}