* @brief Constructor.
*/
CEditorFilePathBar::CEditorFilePathBar()
-: m_pFont(nullptr), m_nPanes(2)
+: m_nPanes(2)
{
}
NONCLIENTMETRICS ncm = { sizeof NONCLIENTMETRICS };
if (SystemParametersInfo(SPI_GETNONCLIENTMETRICS, sizeof NONCLIENTMETRICS, &ncm, 0))
- {
- m_pFont.reset(new CFont());
- if (m_pFont)
- m_pFont->CreateFontIndirect(&ncm.lfStatusFont);
- }
+ m_font.CreateFontIndirect(&ncm.lfStatusFont);
// subclass the two custom edit boxes
for (int pane = 0; pane < countof(m_Edit); pane++)
{
m_Edit[pane].SubClassEdit(IDC_STATIC_TITLE_PANE0 + pane, this);
- if (m_pFont)
- m_Edit[pane].SetFont(m_pFont.get());
+ m_Edit[pane].SetFont(&m_font);
m_Edit[pane].SetMargins(4, 4);
}
return TRUE;
{
TEXTMETRIC tm;
CClientDC dc(this);
- CFont *pOldFont = dc.SelectObject(m_pFont.get());
+ CFont *pOldFont = dc.SelectObject(&m_font);
dc.GetTextMetrics(&tm);
dc.SelectObject(pOldFont);
return CSize(SHRT_MAX, tm.tmHeight + 6);
*/
#pragma once
-#include <memory>
#include "FilepathEdit.h"
/**
private:
// this dialog uses custom edit boxes
CFilepathEdit m_Edit[3]; /**< Edit controls. */
- std::unique_ptr<CFont> m_pFont; /**< Font for editcontrols */
+ CFont m_font; /**< Font for editcontrols */
int m_nPanes;
};