4 Star 0 Fork 2

leegoobin/AutoPHS

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
dlgimglst.h 2.43 KB
一键复制 编辑 原始数据 按行查看 历史
uksoft 提交于 2014-11-26 16:31 . VSS代码移植到Git
#if !defined(AFX_DLGIMGLST_H__7AD465A0_80DF_11D5_8752_00D009619765__INCLUDED_)
#define AFX_DLGIMGLST_H__7AD465A0_80DF_11D5_8752_00D009619765__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// DlgImgLst.h : header file
//
/////////////////////////////////////////////////////////////////////////////
// CDlgImgLst dialog
#include "MImage.h"
#include "Cphs.h"
#define IMG_ID 4000
class CImgList : public CTypedPtrList <CObList,CMImage* >
{
private:
long m_Count;
public:
CImgList(){
m_Count=0;
}
virtual ~CImgList(){
CMImage* mTmp;
POSITION po;
po=GetHeadPosition();
while(po!=NULL)
{
mTmp=GetNext(po);
delete mTmp;
}
RemoveAll();
}
void SetCount(long nCount)
{
CMImage* mTmp;
/*po=GetHeadPosition();
while(po!=NULL)
{
mTmp=GetNext(po);
mTmp->DestroyWindow();
delete mTmp;
}
RemoveAll();
for(int i= 0 ;i<nCount;i++)
{
mTmp=new CMImage;
AddTail(mTmp);
}*/
m_Count=this->GetCount();
if(m_Count < nCount)
{
int C=nCount-m_Count;
for(int i=0;i<C;i++)
{
mTmp=new CMImage;
AddTail(mTmp);
}
}
else if(m_Count > nCount)
{
int C=m_Count-nCount;
for(int i=0;i<C;i++)
{
mTmp=GetTail();
if(IsWindow(mTmp->m_hWnd))
{
mTmp->DestroyWindow();
}
delete mTmp;
RemoveTail();
}
}
}
CMImage* operator [] (int nIndex ){
POSITION po;
po=FindIndex(nIndex);
return GetAt(po);
}
};
class CDlgImgLst : public CWnd
{
// Construction
public:
int m_ImgIx;
void OnImgClick(int Index);
void LoadAllImage();
virtual ~CDlgImgLst();
CDlgImgLst(CListBox* pListZDG,CListBox* pListBox); // standard constructor
// Dialog Data
//{{AFX_DATA(CDlgImgLst)
//enum { IDD = IDD_IMG_LST };
// NOTE: the ClassWizard will add data members here
//}}AFX_DATA
int m_imgCount;
CImgList m_Image;
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CDlgImgLst)
public:
virtual BOOL Create(CWnd* pParentWnd=NULL);
protected:
virtual LRESULT WindowProc(UINT message, WPARAM wParam, LPARAM lParam);
//}}AFX_VIRTUAL
// Implementation
protected:
CListBox* m_pListBox;
CListBox *m_pListZDG;
CBrush m_bkbr;
// Generated message map functions
//{{AFX_MSG(CDlgImgLst)
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_DLGIMGLST_H__7AD465A0_80DF_11D5_8752_00D009619765__INCLUDED_)
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
C++
1
https://gitee.com/uesoft/AutoPHS.git
git@gitee.com:uesoft/AutoPHS.git
uesoft
AutoPHS
AutoPHS
CAE

搜索帮助

D67c1975 1850385 1daf7b77 1850385