~ubuntu-branches/ubuntu/edgy/ncbi-tools6/edgy

« back to all changes in this revision

Viewing changes to desktop/salsa.c

  • Committer: Bazaar Package Importer
  • Author(s): Barry deFreese
  • Date: 2006-07-19 23:28:07 UTC
  • mfrom: (1.1.5 upstream)
  • Revision ID: james.westby@ubuntu.com-20060719232807-et3cdmcjgmnyleyx
Tags: 6.1.20060507-3ubuntu1
Re-merge with Debian

Show diffs side-by-side

added added

removed removed

Lines of Context:
28
28
*
29
29
* Version Creation Date:   1/27/96
30
30
*
31
 
* $Revision: 6.167 $
 
31
* $Revision: 6.169 $
32
32
*
33
33
* File Description: 
34
34
*
66
66
#include <salpedit.h>
67
67
#include <salptool.h>
68
68
#include <alignmgr.h>
 
69
#include <alignmgr2.h>
69
70
#include <seqpanel.h>
70
71
 
71
72
/******/
4895
4896
  return TRUE;
4896
4897
}
4897
4898
 
4898
 
static void OpenNewAlignmentEditor (SeqAlignPtr salp, Uint2 input_entityID)
 
4899
extern void OpenNewAlignmentEditor (SeqAlignPtr salp, Uint2 input_entityID)
4899
4900
{
4900
 
  Int2                top;
4901
 
  ForM                f;
 
4901
  Int2                  top;
 
4902
  ForM                  f;
 
4903
  ModalAcceptCancelData acd;
 
4904
  WindoW                w;
 
4905
  GrouP                 h, c;
 
4906
  PrompT                ppt;
 
4907
  ButtoN                b;
 
4908
  SeqAnnotPtr           sanp;
4902
4909
 
4903
4910
  if (salp == NULL)
4904
4911
  {
4905
4912
    return;
4906
4913
  }
 
4914
  if (salp->segtype != SAS_DENSEG)
 
4915
  {
 
4916
    w = ModalWindow (-50, -33, -10, -10, NULL);
 
4917
    h = HiddenGroup (w, -1, 0, NULL);
 
4918
    SetGroupSpacing (h, 10, 10);
 
4919
    ppt = StaticPrompt (h, "Warning!  You have a pairwise alignment.  Some functions may not be available.",
 
4920
                        0, dialogTextHeight, programFont, 'l');
 
4921
    c = HiddenGroup (h, 4, 0, NULL);
 
4922
    b = PushButton (c, "Continue anyway", ModalAcceptButton);
 
4923
    SetObjectExtra (b, &acd, NULL);
 
4924
    b = PushButton (c, "Convert alignment", ModalThirdOptionButton);
 
4925
    SetObjectExtra (b, &acd, NULL);
 
4926
    b = PushButton (c, "Cancel", ModalCancelButton);
 
4927
    SetObjectExtra (b, &acd, NULL);
 
4928
      
 
4929
    acd.accepted = FALSE;
 
4930
    acd.cancelled = FALSE;
 
4931
    acd.third_option = FALSE;
 
4932
  
 
4933
    AlignObjects (ALIGN_CENTER, (HANDLE) ppt, (HANDLE) c, NULL);
 
4934
    RealizeWindow (w);
 
4935
    Show (w);
 
4936
    Update ();
 
4937
  
 
4938
    while (!acd.accepted && ! acd.cancelled && ! acd.third_option)
 
4939
    {
 
4940
      ProcessExternalEvent ();
 
4941
      Update ();
 
4942
    }
 
4943
    ProcessAnEvent ();
 
4944
    Remove (w);
 
4945
    if (acd.cancelled)
 
4946
    {
 
4947
      return;
 
4948
    }
 
4949
    else if (acd.third_option)
 
4950
    {
 
4951
      WatchCursor();
 
4952
      Update();
 
4953
      sanp = GetSeqAnnotForAlignment (salp);
 
4954
      ConvertPairwiseToMultipleAlignment (salp);
 
4955
      ObjMgrSetDirtyFlag (input_entityID, TRUE);
 
4956
      ObjMgrSendMsg (OM_MSG_UPDATE, input_entityID, 0, 0);
 
4957
      salp = sanp->data;
 
4958
      ArrowCursor();
 
4959
      Update();
 
4960
    }
 
4961
  }
 
4962
  
4907
4963
#ifdef WIN_MAC
4908
4964
  top = 53;
4909
4965
#else
5163
5219
  if (salp == NULL)
5164
5220
     return OM_MSG_RET_ERROR;
5165
5221
    
5166
 
  if (salp->dim == 2)
 
5222
  if (salp->dim == 2 || salp->segtype != SAS_DENSEG)
5167
5223
  {
5168
5224
    OpenNewAlignmentEditor (salp, ompcp->input_entityID);
5169
5225
  }