Code/Resource
Windows Develop
Linux-Unix program
Internet-Socket-Network
Web Server
Browser Client
Ftp Server
Ftp Client
Browser Plugins
Proxy Server
Email Server
Email Client
WEB Mail
Firewall-Security
Telnet Server
Telnet Client
ICQ-IM-Chat
Search Engine
Sniffer Package capture
Remote Control
xml-soap-webservice
P2P
WEB(ASP,PHP,...)
TCP/IP Stack
SNMP
Grid Computing
SilverLight
DNS
Cluster Service
Network Security
Communication-Mobile
Game Program
Editor
Multimedia program
Graph program
Compiler program
Compress-Decompress algrithms
Crypt_Decrypt algrithms
Mathimatics-Numerical algorithms
MultiLanguage
Disk/Storage
Java Develop
assembly language
Applications
Other systems
Database system
Embeded-SCM Develop
FlashMX/Flex
source in ebook
Delphi VCL
OS Develop
MiddleWare
MPI
MacOS develop
LabView
ELanguage
Software/Tools
E-Books
Artical/Document
SelectPointDlg.cpp
Package: solidgraph_sources.zip [view]
Upload User: kairuinn
Upload Date: 2009-02-07
Package Size: 2922k
Code Size: 5k
Category:
Graph program
Development Platform:
Visual C++
- // SelectPointDlg.cpp : implementation file
- //
- #include "stdafx.h"
- #include "..//..//Solidgraph.h"
- #include "SelectPointDlg.h"
- #include ".selectpointdlg.h"
- // CSelectPointDlg dialog
- IMPLEMENT_DYNAMIC(CSelectPointDlg, CDialog)
- CSelectPointDlg::CSelectPointDlg(CWnd* pParent /*=NULL*/)
- : CDialog(CSelectPointDlg::IDD, pParent)
- {
- m_enable_history = NULL;
- m_was_diasabled = false;
- }
- CSelectPointDlg::~CSelectPointDlg()
- {
- m_points.clear();
- if (m_enable_history)
- delete[] m_enable_history;
- }
- void CSelectPointDlg::DoDataExchange(CDataExchange* pDX)
- {
- CDialog::DoDataExchange(pDX);
- DDX_Control(pDX, IDC_SELECT_POINT_LIST, m_list);
- }
- BEGIN_MESSAGE_MAP(CSelectPointDlg, CDialog)
- ON_WM_SIZE()
- ON_NOTIFY(LVN_GETDISPINFO, IDC_SELECT_POINT_LIST, OnLvnGetdispinfoSelectPointList)
- ON_NOTIFY(NM_CLICK, IDC_SELECT_POINT_LIST, OnNMClickSelectPointList)
- ON_WM_ERASEBKGND()
- ON_BN_CLICKED(IDC_SELECT_POINT_FINISH_BUTTON, OnBnClickedSelectPointFinishButton)
- END_MESSAGE_MAP()
- IBaseInterfaceOfGetDialogs::DLG_TYPE CSelectPointDlg::GetType()
- {
- return IBaseInterfaceOfGetDialogs::SELECT_POINT_DLG;
- }
- CWnd* CSelectPointDlg::GetWindow()
- {
- return this;
- }
- void CSelectPointDlg::EnableControls(bool enbl)
- {
- if (m_enable_history==NULL)
- m_enable_history = new bool[2];
- if (enbl)
- {
- GetDlgItem(IDC_SELECT_POINT_LIST)->EnableWindow(m_enable_history[0]);
- GetDlgItem(IDC_SELECT_POINT_FINISH_BUTTON)->EnableWindow(m_enable_history[1]);
- m_was_diasabled = false;
- }
- else
- {
- if (!m_was_diasabled)
- {
- m_enable_history[0] = GetDlgItem(IDC_SELECT_POINT_LIST)->IsWindowEnabled()!=0;
- m_enable_history[1] = GetDlgItem(IDC_SELECT_POINT_FINISH_BUTTON)->IsWindowEnabled()!=0;
- }
- GetDlgItem(IDC_SELECT_POINT_LIST)->EnableWindow(FALSE);
- GetDlgItem(IDC_SELECT_POINT_FINISH_BUTTON)->EnableWindow(FALSE);
- m_was_diasabled = true;
- }
- Invalidate();
- }
- void CSelectPointDlg::AddPoint(double xP,double yP,double zP)
- {
- PNTS tmpS;
- tmpS.pX = xP;
- tmpS.pY = yP;
- tmpS.pZ = zP;
- tmpS.pStr.Format("X=%f Y=%f Z=%f",xP,yP,zP);
- m_points.push_back(tmpS);
- m_list.SetItemCount(m_points.size());
- }
- void CSelectPointDlg::RemoveAllPoints()
- {
- m_list.DeleteAllItems();
- m_points.clear();
- m_list.SetItemCount(0);
- }
- void CSelectPointDlg::SetCurrentPoint(unsigned int ind)
- {
- if (ind>=m_points.size())
- return;
- m_list.SetItemState(ind, LVNI_SELECTED, LVNI_SELECTED);
- }
- unsigned int CSelectPointDlg::GetCurrentPoint()
- {
- POSITION pos = m_list.GetFirstSelectedItemPosition();
- return m_list.GetNextSelectedItem(pos);
- }
- // CSelectPointDlg message handlers
- void CSelectPointDlg::OnCancel()
- {
- // TODO: Add your specialized code here and/or call the base class
- //CDialog::OnCancel();
- }
- void CSelectPointDlg::OnOK()
- {
- // TODO: Add your specialized code here and/or call the base class
- //CDialog::OnOK();
- }
- BOOL CSelectPointDlg::OnInitDialog()
- {
- CDialog::OnInitDialog();
- //m_list.SubclassDlgItem(IDC_SELECT_POINT_LIST, this);
- m_list.InsertColumn(0,"");
- CRect rct;
- m_list.GetWindowRect(rct);
- m_list.SetColumnWidth(0,rct.Width());
- // 朽琊屮噱