本文整理汇总了C++中CFont::GetLogFont方法的典型用法代码示例。如果您正苦于以下问题:C++ CFont::GetLogFont方法的具体用法?C++ CFont::GetLogFont怎么用?C++ CFont::GetLogFont使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CFont
的用法示例。
在下文中一共展示了CFont::GetLogFont方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: InitPropList
void CPropertiesWnd::InitPropList()
{
SetPropListFont();
m_wndPropList.EnableHeaderCtrl(FALSE);
m_wndPropList.EnableDescriptionArea();
m_wndPropList.SetVSDotNetLook();
m_wndPropList.MarkModifiedProperties();
CMFCPropertyGridProperty* pGroup1 = new CMFCPropertyGridProperty(_T("外观"));
pGroup1->AddSubItem(new CMFCPropertyGridProperty(_T("三维外观"), (_variant_t) false, _T("指定窗口的字体不使用粗体,并且控件将使用三维边框")));
CMFCPropertyGridProperty* pProp = new CMFCPropertyGridProperty(_T("边框"), _T("对话框外框"), _T("其中之一:“无”、“细”、“可调整大小”或“对话框外框”"));
pProp->AddOption(_T("无"));
pProp->AddOption(_T("细"));
pProp->AddOption(_T("可调整大小"));
pProp->AddOption(_T("对话框外框"));
pProp->AllowEdit(FALSE);
pGroup1->AddSubItem(pProp);
pGroup1->AddSubItem(new CMFCPropertyGridProperty(_T("标题"), (_variant_t) _T("关于"), _T("指定窗口标题栏中显示的文本")));
m_wndPropList.AddProperty(pGroup1);
CMFCPropertyGridProperty* pSize = new CMFCPropertyGridProperty(_T("窗口大小"), 0, TRUE);
pProp = new CMFCPropertyGridProperty(_T("高度"), (_variant_t) 250l, _T("指定窗口的高度"));
pProp->EnableSpinControl(TRUE, 50, 300);
pSize->AddSubItem(pProp);
pProp = new CMFCPropertyGridProperty( _T("宽度"), (_variant_t) 150l, _T("指定窗口的宽度"));
pProp->EnableSpinControl(TRUE, 50, 200);
pSize->AddSubItem(pProp);
m_wndPropList.AddProperty(pSize);
CMFCPropertyGridProperty* pGroup2 = new CMFCPropertyGridProperty(_T("字体"));
LOGFONT lf;
CFont* font = CFont::FromHandle((HFONT) GetStockObject(DEFAULT_GUI_FONT));
font->GetLogFont(&lf);
lstrcpy(lf.lfFaceName, _T("宋体, Arial"));
pGroup2->AddSubItem(new CMFCPropertyGridFontProperty(_T("字体"), lf, CF_EFFECTS | CF_SCREENFONTS, _T("指定窗口的默认字体")));
pGroup2->AddSubItem(new CMFCPropertyGridProperty(_T("使用系统字体"), (_variant_t) true, _T("指定窗口使用“MS Shell Dlg”字体")));
m_wndPropList.AddProperty(pGroup2);
CMFCPropertyGridProperty* pGroup3 = new CMFCPropertyGridProperty(_T("杂项"));
pProp = new CMFCPropertyGridProperty(_T("(名称)"), _T("应用程序"));
pProp->Enable(FALSE);
pGroup3->AddSubItem(pProp);
CMFCPropertyGridColorProperty* pColorProp = new CMFCPropertyGridColorProperty(_T("窗口颜色"), RGB(210, 192, 254), NULL, _T("指定默认的窗口颜色"));
pColorProp->EnableOtherButton(_T("其他..."));
pColorProp->EnableAutomaticButton(_T("默认"), ::GetSysColor(COLOR_3DFACE));
pGroup3->AddSubItem(pColorProp);
static const TCHAR szFilter[] = _T("图标文件(*.ico)|*.ico|所有文件(*.*)|*.*||");
pGroup3->AddSubItem(new CMFCPropertyGridFileProperty(_T("图标"), TRUE, _T(""), _T("ico"), 0, szFilter, _T("指定窗口图标")));
pGroup3->AddSubItem(new CMFCPropertyGridFileProperty(_T("文件夹"), _T("c:\\")));
m_wndPropList.AddProperty(pGroup3);
CMFCPropertyGridProperty* pGroup4 = new CMFCPropertyGridProperty(_T("层次结构"));
CMFCPropertyGridProperty* pGroup41 = new CMFCPropertyGridProperty(_T("第一个子级"));
pGroup4->AddSubItem(pGroup41);
CMFCPropertyGridProperty* pGroup411 = new CMFCPropertyGridProperty(_T("第二个子级"));
pGroup41->AddSubItem(pGroup411);
pGroup411->AddSubItem(new CMFCPropertyGridProperty(_T("项 1"), (_variant_t) _T("值 1"), _T("此为说明")));
pGroup411->AddSubItem(new CMFCPropertyGridProperty(_T("项 2"), (_variant_t) _T("值 2"), _T("此为说明")));
pGroup411->AddSubItem(new CMFCPropertyGridProperty(_T("项 3"), (_variant_t) _T("值 3"), _T("此为说明")));
pGroup4->Expand(FALSE);
m_wndPropList.AddProperty(pGroup4);
}
示例2: NcPaintGripper
//.........这里部分代码省略.........
if (!bGradient)
pDC->FillSolidRect(&rcGrip, clrCptn); // solid color
else
{
// gradient from left to right or from bottom to top
// get second gradient color (the right end)
COLORREF clrCptnRight = m_bActive ?
::GetSysColor(COLOR_GRADIENTACTIVECAPTION) :
::GetSysColor(COLOR_GRADIENTINACTIVECAPTION);
// this will make 2^6 = 64 fountain steps
int nShift = 6;
int nSteps = 1 << nShift;
for (int i = 0; i < nSteps; i++)
{
// do a little alpha blending
int nR = (GetRValue(clrCptn) * (nSteps - i) +
GetRValue(clrCptnRight) * i) >> nShift;
int nG = (GetGValue(clrCptn) * (nSteps - i) +
GetGValue(clrCptnRight) * i) >> nShift;
int nB = (GetBValue(clrCptn) * (nSteps - i) +
GetBValue(clrCptnRight) * i) >> nShift;
COLORREF cr = RGB(nR, nG, nB);
// then paint with the resulting color
CRect r2 = rcGrip;
if (bHorz)
{
r2.bottom = rcGrip.bottom -
((i * rcGrip.Height()) >> nShift);
r2.top = rcGrip.bottom -
(((i + 1) * rcGrip.Height()) >> nShift);
if (r2.Height() > 0)
pDC->FillSolidRect(r2, cr);
}
else
{
r2.left = rcGrip.left +
((i * rcGrip.Width()) >> nShift);
r2.right = rcGrip.left +
(((i + 1) * rcGrip.Width()) >> nShift);
if (r2.Width() > 0)
pDC->FillSolidRect(r2, cr);
}
}
}*/
// draw the caption text - first select a font
CFont font;
int ppi = pDC->GetDeviceCaps(LOGPIXELSX);
#ifdef CHINESE_VER
int pointsize = MulDiv(90, 96, ppi); // 9.0 points at 96 ppi
#else
int pointsize = MulDiv(85, 96, ppi); // 8.5 points at 96 ppi for english
#endif
LOGFONT lf;
BOOL bFont = font.CreatePointFont(pointsize, m_sFontFace);
if (bFont)
{
// get the text color
/* COLORREF clrCptnText = m_bActive ?
::GetSysColor(COLOR_CAPTIONTEXT) :
::GetSysColor(COLOR_INACTIVECAPTIONTEXT);*/
COLORREF clrCptnText = ::GetSysColor(COLOR_BTNTEXT);
int nOldBkMode = pDC->SetBkMode(TRANSPARENT);
COLORREF clrOldText = pDC->SetTextColor(clrCptnText);
if (bHorz)
{
// rotate text 90 degrees CCW if horizontally docked
font.GetLogFont(&lf);
font.DeleteObject();
lf.lfEscapement = 900;
font.CreateFontIndirect(&lf);
}
CFont* pOldFont = pDC->SelectObject(&font);
CString sTitle;
GetWindowText(sTitle);
CPoint ptOrg = bHorz ?
CPoint(rcGrip.left - 1, rcGrip.bottom - 3) :
CPoint(rcGrip.left + 3, rcGrip.top );
pDC->ExtTextOut(ptOrg.x, ptOrg.y,
ETO_CLIPPED, rcGrip, sTitle, NULL);
pDC->SelectObject(pOldFont);
pDC->SetBkMode(nOldBkMode);
pDC->SetTextColor(clrOldText);
}
// draw the button
m_biHide.Paint(pDC);
}
示例3: DrawText
void CProgressCtrlX::DrawText(const CDrawInfo& info, const CRect &rcMax, const CRect &rcBar)
{
if(!(info.dwStyle&PBS_TEXTMASK))
return;
BOOL fVert = info.dwStyle&PBS_VERTICAL;
CDC *pDC = info.pDC;
int nValue = 0;
CString sFormat;
GetWindowText(sFormat);
switch(info.dwStyle&PBS_TEXTMASK)
{
case PBS_SHOW_PERCENT:
if(sFormat.IsEmpty())
sFormat = "%d%%";
// retrieve current position and range
nValue = (int)((float)(info.nCurPos-info.nLower) * 100 / ((info.nUpper-info.nLower == 0) ? 1 : info.nUpper-info.nLower));
break;
case PBS_SHOW_POSITION:
if(sFormat.IsEmpty())
sFormat = "%d";
// retrieve current position
nValue = info.nCurPos;
break;
}
if (sFormat.IsEmpty())
return;
CFont* pFont = GetFont();
CSelFont sf(pDC, pFont);
CSelTextColor tc(pDC, m_clrTextOnBar);
CSelBkMode bm(pDC, TRANSPARENT);
CSelTextAlign ta(pDC, TA_BOTTOM|TA_CENTER);
CPoint ptOrg = pDC->GetWindowOrg();
CString sText;
sText.Format(sFormat, nValue);
LONG grad = 0;
if(pFont)
{
LOGFONT lf;
pFont->GetLogFont(&lf);
grad = lf.lfEscapement/10;
}
int x = 0, y = 0, dx = 0, dy = 0;
CSize sizText = pDC->GetTextExtent(sText);
if(grad == 0) { x = sizText.cx; y = sizText.cy; dx = 0; dy = sizText.cy;}
else if(grad == 90) { x = sizText.cy; y = sizText.cx; dx = sizText.cy; dy = 0;}
else if(grad == 180) { x = sizText.cx; y = sizText.cy; dx = 0; dy = -sizText.cy;}
else if(grad == 270) { x = sizText.cy; y = sizText.cx; dx = -sizText.cy; dy = 0;}
else ASSERT(0); // angle not supported
CPoint pt = pDC->GetViewportOrg();
if(info.dwStyle&PBS_TIED_TEXT)
{
CRect rcFill(ConvertToReal(info, rcBar));
if((fVert ? y : x) <= rcBar.Width())
{
pDC->SetViewportOrg(rcFill.left + (rcFill.Width() + dx)/2,
rcFill.top + (rcFill.Height() + dy)/2);
DrawClippedText(info, rcBar, sText, ptOrg);
}
}
else
{
pDC->SetViewportOrg(info.rcClient.left + (info.rcClient.Width() + dx)/2,
info.rcClient.top + (info.rcClient.Height() + dy)/2);
if(m_clrTextOnBar == m_clrTextOnBk)
// if the same color for bar and background draw text once
DrawClippedText(info, rcMax, sText, ptOrg);
else
{
// else, draw clipped parts of text
// draw text on gradient
if(rcBar.left != rcBar.right)
DrawClippedText(info, rcBar, sText, ptOrg);
// draw text out of gradient
if(rcMax.right > rcBar.right)
{
tc.Select(m_clrTextOnBk);
CRect rc(rcMax);
rc.left = rcBar.right;
DrawClippedText(info, rc, sText, ptOrg);
}
if(rcMax.left < rcBar.left)
{
tc.Select(m_clrTextOnBk);
CRect rc(rcMax);
rc.right = rcBar.left;
DrawClippedText(info, rc, sText, ptOrg);
}
}
}
pDC->SetViewportOrg(pt);
}
示例4: DrawAxes
void MyGraph::DrawAxes(CDC& dc) const
{
VALIDATE;
ASSERT_VALID(&dc);
_ASSERTE(MyGraph::PieChart != m_eGraphType);
dc.SetTextColor(::GetSysColor(COLOR_WINDOWTEXT));
// Draw y axis.
dc.MoveTo(m_ptOrigin);
VERIFY(dc.LineTo(m_ptOrigin.x, m_ptOrigin.y - m_nYAxisHeight));
// Draw x axis.
dc.MoveTo(m_ptOrigin);
if (m_saLegendLabels.GetSize()) {
VERIFY(dc.LineTo(m_ptOrigin.x +
(m_nXAxisWidth - m_rcLegend.Width() - (GAP_PIXELS * 2)),
m_ptOrigin.y));
}
else {
VERIFY(dc.LineTo(m_ptOrigin.x + m_nXAxisWidth, m_ptOrigin.y));
}
// Note: m_nAxisLabelHeight and m_nAxisTickLabelHeight have been calculated in SetupAxis()
// Create the x-axis label font.
CFont fontXAxis;
VERIFY(fontXAxis.CreatePointFont(m_nAxisLabelHeight, _T("Arial"), &dc));
// Obtain the height of the font in device coordinates.
LOGFONT pLF;
VERIFY(fontXAxis.GetLogFont(&pLF));
int fontHeightDC = pLF.lfHeight;
// Create the y-axis label font.
CFont fontYAxis;
VERIFY(fontYAxis.CreateFont(
/* nHeight */ fontHeightDC,
/* nWidth */ 0,
/* nEscapement */ 90 * 10,
/* nOrientation */ 0,
/* nWeight */ FW_DONTCARE,
/* bItalic */ false,
/* bUnderline */ false,
/* cStrikeOut */ 0,
ANSI_CHARSET,
OUT_DEFAULT_PRECIS,
CLIP_DEFAULT_PRECIS,
PROOF_QUALITY,
VARIABLE_PITCH | FF_DONTCARE,
_T("Arial"))
);
// Set the y-axis label font and draw the label.
CFont* pFontOld = dc.SelectObject(&fontYAxis);
ASSERT_VALID(pFontOld);
CSize sizYLabel(dc.GetTextExtent(m_sYAxisLabel));
VERIFY(dc.TextOut(GAP_PIXELS, (m_rcGraph.Height() + sizYLabel.cx) / 2,
m_sYAxisLabel));
// Set the x-axis label font and draw the label.
VERIFY(dc.SelectObject(&fontXAxis));
CSize sizXLabel(dc.GetTextExtent(m_sXAxisLabel));
VERIFY(dc.TextOut(m_ptOrigin.x + (m_nXAxisWidth - sizXLabel.cx) / 2,
m_rcGraph.bottom - GAP_PIXELS - sizXLabel.cy, m_sXAxisLabel));
// chose suitable tick step (1, 2, 5, 10, 20, 50, etc.)
int nMaxDataValue(GetMaxDataValue());
nMaxDataValue = max(nMaxDataValue, 1);
int nTickStep = 1;
while (10 * nTickStep * Y_AXIS_TICK_COUNT_TARGET <= nMaxDataValue)
nTickStep *= 10;
if (5 * nTickStep * Y_AXIS_TICK_COUNT_TARGET <= nMaxDataValue)
nTickStep *= 5;
if (2 * nTickStep * Y_AXIS_TICK_COUNT_TARGET <= nMaxDataValue)
nTickStep *= 2;
// We hardwire TITLE_DIVISOR y-axis ticks here for simplicity.
int nTickCount(nMaxDataValue / nTickStep);
double tickSpace = (double)m_nYAxisHeight * nTickStep / (double)nMaxDataValue;
// create tick label font and set it in the device context
CFont fontTickLabels;
VERIFY(fontTickLabels.CreatePointFont(m_nAxisTickLabelHeight, _T("Arial"), &dc));
VERIFY(dc.SelectObject(&fontTickLabels));
for (int nTick = 0; nTick < nTickCount; ++nTick)
{
int nTickYLocation = static_cast<int>(m_ptOrigin.y - tickSpace * (nTick + 1) + 0.5);
dc.MoveTo(m_ptOrigin.x - TICK_PIXELS, nTickYLocation);
VERIFY(dc.LineTo(m_ptOrigin.x + TICK_PIXELS, nTickYLocation));
// Draw tick label.
CString sTickLabel;
sTickLabel.Format(_T("%d"), nTickStep * (nTick+1));
CSize sizTickLabel(dc.GetTextExtent(sTickLabel));
//.........这里部分代码省略.........
示例5: InitPropList
void CPropertiesWnd::InitPropList()
{
SetPropListFont();
m_wndPropList.EnableHeaderCtrl(FALSE);
m_wndPropList.EnableDescriptionArea();
m_wndPropList.SetVSDotNetLook();
m_wndPropList.MarkModifiedProperties();
CMFCPropertyGridProperty* pGroup1 = new CMFCPropertyGridProperty(_T("Вид"));
pGroup1->AddSubItem(new CMFCPropertyGridProperty(_T("Трехмерный вид"), (_variant_t) false, _T("В окне используется обычный (не жирный) шрифт, а у элементов управления есть визуально трехмерная граница.")));
CMFCPropertyGridProperty* pProp = new CMFCPropertyGridProperty(_T("Граница"), _T("Диалоговое окно"), _T("Одно из значений: \"Нет\", \"Тонкая\", \"Изменяемая\" или \"Диалоговое окно\""));
pProp->AddOption(_T("Нет"));
pProp->AddOption(_T("Тонкая"));
pProp->AddOption(_T("Изменяемая"));
pProp->AddOption(_T("Диалоговое окно"));
pProp->AllowEdit(FALSE);
pGroup1->AddSubItem(pProp);
pGroup1->AddSubItem(new CMFCPropertyGridProperty(_T("Заголовок"), (_variant_t) _T("О программе"), _T("Указывает текст, который будет отображаться в строке заголовка окна")));
m_wndPropList.AddProperty(pGroup1);
CMFCPropertyGridProperty* pSize = new CMFCPropertyGridProperty(_T("Размер окна"), 0, TRUE);
pProp = new CMFCPropertyGridProperty(_T("Высота"), (_variant_t) 250l, _T("Указывает высоту окна"));
pProp->EnableSpinControl(TRUE, 50, 300);
pSize->AddSubItem(pProp);
pProp = new CMFCPropertyGridProperty( _T("Ширина"), (_variant_t) 150l, _T("Указывает ширину окна"));
pProp->EnableSpinControl(TRUE, 50, 200);
pSize->AddSubItem(pProp);
m_wndPropList.AddProperty(pSize);
CMFCPropertyGridProperty* pGroup2 = new CMFCPropertyGridProperty(_T("Шрифт"));
LOGFONT lf;
CFont* font = CFont::FromHandle((HFONT) GetStockObject(DEFAULT_GUI_FONT));
font->GetLogFont(&lf);
lstrcpy(lf.lfFaceName, _T("Arial"));
pGroup2->AddSubItem(new CMFCPropertyGridFontProperty(_T("Шрифт"), lf, CF_EFFECTS | CF_SCREENFONTS, _T("Указывает шрифт окна по умолчанию")));
pGroup2->AddSubItem(new CMFCPropertyGridProperty(_T("Использование системного шрифта"), (_variant_t) true, _T("Указывает, что в окне используется шрифт MS Shell Dlg")));
m_wndPropList.AddProperty(pGroup2);
CMFCPropertyGridProperty* pGroup3 = new CMFCPropertyGridProperty(_T("Разное"));
pProp = new CMFCPropertyGridProperty(_T("(Имя)"), _T("Приложение"));
pProp->Enable(FALSE);
pGroup3->AddSubItem(pProp);
CMFCPropertyGridColorProperty* pColorProp = new CMFCPropertyGridColorProperty(_T("Цвет окна"), RGB(210, 192, 254), NULL, _T("Указывает цвет окна по умолчанию"));
pColorProp->EnableOtherButton(_T("Другое..."));
pColorProp->EnableAutomaticButton(_T("По умолчанию"), ::GetSysColor(COLOR_3DFACE));
pGroup3->AddSubItem(pColorProp);
static const TCHAR szFilter[] = _T("Файлы значков(*.ico)|*.ico|Все файлы(*.*)|*.*||");
pGroup3->AddSubItem(new CMFCPropertyGridFileProperty(_T("Значок"), TRUE, _T(""), _T("ico"), 0, szFilter, _T("Указывает значок окна")));
pGroup3->AddSubItem(new CMFCPropertyGridFileProperty(_T("Папка"), _T("c:\\")));
m_wndPropList.AddProperty(pGroup3);
CMFCPropertyGridProperty* pGroup4 = new CMFCPropertyGridProperty(_T("Иерархия"));
CMFCPropertyGridProperty* pGroup41 = new CMFCPropertyGridProperty(_T("Первый подуровень"));
pGroup4->AddSubItem(pGroup41);
CMFCPropertyGridProperty* pGroup411 = new CMFCPropertyGridProperty(_T("Второй подуровень"));
pGroup41->AddSubItem(pGroup411);
pGroup411->AddSubItem(new CMFCPropertyGridProperty(_T("Элемент 1"), (_variant_t) _T("Значение 1"), _T("Это описание")));
pGroup411->AddSubItem(new CMFCPropertyGridProperty(_T("Элемент 2"), (_variant_t) _T("Значение 2"), _T("Это описание")));
pGroup411->AddSubItem(new CMFCPropertyGridProperty(_T("Элемент 3"), (_variant_t) _T("Значение 3"), _T("Это описание")));
pGroup4->Expand(FALSE);
m_wndPropList.AddProperty(pGroup4);
}
示例6: InitPropList
void CPropertiesWnd::InitPropList()
{
SetPropListFont();
m_wndPropList.EnableHeaderCtrl(FALSE);
m_wndPropList.EnableDescriptionArea();
m_wndPropList.SetVSDotNetLook();
m_wndPropList.MarkModifiedProperties();
CMFCPropertyGridProperty* pGroup1 = new CMFCPropertyGridProperty(_T("Appearance"));
pGroup1->AddSubItem(new CMFCPropertyGridProperty(_T("3D Look"), (_variant_t) false, _T("Specifies the window's font will be non-bold and controls will have a 3D border")));
CMFCPropertyGridProperty* pProp = new CMFCPropertyGridProperty(_T("Border"), _T("Dialog Frame"), _T("One of: None, Thin, Resizable, or Dialog Frame"));
pProp->AddOption(_T("None"));
pProp->AddOption(_T("Thin"));
pProp->AddOption(_T("Resizable"));
pProp->AddOption(_T("Dialog Frame"));
pProp->AllowEdit(FALSE);
pGroup1->AddSubItem(pProp);
pGroup1->AddSubItem(new CMFCPropertyGridProperty(_T("Caption"), (_variant_t) _T("About"), _T("Specifies the text that will be displayed in the window's title bar")));
m_wndPropList.AddProperty(pGroup1);
CMFCPropertyGridProperty* pSize = new CMFCPropertyGridProperty(_T("Window Size"), 0, TRUE);
pProp = new CMFCPropertyGridProperty(_T("Height"), (_variant_t) 250l, _T("Specifies the window's height"));
pProp->EnableSpinControl(TRUE, 50, 300);
pSize->AddSubItem(pProp);
pProp = new CMFCPropertyGridProperty( _T("Width"), (_variant_t) 150l, _T("Specifies the window's width"));
pProp->EnableSpinControl(TRUE, 50, 200);
pSize->AddSubItem(pProp);
m_wndPropList.AddProperty(pSize);
CMFCPropertyGridProperty* pGroup2 = new CMFCPropertyGridProperty(_T("Font"));
LOGFONT lf;
CFont* font = CFont::FromHandle((HFONT) GetStockObject(DEFAULT_GUI_FONT));
font->GetLogFont(&lf);
lstrcpy(lf.lfFaceName, _T("Arial"));
pGroup2->AddSubItem(new CMFCPropertyGridFontProperty(_T("Font"), lf, CF_EFFECTS | CF_SCREENFONTS, _T("Specifies the default font for the window")));
pGroup2->AddSubItem(new CMFCPropertyGridProperty(_T("Use System Font"), (_variant_t) true, _T("Specifies that the window uses MS Shell Dlg font")));
m_wndPropList.AddProperty(pGroup2);
CMFCPropertyGridProperty* pGroup3 = new CMFCPropertyGridProperty(_T("Misc"));
pProp = new CMFCPropertyGridProperty(_T("(Name)"), _T("Application"));
pProp->Enable(FALSE);
pGroup3->AddSubItem(pProp);
CMFCPropertyGridColorProperty* pColorProp = new CMFCPropertyGridColorProperty(_T("Window Color"), RGB(210, 192, 254), NULL, _T("Specifies the default window color"));
pColorProp->EnableOtherButton(_T("Other..."));
pColorProp->EnableAutomaticButton(_T("Default"), ::GetSysColor(COLOR_3DFACE));
pGroup3->AddSubItem(pColorProp);
static const TCHAR szFilter[] = _T("Icon Files(*.ico)|*.ico|All Files(*.*)|*.*||");
pGroup3->AddSubItem(new CMFCPropertyGridFileProperty(_T("Icon"), TRUE, _T(""), _T("ico"), 0, szFilter, _T("Specifies the window icon")));
pGroup3->AddSubItem(new CMFCPropertyGridFileProperty(_T("Folder"), _T("c:\\")));
m_wndPropList.AddProperty(pGroup3);
CMFCPropertyGridProperty* pGroup4 = new CMFCPropertyGridProperty(_T("Hierarchy"));
CMFCPropertyGridProperty* pGroup41 = new CMFCPropertyGridProperty(_T("First sub-level"));
pGroup4->AddSubItem(pGroup41);
CMFCPropertyGridProperty* pGroup411 = new CMFCPropertyGridProperty(_T("Second sub-level"));
pGroup41->AddSubItem(pGroup411);
pGroup411->AddSubItem(new CMFCPropertyGridProperty(_T("Item 1"), (_variant_t) _T("Value 1"), _T("This is a description")));
pGroup411->AddSubItem(new CMFCPropertyGridProperty(_T("Item 2"), (_variant_t) _T("Value 2"), _T("This is a description")));
pGroup411->AddSubItem(new CMFCPropertyGridProperty(_T("Item 3"), (_variant_t) _T("Value 3"), _T("This is a description")));
pGroup4->Expand(FALSE);
m_wndPropList.AddProperty(pGroup4);
}
示例7: DrawLegend
void MyGraph::DrawLegend(CDC& dc)
{
VALIDATE;
ASSERT_VALID(&dc);
// Create the legend font.
CFont fontLegend;
int pointFontHeight = max(m_rcGraph.Height() / LEGEND_DIVISOR, MIN_FONT_SIZE);
VERIFY(fontLegend.CreatePointFont(pointFontHeight, _T("Arial"), &dc));
// Get the height of each label.
LOGFONT lf;
::SecureZeroMemory(&lf, sizeof(lf));
VERIFY(fontLegend.GetLogFont(&lf));
int nLabelHeight(abs(lf.lfHeight));
// Get number of legend entries
int nLegendEntries = max(1, GetMaxSeriesSize());
// Calculate optimal label height = AvailableLegendHeight/AllAuthors
// Use a buffer of (GAP_PIXELS / 2) on each side inside the legend, and in addition the same
// gab above and below the legend frame, so in total 2*GAP_PIXELS
double optimalLabelHeight = double(m_rcGraph.Height() - 2*GAP_PIXELS)/nLegendEntries;
// Now relate the LabelHeight to the PointFontHeight
int optimalPointFontHeight = int(pointFontHeight*optimalLabelHeight/nLabelHeight);
// Limit the optimal PointFontHeight to the available range
optimalPointFontHeight = min( max(optimalPointFontHeight, MIN_FONT_SIZE), pointFontHeight);
// If the optimalPointFontHeight is different from the initial one, create a new legend font
if (optimalPointFontHeight != pointFontHeight) {
fontLegend.DeleteObject();
VERIFY(fontLegend.CreatePointFont(optimalPointFontHeight, _T("Arial"), &dc));
VERIFY(fontLegend.GetLogFont(&lf));
nLabelHeight = abs(lf.lfHeight);
}
// Calculate maximum number of authors that can be shown with the current label height
int nShownAuthors = (m_rcGraph.Height() - 2*GAP_PIXELS)/nLabelHeight - 1;
// Fix rounding errors.
if (nShownAuthors+1 == GetMaxSeriesSize())
++nShownAuthors;
// Get number of authors to be shown.
nShownAuthors = min(nShownAuthors, GetMaxSeriesSize());
// nShownAuthors contains now the number of authors
CFont* pFontOld = dc.SelectObject(&fontLegend);
ASSERT_VALID(pFontOld);
// Determine actual size of legend. A buffer of (GAP_PIXELS / 2) on each side,
// plus the height of each label based on the pint size of the font.
int nLegendHeight = (GAP_PIXELS / 2) + (nShownAuthors * nLabelHeight) + (GAP_PIXELS / 2);
// Draw the legend border. Allow LEGEND_COLOR_BAR_PIXELS pixels for
// display of label bars.
m_rcLegend.top = (m_rcGraph.Height() - nLegendHeight) / 2;
m_rcLegend.bottom = m_rcLegend.top + nLegendHeight;
m_rcLegend.right = m_rcGraph.Width() - GAP_PIXELS;
m_rcLegend.left = m_rcLegend.right - GetMaxLegendLabelLength(dc) -
LEGEND_COLOR_BAR_WIDTH_PIXELS;
VERIFY(dc.Rectangle(m_rcLegend));
int skipped_row = -1; // if != -1, this is the row that we show the ... in
if (nShownAuthors < GetMaxSeriesSize())
skipped_row = nShownAuthors-2;
// Draw each group's label and bar.
for (int nGroup = 0; nGroup < nShownAuthors; ++nGroup) {
int nLabelTop(m_rcLegend.top + (nGroup * nLabelHeight) +
(GAP_PIXELS / 2));
int nShownGroup = nGroup; // introduce helper variable to avoid code duplication
// Do we have a skipped row?
if (skipped_row != -1)
{
if (nGroup == skipped_row) {
// draw the dots
VERIFY(dc.TextOut(m_rcLegend.left + GAP_PIXELS, nLabelTop, _T("...") ));
continue;
}
if (nGroup == nShownAuthors-1) {
// we show the last group instead of the scheduled group
nShownGroup = GetMaxSeriesSize()-1;
}
}
// Draw the label.
VERIFY(dc.TextOut(m_rcLegend.left + GAP_PIXELS, nLabelTop,
m_saLegendLabels.GetAt(nShownGroup)));
// Determine the bar.
CRect rcBar;
rcBar.left = m_rcLegend.left + GAP_PIXELS + GetMaxLegendLabelLength(dc) + GAP_PIXELS;
rcBar.top = nLabelTop + LEGEND_COLOR_BAR_GAP_PIXELS;
rcBar.right = m_rcLegend.right - GAP_PIXELS;
rcBar.bottom = rcBar.top + nLabelHeight - LEGEND_COLOR_BAR_GAP_PIXELS;
VERIFY(dc.Rectangle(rcBar));
// Draw bar for group.
//.........这里部分代码省略.........
示例8: OnNMCustomDraw
void CToolTipCtrlX::OnNMCustomDraw(NMHDR *pNMHDR, LRESULT *pResult)
{
LPNMTTCUSTOMDRAW pNMCD = reinterpret_cast<LPNMTTCUSTOMDRAW>(pNMHDR);
if (pNMCD->nmcd.dwDrawStage == CDDS_PREPAINT)
{
CWnd* pwnd = CWnd::FromHandle(pNMCD->nmcd.hdr.hwndFrom);
CDC* pdc = CDC::FromHandle(pNMCD->nmcd.hdc);
CString strText;
pwnd->GetWindowText(strText);
CRect rcWnd;
pwnd->GetWindowRect(&rcWnd);
CRect rcBorder;
rcBorder.left = pNMCD->nmcd.rc.left - rcWnd.left;
rcBorder.top = pNMCD->nmcd.rc.top - rcWnd.top;
rcBorder.right = rcWnd.right - pNMCD->nmcd.rc.right;
rcBorder.bottom = rcWnd.bottom - pNMCD->nmcd.rc.bottom;
if (m_bCol1Bold && m_fontBold.m_hObject == NULL) {
CFont* pFont = pwnd->GetFont();
if (pFont) {
LOGFONT lf;
pFont->GetLogFont(&lf);
lf.lfWeight = FW_BOLD;
VERIFY( m_fontBold.CreateFontIndirect(&lf) );
}
}
int iTextHeight = 0;
int iMaxCol1Width = 0;
int iMaxCol2Width = 0;
int iMaxSingleLineWidth = 0;
CSize sizText(0);
int iPos = 0;
while (iPos != -1)
{
CString strLine = GetNextString(strText, _T('\n'), iPos);
int iColon = strLine.Find(_T(':'));
if (iColon != -1) {
CFont* pOldFont = m_bCol1Bold ? pdc->SelectObject(&m_fontBold) : NULL;
CSize siz = pdc->GetTextExtent(strLine, iColon + 1);
if (pOldFont)
pdc->SelectObject(pOldFont);
iMaxCol1Width = max(iMaxCol1Width, siz.cx);
iTextHeight = siz.cy; // update height with 'col1' string, because 'col2' string might be empty and therefore has no height
sizText.cy += siz.cy;
LPCTSTR pszCol2 = (LPCTSTR)strLine + iColon + 1;
while (_istspace(*pszCol2))
pszCol2++;
if (*pszCol2 != _T('\0')) {
siz = pdc->GetTextExtent(pszCol2, ((LPCTSTR)strLine + strLine.GetLength()) - pszCol2);
iMaxCol2Width = max(iMaxCol2Width, siz.cx);
}
}
else if (!strLine.IsEmpty()) {
CSize siz = pdc->GetTextExtent(strLine);
iMaxSingleLineWidth = max(iMaxSingleLineWidth, siz.cx);
sizText.cy += siz.cy;
}
else {
CSize siz = pdc->GetTextExtent(_T(" "), 1);
sizText.cy += siz.cy;
}
}
iMaxCol1Width = min(m_iScreenWidth4, iMaxCol1Width);
iMaxCol2Width = min(m_iScreenWidth4*2, iMaxCol2Width);
const int iMiddleMargin = 6;
iMaxSingleLineWidth = max(iMaxSingleLineWidth, iMaxCol1Width + iMiddleMargin + iMaxCol2Width);
sizText.cx = iMaxSingleLineWidth;
rcWnd.right = rcWnd.left + rcBorder.left + sizText.cx + rcBorder.right;
rcWnd.bottom = rcWnd.top + rcBorder.top + sizText.cy + rcBorder.bottom;
if (rcWnd.left >= m_rcScreen.left) {
if (rcWnd.right > m_rcScreen.right && rcWnd.Width() <= m_rcScreen.Width())
rcWnd.OffsetRect(-(rcWnd.right - m_rcScreen.right), 0);
}
if (rcWnd.top >= m_rcScreen.top) {
if (rcWnd.bottom > m_rcScreen.bottom && rcWnd.Height() <= m_rcScreen.Height())
rcWnd.OffsetRect(0, -(rcWnd.bottom - m_rcScreen.bottom));
}
pwnd->MoveWindow(&rcWnd);
pwnd->ScreenToClient(&rcWnd);
pdc->FillSolidRect(&rcWnd, m_crTooltipBkColor);
CPoint ptText(pNMCD->nmcd.rc.left, pNMCD->nmcd.rc.top);
iPos = 0;
while (iPos != -1)
{
CString strLine = GetNextString(strText, _T('\n'), iPos);
int iColon = strLine.Find(_T(':'));
if (iColon != -1) {
CRect rcDT(ptText.x, ptText.y, ptText.x + iMaxCol1Width, ptText.y + iTextHeight);
// don't draw empty <col1> strings (they are still handy to use for skipping the <col1> space)
if (iColon > 0) {
//.........这里部分代码省略.........
示例9: Draw
//.........这里部分代码省略.........
int left = r.left;
// Loop columns
for( int i = 0 ; i < max ; i++ )
{
CColumn* column = m_columns.GetAt( i );
CRect drawRect( left, top, r.right, top + lineHeight );
if( column )
{
// Get the data for this column
CString data;
tok.GetAt( i, data );
// Get the width of the column
int pixelWidth = CUnitConversion::InchesToPixels( column->GetWidth() );
if( pixelWidth == 0 )
pixelWidth = restWidth;
// Set font
CFont* font = fonts.GetAt( i );
CFont* specialFont = NULL;
if( font )
{
if( IsBold( data ) )
{
// Select a bold font
// here instead
specialFont = new CFont;
LOGFONT lf;
font->GetLogFont( &lf );
lf.lfWeight = FW_BOLD;
specialFont->CreateFontIndirect( &lf );
}
if( IsItalic( data ))
{
// Select an italic font
// here instead
specialFont = new CFont;
LOGFONT lf;
font->GetLogFont( &lf );
lf.lfItalic = TRUE;
specialFont->CreateFontIndirect( &lf );
}
}
if( specialFont )
dc->SelectObject( specialFont );
else if( font )
dc->SelectObject( font );
// Create draw rect
drawRect.SetRect( left, top, left + pixelWidth, top + lineHeight );
// Add offsets for columns
示例10: UpdateFonts
//.........这里部分代码省略.........
fontRegular.CreateFontIndirect(&lf);
// Create small font:
LONG lfHeightSaved = lf.lfHeight;
lf.lfHeight = (long)((1. + abs(lf.lfHeight)) * 2 / 3);
if (lfHeightSaved < 0)
{
lf.lfHeight = -lf.lfHeight;
}
fontSmall.CreateFontIndirect(&lf);
lf.lfHeight = lfHeightSaved;
// Create tooltip font:
NONCLIENTMETRICS ncm;
ncm.cbSize = sizeof(ncm);
GetNonClientMetrics (ncm);
lf.lfItalic = ncm.lfStatusFont.lfItalic;
lf.lfWeight = ncm.lfStatusFont.lfWeight;
fontTooltip.CreateFontIndirect(&lf);
lf.lfItalic = info.lfMenuFont.lfItalic;
lf.lfWeight = info.lfMenuFont.lfWeight;
// Create "underline" font:
lf.lfUnderline = TRUE;
fontUnderline.CreateFontIndirect(&lf);
lf.lfUnderline = FALSE;
// Create bold font:
lf.lfWeight = FW_BOLD;
fontBold.CreateFontIndirect(&lf);
// Create Marlett font:
BYTE bCharSet = lf.lfCharSet;
lf.lfWeight = info.lfMenuFont.lfWeight;
lf.lfCharSet = SYMBOL_CHARSET;
lf.lfWeight = 0;
lf.lfHeight = ::GetSystemMetrics(SM_CYMENUCHECK) - 1;
lstrcpy(lf.lfFaceName, AFX_FONT_NAME_MARLETT);
fontMarlett.CreateFontIndirect(&lf);
lf.lfCharSet = bCharSet; // Restore charset
// Create vertical font:
CFont font;
if (font.CreateStockObject(DEFAULT_GUI_FONT))
{
if (font.GetLogFont(&lf) != 0)
{
lf.lfOrientation = 900;
lf.lfEscapement = 2700;
lf.lfHeight = info.lfMenuFont.lfHeight;
lf.lfWeight = info.lfMenuFont.lfWeight;
lf.lfItalic = info.lfMenuFont.lfItalic;
{
lstrcpy(lf.lfFaceName, AFX_FONT_NAME_VERT);
}
fontVert.CreateFontIndirect(&lf);
lf.lfEscapement = 900;
fontVertCaption.CreateFontIndirect(&lf);
}
}
// Create dialog underline and bold fonts:
CFont* pDefaultGUIFont = CFont::FromHandle((HFONT) GetStockObject(DEFAULT_GUI_FONT));
ASSERT_VALID(pDefaultGUIFont);
pDefaultGUIFont->GetLogFont(&lf);
lf.lfUnderline = TRUE;
fontDefaultGUIUnderline.CreateFontIndirect(&lf);
lf.lfUnderline = FALSE;
lf.lfWeight = FW_BOLD;
fontDefaultGUIBold.CreateFontIndirect(&lf);
UpdateTextMetrics();
#if 0
// Notify toolbars about font changing:
for (POSITION posTlb = afxAllToolBars.GetHeadPosition(); posTlb != NULL;)
{
CMFCToolBar* pToolBar = (CMFCToolBar*) afxAllToolBars.GetNext(posTlb);
ENSURE(pToolBar != NULL);
if (CWnd::FromHandlePermanent(pToolBar->m_hWnd) != NULL)
{
ASSERT_VALID(pToolBar);
pToolBar->OnGlobalFontsChanged();
}
}
#endif
}
示例11: OnInitDialog
BOOL CDlgExtractSignature::OnInitDialog()
{
#ifndef _UNSTABLE
CDialog::OnInitDialog();
// TODO: Zusätzliche Initialisierung hier einfügen
LOGFONT LogFont;
char DefaultFontName[32];
LONG defaultFontWeight;
CFont *defaultFont = m_DefEditCtrl.GetFont();
defaultFont->GetLogFont( &LogFont ); // Default Systemschrift ermitteln
strncpy(DefaultFontName, LogFont.lfFaceName, 32); // Default Wert sichern
defaultFontWeight = LogFont.lfWeight; // Default Wert sichern
LogFont.lfWeight = FW_BOLD; // Auf Fettdruck umstellen
Font.CreateFontIndirect( &LogFont ); // Font initialisieren
m_TextMsgCtrl.SetFont(&Font);
m_TextSigCtrl.SetFont(&Font);
m_TextSignerCtrl.SetFont(&Font);
m_TextKeyCtrl.SetFont(&Font);
m_TextAlgCtrl.SetFont(&Font);
LogFont.lfWeight = defaultFontWeight; // Auf default Wert zurückstellen
strncpy(LogFont.lfFaceName, "Courier", 32); // Auf Courier umstellen
Font2.CreateFontIndirect( &LogFont ); // Font2 initialisieren
m_MessageCtrl.SetFont(&Font2);
m_SignatureCtrl.SetFont(&Font2);
//strncpy(LogFont.lfFaceName, DefaultFontStyle, 32);
LoadString(AfxGetInstanceHandle(),IDS_STRING_SIGNATURE,pc_str,STR_LAENGE_STRING_TABLE);
m_TextSig = (CString) pc_str;
LoadString(AfxGetInstanceHandle(),IDS_STRING_SIGNED_MESSAGE,pc_str,STR_LAENGE_STRING_TABLE);
m_TextMsg = (CString) pc_str;
LoadString(AfxGetInstanceHandle(),IDS_STRING_SIGNATURE_ORIGINATOR,pc_str,STR_LAENGE_STRING_TABLE);
m_TextSigner = (CString) pc_str;
LoadString(AfxGetInstanceHandle(),IDS_STRING_SIGNATURE_USED_KEY,pc_str,STR_LAENGE_STRING_TABLE);
m_TextKey = (CString) pc_str;
LoadString(AfxGetInstanceHandle(),IDS_STRING_SIGNATURE_METHOD,pc_str,STR_LAENGE_STRING_TABLE);
m_TextAlg = (CString) pc_str;
UpdateData(FALSE);
int err;
bool messagefromfile=false; // zeigt an, ob die signierte Nachricht aus einer Datei
// gelesen werden musste
CString filename;
CString SigAlg="";
CString HashAlg="";
CString UserKeyId="";
int SignLength; // (Aus dem Ausgabefenster eingelesene) Länge der Signatur in Bits
CKeyFile FileHandling;
SignatureType = GetSignData(inFileName,messagefromfile,filename,&message,SigAlg,HashAlg,UserKeyId,&SignLength,&Signatur,c,d);
// Folgende Speicherbereiche sind von GetSignData() alloziert worden und
// müssen später wieder freigegeben werden:
// message.octets (falls != NULL)
// Signatur.signature.bits (falls != NULL)
if ( (SignatureType > 0) && (SignatureType != EC_SIGN) &&\
(SignatureType != RSA_OR_DSA_SIGN) && (SignatureType != UNKNOWN_SIGN) )
{
// Fehler beim auslesen der Daten (Nicht genügend Speicher vorhanden)
Message(IDS_STRING_ERR_MEMORY_SIGNATURE_VERIFICATION, MB_ICONSTOP);
if (Signatur.signature.bits) free(Signatur.signature.bits);
if (message.octets) free(message.octets);
EndDialog(-1);
return TRUE;
}
else if ((SignatureType != EC_SIGN) && (SignatureType != RSA_OR_DSA_SIGN) &&\
(SignatureType != UNKNOWN_SIGN))
{
Message(IDS_STRING_ASYMKEY_COULD_NOT_EXTRACT_SIGNATURE,MB_ICONSTOP);
if (Signatur.signature.bits) free(Signatur.signature.bits);
if (message.octets) free(message.octets);
EndDialog(-2);
return TRUE;
}
if (messagefromfile == true)
{
// Die signierte Nachricht ist zu gross und passt nicht komplett
// in ein CEdit Feld. Es wird lediglich ein erster Teil der Nachricht dargestellt
LoadString(AfxGetInstanceHandle(),IDS_STRING_SIGNED_MESSAGE_FIRST_PART,pc_str,STR_LAENGE_STRING_TABLE);
m_TextMsg = (CString) pc_str;
}
// Überprüfe, ob angegebener Schlüsselbezeichner tatsächlich existiert
bool keyExists = FileHandling.FilenameExisting(UserKeyId);
char *name=NULL;
char *firstname=NULL;
char *keyType=NULL;
char *keyInfo=NULL;
char *creattime=NULL;
char *ctstr=NULL;
CString kInfo;
//.........这里部分代码省略.........
示例12: InitPropList
void CPropertiesWnd::InitPropList()
{
SetPropListFont();
m_wndPropList.EnableHeaderCtrl(FALSE);
m_wndPropList.EnableDescriptionArea();
m_wndPropList.SetVSDotNetLook();
m_wndPropList.MarkModifiedProperties();
CMFCPropertyGridProperty* pGroup1 = new CMFCPropertyGridProperty(_T("모양"));
pGroup1->AddSubItem(new CMFCPropertyGridProperty(_T("3D 모양"), (_variant_t) false, _T("창에 굵은 글꼴이 아닌 글꼴을 지정하고, 컨트롤에 3D 테두리를 지정합니다.")));
CMFCPropertyGridProperty* pProp = new CMFCPropertyGridProperty(_T("테두리"), _T("Dialog Frame"), _T("None, Thin, Resizable 또는 Dialog Frame 중 하나를 지정합니다."));
pProp->AddOption(_T("None"));
pProp->AddOption(_T("Thin"));
pProp->AddOption(_T("Resizable"));
pProp->AddOption(_T("Dialog Frame"));
pProp->AllowEdit(FALSE);
pGroup1->AddSubItem(pProp);
pGroup1->AddSubItem(new CMFCPropertyGridProperty(_T("캡션"), (_variant_t) _T("정보"), _T("창의 제목 표시줄에 표시되는 텍스트를 지정합니다.")));
m_wndPropList.AddProperty(pGroup1);
CMFCPropertyGridProperty* pSize = new CMFCPropertyGridProperty(_T("창 크기"), 0, TRUE);
pProp = new CMFCPropertyGridProperty(_T("높이"), (_variant_t) 250l, _T("창의 높이를 지정합니다."));
pProp->EnableSpinControl(TRUE, 50, 300);
pSize->AddSubItem(pProp);
pProp = new CMFCPropertyGridProperty( _T("너비"), (_variant_t) 150l, _T("창의 너비를 지정합니다."));
pProp->EnableSpinControl(TRUE, 50, 200);
pSize->AddSubItem(pProp);
m_wndPropList.AddProperty(pSize);
CMFCPropertyGridProperty* pGroup2 = new CMFCPropertyGridProperty(_T("글꼴"));
LOGFONT lf;
CFont* font = CFont::FromHandle((HFONT) GetStockObject(DEFAULT_GUI_FONT));
font->GetLogFont(&lf);
lstrcpy(lf.lfFaceName, _T("맑은 고딕"));
pGroup2->AddSubItem(new CMFCPropertyGridFontProperty(_T("글꼴"), lf, CF_EFFECTS | CF_SCREENFONTS, _T("창의 기본 글꼴을 지정합니다.")));
pGroup2->AddSubItem(new CMFCPropertyGridProperty(_T("시스템 글꼴을 사용합니다."), (_variant_t) true, _T("창에서 MS Shell Dlg 글꼴을 사용하도록 지정합니다.")));
m_wndPropList.AddProperty(pGroup2);
CMFCPropertyGridProperty* pGroup3 = new CMFCPropertyGridProperty(_T("기타"));
pProp = new CMFCPropertyGridProperty(_T("(이름)"), _T("응용 프로그램"));
pProp->Enable(FALSE);
pGroup3->AddSubItem(pProp);
CMFCPropertyGridColorProperty* pColorProp = new CMFCPropertyGridColorProperty(_T("창 색상"), RGB(210, 192, 254), NULL, _T("창의 기본 색상을 지정합니다."));
pColorProp->EnableOtherButton(_T("기타..."));
pColorProp->EnableAutomaticButton(_T("기본값"), ::GetSysColor(COLOR_3DFACE));
pGroup3->AddSubItem(pColorProp);
static TCHAR BASED_CODE szFilter[] = _T("아이콘 파일(*.ico)|*.ico|모든 파일(*.*)|*.*||");
pGroup3->AddSubItem(new CMFCPropertyGridFileProperty(_T("아이콘"), TRUE, _T(""), _T("ico"), 0, szFilter, _T("창 아이콘을 지정합니다.")));
pGroup3->AddSubItem(new CMFCPropertyGridFileProperty(_T("폴더"), _T("c:\\")));
m_wndPropList.AddProperty(pGroup3);
CMFCPropertyGridProperty* pGroup4 = new CMFCPropertyGridProperty(_T("계층"));
CMFCPropertyGridProperty* pGroup41 = new CMFCPropertyGridProperty(_T("첫번째 하위 수준"));
pGroup4->AddSubItem(pGroup41);
CMFCPropertyGridProperty* pGroup411 = new CMFCPropertyGridProperty(_T("두 번째 하위 수준"));
pGroup41->AddSubItem(pGroup411);
pGroup411->AddSubItem(new CMFCPropertyGridProperty(_T("항목 1"), (_variant_t) _T("값 1"), _T("설명입니다.")));
pGroup411->AddSubItem(new CMFCPropertyGridProperty(_T("항목 2"), (_variant_t) _T("값 2"), _T("설명입니다.")));
pGroup411->AddSubItem(new CMFCPropertyGridProperty(_T("항목 3"), (_variant_t) _T("값 3"), _T("설명입니다.")));
pGroup4->Expand(FALSE);
m_wndPropList.AddProperty(pGroup4);
}