|
#pragma once
002#include "PngImage.h"003#include 004using namespace std;005enum BUTTON鼠标左键失灵怎样修复_STATE006{007BUTTON_ENABLE = 0,008BUTTON_HOVER = 1,009BU鼠标宏怎么设置TTON_CLICK = 2,010BUTTON_CHECK = 3,011BUTTON_DISABLE= 4,012}; //按钮状态013// PngButton.h014class ButtonCall鼠标右键快捷键back015{016鼠标宏怎么设置publ鼠标宏ic:017ButtonCallback(){};018virt鼠标右键不能用ual void callbackI事件查看器d(int id, WPARAM wParam = 0, LPARAM l鼠标宏Param = 0) =N鼠标右键ULL;按钮开关接线图019};020
021class PngButton022{023public:024PngBut事件暴露法治意识缺位ton(ButtonCallback* pbtnCallback);025virtual ~PngButton();026public:027INT GetWi事件研究法dt按钮英文h(){return m_nSliceWid鼠标左键按下去没反应th;};028INT GetHeight(){retur鼠标左键叫什么n m_nHeight;};029void SetButtonImage(LPCTSTR pszFileName,int picStateNum =5);030void Set鼠标左键双击变为打开属性ButtonImage(HINSTANCE hInstance, LPCTSTR pszResourceName,int picStateNum =5);031void DrawButton(CDC * pDC);032void OnLButtonUp(UINT nFlags, C事件脉络Point point);03按钮符号3void OnLButtonDown(UINT nFla鼠标宏怎么设置gs, CPoint point鼠标手);034void OnMouseHover(WPARAM wparam, LPARAM lparam);035void OnMouseLeave(WPARAM wparam,按钮的文字符号 LPARAM lparam);036
037void setButtonPos(int x,int y);038CPoint getButtonPos(){return m_Point;};039void setEnable(bool enable =鼠标右键菜单在左边true)鼠标垫{m_bEnable = enable;}040BOOL getEnable(){return m_bEnable;};041void setVisable(bool visable =true){ m_bVisable = visable;}事件脉络;042B鼠标宏OOL getVisable(){return m_bVisable;};043BUTTON_STATE getbuttonState(){return m_but鼠标tonState;};044void setbtnCheck(bool bc事件脉络heck =false);045vo鼠标左键失灵怎样修复id setBtnID(int id){m_buttonID = id;};046
047//鼠标移动事件048b鼠标dpi是什么ool按钮开关接线图 OnMouseMoveEvent(CPoint ClientPoint);049//鼠标左键事件050bool OnLMouseDownEvent按钮(CPoint ClientPoint);051//鼠标左键事件052事件研究法bool OnLMouseUpE鼠标哪个牌子好vent(CPoint ClientPoint);053//鼠标左键事件054boo事件营销l OnLMouseDoubleEvent(CPoint ClientPoint);055//鼠标右键事件056bool OnRMo鼠标左键失灵怎样修复useDownEvent(CPoint ClientPo事件暴露法治意识缺位int);057/按钮/鼠标右键事件058bool OnRMouseUpEvent(CPoint ClientPoint);059//鼠标右键事件060bool OnRMouseDoubleEven鼠标左键失灵怎样修复t(CPoint ClientPoint);061
062private:063BOOL m_bEnable; // 按钮是否禁用 064BOOL m_bCursorOnButton; // 鼠标是否在按钮上事件战法兑换表065B按钮开关OOL m_bPress; // 按钮是否被按下066BOOL m_bChecked; // checkbutton check状态067
068BOOL m_bV按钮开关接线方法isable;069int m_nWidth; //图片宽070int m_nHeight; //图片高071int m_st鼠标左键偶尔失灵怎么办atePicNum;072int m_nSliceWidth; //每一块图片的宽073CPngImage m_btnImage; //按钮图片074CRect m_rectButto按钮开关n; //按钮区域075CPoint m_Point;076ButtonCallb鼠标垫脏了怎么清理ack* m_鼠标手pbtn按钮开关接线图Callback;077BUTTON_S鼠标右键菜单怎么设置TATE m_buttonState;078int m_butt鼠标右键用键盘哪个代替onID;079
080};081
082typedef vector VpngBtn;083typedef vector::iterator VpngBtnItem;084class PngBtnManager085{086publ鼠标左键点一下就双击ic:087Png鼠标右键失灵怎么办BtnManager(){};088~PngBtnManage鼠标宏怎么设置r();089void addBtn(PngButton* btn);090void DrawBtn(CDC *pDc);091
092//鼠标移动事事件脉络件093bool OnMouseMoveEvent(CPoint ClientPoint);094//鼠标左键事件095bool On鼠标左键一直处于按着状态LMouseDownEvent(CPoint ClientPoint);096//鼠标左键事件097bool OnLMouseUpEvent(CPoint ClientPoint);098//鼠标左键事件099bool OnLMouseDoubleEvent(CPoint ClientPoint);100//鼠标右键事件101bool OnRMouseDow按钮开关nEvent(CPoint ClientPoint);102/鼠标左键失灵右键正常/鼠标右键事件103bool OnRMouseUpEvent(CPoint ClientPoint);104//鼠标右键事件105bool OnRMouseDoubleEvent按钮英文(CPoint ClientPoint);106private:107VpngBtn m_png事件视界btnManager;鼠标左键一直处于按着状态108};109
110可以鼠标左键不灵敏很方便的添加纯PNG按钮,不需要再用鼠标左键变成右键了属性到一个bmp背景啦。按钮图为5张png图片
|
|