-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathCommonKeywordSheet.cpp
81 lines (65 loc) · 1.76 KB
/
CommonKeywordSheet.cpp
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
// CommonKeywordSheet.cpp : implementation file
//
// $Id$
//////////////////////////////////////////////////////////////////////
#include "stdafx.h"
#include "phreeqci2.h"
#include "CommonKeywordSheet.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CCommonKeywordSheet
IMPLEMENT_DYNAMIC(CCommonKeywordSheet, baseCommonKeywordSheet)
CCommonKeywordSheet::CCommonKeywordSheet(UINT nIDCaption, CWnd* pParentWnd, UINT iSelectPage)
:baseCommonKeywordSheet(nIDCaption, pParentWnd, iSelectPage)
{
m_n_user = 1;
m_n_user_end = N_EMPTY;
m_strDesc = _T("");
}
CCommonKeywordSheet::CCommonKeywordSheet(LPCTSTR pszCaption, CWnd* pParentWnd, UINT iSelectPage)
:baseCommonKeywordSheet(pszCaption, pParentWnd, iSelectPage)
{
m_n_user = 1;
m_n_user_end = N_EMPTY;
m_strDesc = _T("");
}
CCommonKeywordSheet::~CCommonKeywordSheet()
{
}
BEGIN_MESSAGE_MAP(CCommonKeywordSheet, baseCommonKeywordSheet)
//{{AFX_MSG_MAP(CCommonKeywordSheet)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CCommonKeywordSheet message handlers
CString CCommonKeywordSheet::GetLineZero(enum CKeyword::type nType)
{
CString strLineZero;
CString strKeyword = CKeyword::GetString(nType);
ASSERT(CKeyword::IsKeyword(strKeyword));
if (m_n_user_end == N_EMPTY)
{
ASSERT(m_n_user != N_EMPTY);
strLineZero.Format(_T("%s %d %s"),
(LPCTSTR)strKeyword,
m_n_user,
(LPCTSTR)m_strDesc
);
}
else
{
ASSERT(m_n_user <= m_n_user_end);
strLineZero.Format(_T("%s %d-%d %s"),
(LPCTSTR)strKeyword,
m_n_user,
m_n_user_end,
(LPCTSTR)m_strDesc
);
}
strLineZero.TrimRight();
return strLineZero;
}