TIFFDirDLG.cpp
上传用户:lbr_007
上传日期:2019-05-31
资源大小:282k
文件大小:2k
- // TIFFDirDLG.cpp : implementation file
- //
- #include "stdafx.h"
- #include "TIFFSample.h"
- #include "TIFFDirDLG.h"
- #include "TIFFDoc.h"
- #include "TIFFView.h"
- #ifdef _DEBUG
- #define new DEBUG_NEW
- #undef THIS_FILE
- static char THIS_FILE[] = __FILE__;
- #endif
- extern TIFFView * g_view;
- /////////////////////////////////////////////////////////////////////////////
- // TIFFDirDLG dialog
- TIFFDirDLG::TIFFDirDLG(CWnd* pParent /*=NULL*/)
- : CDialog(TIFFDirDLG::IDD, pParent)
- {
- //{{AFX_DATA_INIT(TIFFDirDLG)
- // NOTE: the ClassWizard will add member initialization here
- //}}AFX_DATA_INIT
- }
- void TIFFDirDLG::DoDataExchange(CDataExchange* pDX)
- {
- CDialog::DoDataExchange(pDX);
- //{{AFX_DATA_MAP(TIFFDirDLG)
- DDX_Control(pDX, IDC_TIFFDIR_LIST, m_list);
- //}}AFX_DATA_MAP
- }
- BEGIN_MESSAGE_MAP(TIFFDirDLG, CDialog)
- //{{AFX_MSG_MAP(TIFFDirDLG)
- ON_NOTIFY(NM_CLICK, IDC_TIFFDIR_LIST, OnClickList)
- ON_NOTIFY(NM_DBLCLK, IDC_TIFFDIR_LIST, OnDoubleClickList)
- //}}AFX_MSG_MAP
- END_MESSAGE_MAP()
- /////////////////////////////////////////////////////////////////////////////
- // TIFFDirDLG message handlers
- void TIFFDirDLG::OnClickList(NMHDR* pNMHDR, LRESULT* pResult)
- {
- *pResult = 0;
- }
- BOOL TIFFDirDLG::OnInitDialog()
- {
- CDialog::OnInitDialog();
-
- m_list.InsertColumn(0,_T(""), LVCFMT_LEFT, 70);
-
- return TRUE; // return TRUE unless you set the focus to a control
- // EXCEPTION: OCX Property Pages should return FALSE
- }
- void TIFFDirDLG::UpdateList(void)
- {
- if (m_list.m_hWnd)
- {
- m_list.DeleteAllItems();
- char txt[256];
- for (UINT32 i = 0; i < m_imageCount; i++){
- sprintf(txt,"image%d",i+1);
- m_list.InsertItem(i,txt,0);
- }
- }
- }
- void TIFFDirDLG::OnDoubleClickList(NMHDR* pNMHDR, LRESULT* pResult)
- {
- int ndx = m_list.GetNextItem( -1, LVNI_SELECTED );
- if (ndx >= 0)
- {
- if (g_view)
- {
- g_view->SetImage(ndx);
- g_view->ShowImage();
- }
- }
-
- *pResult = 0;
- }