⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 dlgselcurvers.cpp

📁 是有关石油物理测井曲线的分层方法
💻 CPP
字号:
// DlgSelCurvers.cpp : implementation file
//

#include "stdafx.h"
#include "Smooth.h"
#include "DlgSelCurvers.h"
#include "LogCurve.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// CDlgSelCurvers dialog

extern 	CWellHead wh;

CDlgSelCurvers::CDlgSelCurvers(CWnd* pParent /*=NULL*/)
	: CDialog(CDlgSelCurvers::IDD, pParent)
{
	//{{AFX_DATA_INIT(CDlgSelCurvers)
		// NOTE: the ClassWizard will add member initialization here
	//}}AFX_DATA_INIT
}


void CDlgSelCurvers::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CDlgSelCurvers)
	DDX_Control(pDX, IDC_LST_SEL, m_lstSel);
	DDX_Control(pDX, IDC_LST_OLD, m_lstOld);
	//}}AFX_DATA_MAP
}


BEGIN_MESSAGE_MAP(CDlgSelCurvers, CDialog)
	//{{AFX_MSG_MAP(CDlgSelCurvers)
	ON_BN_CLICKED(IDC_BTN_NOSEL, OnBtnNosel)
	ON_BN_CLICKED(IDC_BTN_SELALL, OnBtnSelall)
	ON_BN_CLICKED(IDC_BTN_SELECT, OnBtnSelect)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CDlgSelCurvers message handlers

void CDlgSelCurvers::OnOK() 
{
	// TODO: Add extra validation here
	CString str;
	UpdateData(TRUE);
	for(int i=0;i<m_lstSel.GetCount();i++)
	{
		m_lstSel.GetText(i,str);
		for(int j=1;j<=wh.nNumCur;j++)
		{
			if (wh.Curve[j].strCurName.Compare(str)==0)
				selID[selCount++]=j;
		}
	}		
	CDialog::OnOK();
}

void CDlgSelCurvers::OnBtnNosel() 
{
	// TODO: Add your control notification handler code here
	CString str;
	for(int i=m_lstSel.GetCount()-1;i>=0;i--)
	{
		int id=-1;
		id=m_lstSel.GetSel(i);
		if(id==1)//该项被选择
		{
			m_lstSel.GetText(i,str);
			m_lstSel.DeleteString(i);
			m_lstOld.AddString(str) ;
		}		
	}
}

void CDlgSelCurvers::OnBtnSelall() 
{
	// TODO: Add your control notification handler code here
	CString str;
	for(int i=m_lstOld.GetCount()-1;i>=0;i--)
	{
		m_lstOld.GetText(i,str);
		//if (m_lstSel.FindString(-1,str)==-1)  //已经存在
		m_lstSel.AddString(str);
		m_lstOld.DeleteString(i);
	}	
	
}

void CDlgSelCurvers::OnBtnSelect() 
{

	CString str;
	for(int i=m_lstOld.GetCount()-1;i>=0;i--)
	{
		int id=-1;
		id=m_lstOld.GetSel(i);
		if(id==1)//该项被选择
		{
			m_lstOld.GetText(i,str);
			//if (m_lstSel.FindString(-1,str)==-1)  //已经存在
			m_lstOld.DeleteString(i); 
			m_lstSel.AddString(str);
		}
	}	

}

BOOL CDlgSelCurvers::OnInitDialog() 
{
	CDialog::OnInitDialog();
	
	// TODO: Add extra initialization here
	for(int i=1;i<=wh.nNumCur;i++)
		m_lstOld.AddString(wh.Curve[i].strCurName);

	UpdateData(FALSE);

	return TRUE;  // return TRUE unless you set the focus to a control
	              // EXCEPTION: OCX Property Pages should return FALSE
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -