handlepage.cpp

来自「IO函数调用测试」· C++ 代码 · 共 126 行

CPP
126
字号
// HandlePage.cpp : implementation file
//

#include "stdafx.h"
#include "afxtempl.h"

#include "Status.h"
#include "IOExplorer.h"
#include "TraceEvent.h"
#include "Handle.h"
  #include "HandleCombo.h"
  #include "handleManager.h"
  #include "TraceManager.h"
    #include "CreateFileSheet.h"
#include "HandlePage.h"

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

/////////////////////////////////////////////////////////////////////////////
// CHandlePage property page

IMPLEMENT_DYNCREATE(CHandlePage, CPropertyPage)

CHandlePage::CHandlePage()
    {
     ASSERT(FALSE); // Must never call this method directly!
    }

CHandlePage::CHandlePage(int idd) : CPropertyPage(idd)
{
	//{{AFX_DATA_INIT(CHandlePage)
		// NOTE: the ClassWizard will add member initialization here
	//}}AFX_DATA_INIT
}

CHandlePage::~CHandlePage()
{
}

void CHandlePage::DoDataExchange(CDataExchange* pDX)
{
	CPropertyPage::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CWriteFile)
	DDX_Control(pDX, IDC_STATUS, c_Status);
	DDX_Control(pDX, IDC_TEXT, c_Text);
	DDX_Control(pDX, IDC_HANDLE, c_Handle);
	//}}AFX_DATA_MAP
}


BEGIN_MESSAGE_MAP(CHandlePage, CPropertyPage)
	//{{AFX_MSG_MAP(CHandlePage)
	ON_CBN_SELENDOK(IDC_HANDLE, OnSelendokHandle)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CHandlePage message handlers

void CHandlePage::OnSelendokHandle() 
{
 CCreateFileSheet * sheet = getSheet();
 sheet->HandleList.setCurrentHandle(c_Handle.GetCurHandle());
 
 updateControls();
}


BOOL CHandlePage::OnInitDialog() 
{
	CPropertyPage::OnInitDialog();
	
	return TRUE;  // return TRUE unless you set the focus to a control
	              // EXCEPTION: OCX Property Pages should return FALSE
}

/****************************************************************************
*                                 CHandlePage::loadHandles
* Result: void
*       
* Effect: 
*       Loads the handles control
****************************************************************************/

void CHandlePage::loadHandles()
    {
     CCreateFileSheet * sheet = getSheet();
     
     c_Handle.ResetContent();

     for(POSITION p = sheet->HandleList.GetHeadPosition(); p != NULL; )
        { /* add handles */
	 CHandle * ho = sheet->HandleList.GetNext(p);
	 c_Handle.AddString(ho);
	} /* add handles */

     c_Handle.SelectItem(sheet->HandleList.getCurrentHandle());
    }

BOOL CHandlePage::OnSetActive() 
{
     loadHandles();
     return CPropertyPage::OnSetActive();
}

/****************************************************************************
*                         CHandlePage::updateControls
* Result: void
*       
* Effect:
*	Causes an assertion failure in the debug version.
* Notes: 
*       This should never be called.  Only the subclass should implement
*	this.  It would be a pure virtual function except that MFC insists
*	that the DYNCREATE option be able to instantiate the class.
****************************************************************************/

void CHandlePage::updateControls()
    {
     ASSERT(FALSE);  // Should be defined by subclass
    }

⌨️ 快捷键说明

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