|
楼主 |
发表于 2014-6-6 16:24:14
|
显示全部楼层
一. xcgui.h文件修改2处:
1. 在函数类型枚举中增加一个类型:- enum xcgui_fun_type //函数类型
- {
- ....
- xc_fun_v_e, //元素销毁
- xc_fun_b_e_pt,
- xc_fun_b_e_hdraw,
- xc_fun_b_e_i_pt,
- xc_fun_b_w,
- xc_fun_b_w_e,
- xc_fun_b_w_pt,
- xc_fun_b_w_i,
- xc_fun_b_w_i_pt,
- xc_fun_b_w_i_size,
- xc_fun_b_w_i_i,
- xc_fun_b_w_hdraw,
- xc_fun_b_w_hwnd,
- xc_fun_b_w_i_i_i, // 增加一个窗口消息过程函数类型
- ....
- }
复制代码 2. 在事件回调函数中增加一个分支:- static BOOL CALLBACK OnEventAndMsg(eventOrMsg_ *pEvent,xcgui_fun_type funType)//事件回调
- {
- xcgui_info_ *info=(xcgui_info_*)pEvent->pClass_fun;
- BOOL bResult=FALSE;
- switch(funType)
- {
- ....
- case xc_fun_b_w_i_i_i: // 增加一个窗口消息过程分支
- bResult=(info->theThis->*info->funs.fun_b_w_i_i_i)(pEvent->hWindow,pEvent->xint,pEvent->wParam,pEvent->lParam);
- break;
- ....
- }
- }
复制代码 二. xcapp.cpp中修改一处:
1. 在总窗口消息过程中更改一个循环:- LRESULT CALLBACK XCGUI_WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
- {
- ...
- // 把这段:
- /*windowProc_ *pFunT=pWindow->pWndProc;
- while(pFunT)
- {
- if(((pFunWndMsgProc)pFunT->pFun)((HWINDOW)pWindow,message,wParam,lParam))
- return 0;
- pFunT=pFunT->pNext;
- }*/
- //改为:
- windowProc_ *pFunT=pWindow->pWndProc;
- while(pFunT)
- {
- if(pFunT->pClass_Fun_Info)
- {
- eventOrMsg_ event_;
- event_.hWindow=(HWINDOW)pWindow;
- event_.hEventEle=NULL;
- event_.xint=message;
- event_.wParam=wParam;
- event_.lParam=lParam;
- event_.pClass_fun=pFunT->pClass_Fun_Info;
- if(((pFunClassEventMsg)pFunT->pFun)(&event_,xc_fun_b_w_i_i_i))
- return TRUE;
- }else if(((pFunWndMsgProc)pFunT->pFun)((HWINDOW)pWindow,message,wParam,lParam))
- return 0;
- pFunT=pFunT->pNext;
- }
- ...
- }
复制代码 //
完成 。
这是很明显一个错误哦,XCGUI的开发者是乱了呢,还是懒得理C++的支持? |
|