edittoolbar.cpp

来自「很好的边缘检测源代码」· C++ 代码 · 共 50 行

CPP
50
字号
// EditToolBar.cpp : implementation file
//

#include "stdafx.h"
#include "ED256.h"
#include "EditToolBar.h"

#include <stdlib.h>

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

/////////////////////////////////////////////////////////////////////////////
// CEditToolBar

CEditToolBar::CEditToolBar()
{
}

CEditToolBar::~CEditToolBar()
{
}


BEGIN_MESSAGE_MAP(CEditToolBar, CToolBar)
	//{{AFX_MSG_MAP(CEditToolBar)
	ON_EN_CHANGE(ID_THRESHEDIT, ChangeThresh)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CEditToolBar message handlers

void CEditToolBar::ChangeThresh() {
	CString str;
	m_cEdit.GetWindowText(str);

	int thresh = atoi(str);
	if (thresh > 255) thresh = 255;
	if (thresh < 0) thresh = 0;
	
	// This function will get called before main window
	// is created, so check for that before sending msg.
	CWnd *mainwnd = AfxGetMainWnd();
	if (mainwnd) mainwnd->SendMessage(WM_USER+0x0001, (WPARAM)(thresh), NULL);
}

⌨️ 快捷键说明

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