📄 layoutcolor.cpp
字号:
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
//
// Use of this sample source code is subject to the terms of the Microsoft
// license agreement under which you licensed this sample source code. If
// you did not accept the terms of the license agreement, you are not
// authorized to use this sample source code. For the terms of the license,
// please see the license agreement between you and Microsoft or, if applicable,
// see the LICENSE.RTF on your install media or the root of your tools installation.
// THE SAMPLE SOURCE CODE IS PROVIDED "AS IS", WITH NO WARRANTIES.
//
#include "LayoutColor.hpp"
#include "Common.hpp"
#include "NewResource.hpp"
const Layout_t::MetricsRCData_t* Layout_t::s_pMetrics = NULL;
HRESULT
Layout_t::InitializeRCData(
void
)
{
Layout_t::MetricsRCData_t* pMetrics;
HRESULT hr = CommonUtilities_t::InitializeRCDataHelper(
IDR_METRICS_DATA,
sizeof(Layout_t::MetricsRCData_t),
reinterpret_cast<void**>(&pMetrics)
);
s_pMetrics = pMetrics;
return hr;
}
#define HANDLE_METRIC(MetricName) \
int Layout_t::##MetricName(){\
return s_pMetrics->m_##MetricName;\
}
#define HANDLE_MARGINS(MetricName) \
int Layout_t::##MetricName##LeftMargin(){\
return s_pMetrics->m_##MetricName##Margins.m_LeftMargin;\
}\
int Layout_t::##MetricName##TopMargin(){\
return s_pMetrics->m_##MetricName##Margins.m_TopMargin;\
}\
int Layout_t::##MetricName##RightMargin(){\
return s_pMetrics->m_##MetricName##Margins.m_RightMargin;\
}\
int Layout_t::##MetricName##BottomMargin(){\
return s_pMetrics->m_##MetricName##Margins.m_BottomMargin;\
}
#define HANDLE_SIZE(MetricName) \
int Layout_t::##MetricName##Width() {\
return s_pMetrics->m_##MetricName##Size.m_Width; \
}\
int Layout_t::##MetricName##Height() {\
return s_pMetrics->m_##MetricName##Size.m_Height; \
}
#define HANDLE_ADJUSTMENT_MARGINS(MetricName) \
int Layout_t::##MetricName##AfterLabelMargin() {\
return s_pMetrics->m_##MetricName##AdjustmentMargins.m_AfterLabelMargin; \
}\
int Layout_t::##MetricName##RightMargin() {\
return s_pMetrics->m_##MetricName##AdjustmentMargins.m_RightMargin; \
}\
int Layout_t::##MetricName##TopMargin() {\
return s_pMetrics->m_##MetricName##AdjustmentMargins.m_TopMargin; \
}\
int Layout_t::##MetricName##BottomMargin() {\
return s_pMetrics->m_##MetricName##AdjustmentMargins.m_BottomMargin; \
}
HANDLE_METRIC(CallDurationWidth)
HANDLE_METRIC(CallControlLabelMarginWidth)
HANDLE_METRIC(TransferEditFromTop)
HANDLE_METRIC(CallItemHeight)
HANDLE_SIZE(CallGlyph)
HANDLE_MARGINS(CallText)
HANDLE_ADJUSTMENT_MARGINS(DialingState)
HANDLE_ADJUSTMENT_MARGINS(TransferringState)
const Colors_t::ColorsRCData_t* Colors_t::s_pColors = NULL;
HRESULT
Colors_t::InitializeRCData(
void
)
{
Colors_t::ColorsRCData_t* pColors;
HRESULT hr = CommonUtilities_t::InitializeRCDataHelper(
IDR_COLORS_DATA,
sizeof(Colors_t::ColorsRCData_t),
reinterpret_cast<void**>(&pColors)
);
s_pColors = pColors;
return hr;
}
#define HANDLE_COLOR(ColorName) \
int Colors_t::##ColorName(){\
return s_pColors->m_##ColorName;\
}
HANDLE_COLOR(TransferToLabelColor)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -