📄 ccreatescalecombo.cpp
字号:
/*____________________________________________________________________________
Copyright (C) 2002 PGP Corporation
All rights reserved.
$Id: CCreateScaleCombo.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 "CCreateScaleCombo.h"
_USING_PGP
// Class CCreateScaleCombo member functions
PGPdiskUIPriv::CreateScale
CCreateScaleCombo::Get() const
{
if (IsWindow())
SetFromSel();
return mCreateScale;
}
void
CCreateScaleCombo::Fill()
{
ResetContent();
// Add the options.
PGPInt32 index;
index = AddString("KB");
SetItemData(index, static_cast<PGPUInt32>(PGPdiskUIPriv::kKbScale));
index = AddString("MB");
SetItemData(index, static_cast<PGPUInt32>(PGPdiskUIPriv::kMbScale));
index = AddString("GB");
SetItemData(index, static_cast<PGPUInt32>(PGPdiskUIPriv::kGbScale));
SetCurSel(0);
SetFromSel();
}
void
CCreateScaleCombo::Set(PGPdiskUIPriv::CreateScale createScale)
{
PGPInt32 index = FindCreateScaleIndex(createScale);
if (index != -1)
{
SetCurSel(index);
SetFromSel();
}
}
PGPInt32
CCreateScaleCombo::FindCreateScaleIndex(
PGPdiskUIPriv::CreateScale createScale)
{
PGPInt32 i;
PGPInt32 count = GetCount();
for (i = 0; i < count; i++)
{
if (GetItemData(i) == static_cast<PGPUInt32>(createScale))
return i;
}
return -1;
}
void
CCreateScaleCombo::SetFromSel() const
{
mCreateScale = static_cast<PGPdiskUIPriv::CreateScale>(
GetItemData(GetCurSel()));
}
void
CCreateScaleCombo::OnDestroy()
{
SetFromSel();
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -