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

📄 cfilesystemcombo.cpp

📁 PGP8.0源码 请认真阅读您的文件包然后写出其具体功能
💻 CPP
字号:
/*____________________________________________________________________________
		Copyright (C) 2002 PGP Corporation
        All rights reserved.

        $Id: CFileSystemCombo.cpp,v 1.3 2002/08/06 20:09:23 dallen Exp $
____________________________________________________________________________*/

#include "pgpClassesConfig.h"

#include "CArray.h"
#include "CString.h"

#include "CPGPdiskEngine.h"
#include "CFileSystemCombo.h"
#include "CPGPdiskFormatter.h"

_USING_PGP

// Class CFileSystemCombo member functions

FileSys::Type 
CFileSystemCombo::Get() const
{
	if (IsWindow())
		SetFromSel();

	return mFileSystem;
}

void 
CFileSystemCombo::Fill(PGPUInt64 numBlocks)
{
	ResetContent();

	// Fill in the filesystem combo box.
	CArray<CPGPdiskFormatter::FileSysInfo>	fsArray;
	PGPUInt32								numFSes;

	CPGPdiskFormatter::GetValidFilesystems(numBlocks, fsArray, numFSes);

	for (PGPUInt32 i = 0; i < numFSes; i++)
	{
		PGPInt32	index	= AddString(fsArray[i].fsString);
		SetItemData(index, fsArray[i].fsType);
	}

	SetCurSel(0);
	SetFromSel();
}

void 
CFileSystemCombo::Set(FileSys::Type fileSystem)
{
	PGPInt32	index	= FindFileSystemIndex(fileSystem);

	if (index != -1)
	{
		SetCurSel(index);
		SetFromSel();
	}
}

PGPInt32 
CFileSystemCombo::FindFileSystemIndex(FileSys::Type fileSystem)
{
	PGPInt32	i;
	PGPInt32	count	= GetCount();

	for (i = 0; i < count; i++)
	{
		if (GetItemData(i) == static_cast<PGPUInt32>(fileSystem))
			return i;
	}

	return -1;
}

void 
CFileSystemCombo::SetFromSel() const
{
	mFileSystem = static_cast<FileSys::Type>(GetItemData(GetCurSel()));
}

void 
CFileSystemCombo::OnDestroy()
{
	SetFromSel();
}

⌨️ 快捷键说明

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