⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 mycolorpalettebar.cpp

📁 在编写图形程序
💻 CPP
字号:
// MyColorPaletteBar.cpp : implementation file
//

#include "stdafx.h"
#include "CustomTool.h"
#include "MyColorPaletteBar.h"
#include "mainfrm.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// CMyColorPaletteBar

CMyColorPaletteBar::CMyColorPaletteBar()
{
}

CMyColorPaletteBar::~CMyColorPaletteBar()
{
}


BEGIN_MESSAGE_MAP(CMyColorPaletteBar, CFOColorPaletteDialogBar)
	//{{AFX_MSG_MAP(CMyColorPaletteBar)
		// NOTE - the ClassWizard will add and remove mapping macros here.
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()


/////////////////////////////////////////////////////////////////////////////
// CMyColorPaletteBar message handlers
void CMyColorPaletteBar::OnUpdateCmdUI(CFrameWnd* /*pTarget*/, BOOL /*bDisableIfNoHndler*/)
{
	CFrameWnd *pParent = STATIC_DOWNCAST(CFrameWnd,AfxGetMainWnd());
	ASSERT_VALID(pParent);
	COLORREF crTemp;
	COLORREF crBack;
	COLORREF crLine;
	CFODrawView* pView = (CFODrawView*)(pParent->GetActiveFrame()->GetActiveView());
	if(pView != NULL)
	{
		if (pView->GetColorAndPositionAtCursor(crBack,crTemp,crLine))
		{
			SetColors(crLine,crBack);
		}
	}
}

void CMyColorPaletteBar::OnColorChange(COLORREF crColor,BOOL bLine)
{
	CFrameWnd *pParent = STATIC_DOWNCAST(CFrameWnd,AfxGetMainWnd());
	ASSERT_VALID(pParent);
	CFODrawView* pView = (CFODrawView*)(pParent->GetActiveFrame()->GetActiveView());
	if(pView != NULL)
	{
		FO_COLOR *m_color = new FO_COLOR;
		m_color->crText = m_crText;
		m_color->crBack = m_crBack;
		pView->SendMessage(WM_FO_COLORHASCHANGED,(WPARAM)m_color);
	}
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -