本文整理汇总了C++中CEditUI::GetTextColor方法的典型用法代码示例。如果您正苦于以下问题:C++ CEditUI::GetTextColor方法的具体用法?C++ CEditUI::GetTextColor怎么用?C++ CEditUI::GetTextColor使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CEditUI
的用法示例。
在下文中一共展示了CEditUI::GetTextColor方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: HandleMessage
LRESULT CEditWnd::HandleMessage(UINT uMsg, WPARAM wParam, LPARAM lParam)
{
LRESULT lRes = 0;
BOOL bHandled = TRUE;
if( uMsg == WM_KILLFOCUS ) lRes = OnKillFocus(uMsg, wParam, lParam, bHandled);
else if( uMsg == OCM_COMMAND ) {
if( GET_WM_COMMAND_CMD(wParam, lParam) == EN_CHANGE ) lRes = OnEditChanged(uMsg, wParam, lParam, bHandled);
else if( GET_WM_COMMAND_CMD(wParam, lParam) == EN_UPDATE ) {
RECT rcClient;
::GetClientRect(m_hWnd, &rcClient);
::InvalidateRect(m_hWnd, &rcClient, FALSE);
}
}
else if( uMsg == WM_KEYDOWN && TCHAR(wParam) == VK_RETURN ) {
m_pOwner->GetManager()->SendNotify(m_pOwner, _T("return"));
}
else if( uMsg == OCM__BASE + WM_CTLCOLOREDIT || uMsg == OCM__BASE + WM_CTLCOLORSTATIC ) {
if( m_pOwner->GetNativeEditBkColor() == 0xFFFFFFFF ) return NULL;
::SetBkMode((HDC)wParam, TRANSPARENT);
DWORD dwTextColor = m_pOwner->GetTextColor();
::SetTextColor((HDC)wParam, RGB(GetBValue(dwTextColor),GetGValue(dwTextColor),GetRValue(dwTextColor)));
if( m_hBkBrush == NULL ) {
DWORD clrColor = m_pOwner->GetNativeEditBkColor();
m_hBkBrush = ::CreateSolidBrush(RGB(GetBValue(clrColor), GetGValue(clrColor), GetRValue(clrColor)));
}
return (LRESULT)m_hBkBrush;
}
else if( uMsg == WM_CHAR && TCHAR(wParam) == VK_RETURN && (0 == (::GetWindowLong(m_hWnd,GWL_STYLE) & ES_MULTILINE)))
{
//È¥µô°´RETURN¼üʱ ßË ÉùÏì by rz.li 2013/01/10
}
else bHandled = FALSE;
if( !bHandled ) return CWindowWnd::HandleMessage(uMsg, wParam, lParam);
return lRes;
}
示例2: HandleMessage
LRESULT CEditWnd::HandleMessage(UINT uMsg, WPARAM wParam, LPARAM lParam)
{
LRESULT lRes = 0;
BOOL bHandled = TRUE;
if( uMsg == WM_CREATE ) {
if( m_pOwner->GetManager()->IsLayered() ) {
::SetTimer(m_hWnd, DEFAULT_TIMERID, ::GetCaretBlinkTime(), NULL);
}
bHandled = FALSE;
}
else if( uMsg == WM_KILLFOCUS ) lRes = OnKillFocus(uMsg, wParam, lParam, bHandled);
else if( uMsg == OCM_COMMAND ) {
if( GET_WM_COMMAND_CMD(wParam, lParam) == EN_CHANGE ) lRes = OnEditChanged(uMsg, wParam, lParam, bHandled);
else if( GET_WM_COMMAND_CMD(wParam, lParam) == EN_UPDATE ) {
RECT rcClient;
::GetClientRect(m_hWnd, &rcClient);
::InvalidateRect(m_hWnd, &rcClient, FALSE);
}
}
else if( uMsg == WM_KEYDOWN && TCHAR(wParam) == VK_RETURN ) {
m_pOwner->GetManager()->SendNotify(m_pOwner, DUI_MSGTYPE_RETURN);
}
else if( uMsg == OCM__BASE + WM_CTLCOLOREDIT || uMsg == OCM__BASE + WM_CTLCOLORSTATIC ) {
if (m_pOwner->GetManager()->IsLayered() && !m_pOwner->GetManager()->IsPainting()) {
m_pOwner->GetManager()->AddPaintChildWnd(m_hWnd);
}
if( m_pOwner->GetNativeEditBkColor() == 0xFFFFFFFF ) return NULL;
::SetBkMode((HDC)wParam, TRANSPARENT);
DWORD dwTextColor = m_pOwner->GetTextColor();
::SetTextColor((HDC)wParam, RGB(GetBValue(dwTextColor),GetGValue(dwTextColor),GetRValue(dwTextColor)));
if( m_hBkBrush == NULL ) {
DWORD clrColor = m_pOwner->GetNativeEditBkColor();
m_hBkBrush = ::CreateSolidBrush(RGB(GetBValue(clrColor), GetGValue(clrColor), GetRValue(clrColor)));
}
return (LRESULT)m_hBkBrush;
}
else if( uMsg == WM_PAINT) {
if (m_pOwner->GetManager()->IsLayered()) {
m_pOwner->GetManager()->AddPaintChildWnd(m_hWnd);
}
bHandled = FALSE;
}
else if( uMsg == WM_PRINT ) {
if (m_pOwner->GetManager()->IsLayered()) {
lRes = CWindowWnd::HandleMessage(uMsg, wParam, lParam);
if( m_pOwner->IsEnabled() && m_bDrawCaret ) { // todo:ÅжÏÊÇ·ñenabled
RECT rcClient;
::GetClientRect(m_hWnd, &rcClient);
POINT ptCaret;
::GetCaretPos(&ptCaret);
RECT rcCaret = { ptCaret.x, ptCaret.y, ptCaret.x, ptCaret.y+rcClient.bottom-rcClient.top };
CRenderEngine::DrawLine((HDC)wParam, rcCaret, 1, 0xFF000000);
}
return lRes;
}
bHandled = FALSE;
}
else if( uMsg == WM_TIMER ) {
if (wParam == DEFAULT_TIMERID) {
m_bDrawCaret = !m_bDrawCaret;
RECT rcClient;
::GetClientRect(m_hWnd, &rcClient);
::InvalidateRect(m_hWnd, &rcClient, FALSE);
return 0;
}
bHandled = FALSE;
}
else bHandled = FALSE;
if( !bHandled ) return CWindowWnd::HandleMessage(uMsg, wParam, lParam);
return lRes;
}