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

📄 basicbut.cpp

📁 支持Windows 3.x、Windows 9x平台上的中文(GB、Big5)、日文(Shift JIS、EUC JIS)、韩文(KS C 5601)、HZ码的显示与输入,智能内码识别
💻 CPP
字号:
// basicbut.cpp : implementation file
//

#include "stdafx.h"
#include	"resource.h"
#include	"basicwin.h"
#include "basicbut.h"
#include	"systemse.h"
#include	"menubutt.h"
#include	"activebu.h"
#include	"cswin.h"    

#ifdef _DEBUG
#undef THIS_FILE
static char BASED_CODE THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// CBasicButton

CBasicButton::CBasicButton()
{
}

CBasicButton::~CBasicButton()
{
//	DestroyWindow() ;
}

//初始化按钮            initapplication
BOOL	CBasicButton::InitButton( 	LPCSTR 	lpcsName , 	//窗口名称
								const RECT &rect ,	//窗口大小
								CWnd 	*pParent ,	//父窗口
								UINT	uWinID )	//窗口ID
{
	//创建窗口
	if( !Create( NULL , lpcsName , WS_CHILD , 
			rect , pParent , uWinID ) ) 	//创建失败
		return	0 ;
					
	ShowWindow( SW_SHOWNOACTIVATE ) ;	//显示按钮
	return	1 ;
}

BEGIN_MESSAGE_MAP(CBasicButton, CBasicWin)
	//{{AFX_MSG_MAP(CBasicButton)
	ON_WM_RBUTTONDOWN()
	ON_WM_RBUTTONUP()
	ON_WM_MOUSEMOVE()
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CBasicButton message handlers

void CBasicButton::OnRButtonDown(UINT nFlags, CPoint point)
{
	// TODO: Add your message handler code here and/or call default
	CBasicWin::OnRButtonDown(nFlags, point);

	((CCsWin*)GetParent())->ButtonDown( this , point ) ;	//表示按钮按下了
}

void CBasicButton::OnRButtonUp(UINT nFlags, CPoint point)
{
	// TODO: Add your message handler code here and/or call default
	CBasicWin::OnRButtonUp(nFlags, point);

	((CCsWin*)GetParent())->ButtonUp() ;	//表示按钮松开了
}

void CBasicButton::OnMouseMove(UINT nFlags, CPoint point)
{
	// TODO: Add your message handler code here and/or call default
	((CCsWin*)GetParent())->MoveWindowToNewPos( this , point ) ;	//移动父窗口
	
	CBasicWin::OnMouseMove(nFlags, point);
}

⌨️ 快捷键说明

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