-
Notifications
You must be signed in to change notification settings - Fork 12
Expand file tree
/
Copy pathGroupsel.cpp
More file actions
133 lines (95 loc) · 3.53 KB
/
Groupsel.cpp
File metadata and controls
133 lines (95 loc) · 3.53 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
/*
GeneDoc: Multiple Sequence Alignment Editing Utility
Copyright (C) 2000, Karl Nicholas
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
// groupsel.cpp : implementation file
//
#include "stdafx.h"
#ifdef _DEBUG
#undef THIS_FILE
static char BASED_CODE THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CGroupSelect dialog
CGroupSelect::CGroupSelect(CWnd* pParent /*=NULL*/)
: CDialog(CGroupSelect::IDD, pParent)
{
//{{AFX_DATA_INIT(CGroupSelect)
// NOTE: the ClassWizard will add member initialization here
//}}AFX_DATA_INIT
}
void CGroupSelect::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CGroupSelect)
DDX_Control(pDX, IDC_OTHERLIST, m_OtherList);
DDX_Control(pDX, IDC_GROUPLIST, m_GroupList);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CGroupSelect, CDialog)
//{{AFX_MSG_MAP(CGroupSelect)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CGroupSelect message handlers
BOOL CGroupSelect::OnInitDialog()
{
CDialog::OnInitDialog();
CenterWindow();
if ( GroupSeq == 0 ) {
// TODO: Add extra initialization here
POSITION tPos = pDoc->m_UserVars.m_DisplayVars.GetHeadPosition();
while ( tPos != NULL ) {
CDisplayVars *DisplayVars = (CDisplayVars *)pDoc->m_UserVars.m_DisplayVars.GetNext(tPos);
m_GroupList.AddString( DisplayVars->GetGroupName() );
}
m_OtherList.AddString( "<All Other>" );
tPos = pDoc->m_UserVars.m_DisplayVars.GetHeadPosition();
while ( tPos != NULL ) {
CDisplayVars *DisplayVars = (CDisplayVars *)pDoc->m_UserVars.m_DisplayVars.GetNext(tPos);
m_OtherList.AddString( DisplayVars->GetGroupName() );
}
} else {
// TODO: Add extra initialization here
POSITION tPos = pDoc->pGSFiller->SegDataList.GetHeadPosition();
while (tPos != NULL ) {
CGeneSegment *tCGSeg = (CGeneSegment *)pDoc->pGSFiller->SegDataList.GetNext(tPos);
if ( tCGSeg->GetStyle() != LINESEQUENCE ) continue;
m_GroupList.AddString( tCGSeg->GetTitle() );
}
tPos = pDoc->pGSFiller->SegDataList.GetHeadPosition();
while (tPos != NULL ) {
CGeneSegment *tCGSeg = (CGeneSegment *)pDoc->pGSFiller->SegDataList.GetNext(tPos);
if ( tCGSeg->GetStyle() != LINESEQUENCE ) continue;
m_OtherList.AddString( tCGSeg->GetTitle() );
}
}
GroupNum1 = 0;
GroupNum2 = 0;
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
void CGroupSelect::OnOK()
{
// TODO: Add extra validation here
if ( m_GroupList.GetCurSel() != LB_ERR ) {
GroupNum1 = m_GroupList.GetCurSel() + 1;
m_GroupList.GetText(GroupNum1 - 1, GroupName1);
}
if ( m_OtherList.GetCurSel() != LB_ERR ) {
GroupNum2 = m_OtherList.GetCurSel() + 1;
m_OtherList.GetText(GroupNum2 - 1, GroupName2);
}
CDialog::OnOK();
}