EditToolBar.cpp
上传用户:dfwb928
上传日期:2013-04-20
资源大小:228k
文件大小:1k
- // 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);
- }