From 01ecca79b7c23d690ba21fb182dd1f56f2f182ed Mon Sep 17 00:00:00 2001 From: xj qian <qianxj15@sina.com> Date: 星期一, 01 七月 2024 16:07:53 +0800 Subject: [PATCH] update more --- jrj/xframe/vbusiness/vframe/responsewin.vframe.vbusiness.hpp | 106 ++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 files changed, 104 insertions(+), 2 deletions(-) diff --git a/jrj/xframe/vbusiness/vframe/responsewin.vframe.vbusiness.hpp b/jrj/xframe/vbusiness/vframe/responsewin.vframe.vbusiness.hpp index 0611dbe..7e20d9b 100644 --- a/jrj/xframe/vbusiness/vframe/responsewin.vframe.vbusiness.hpp +++ b/jrj/xframe/vbusiness/vframe/responsewin.vframe.vbusiness.hpp @@ -3,12 +3,114 @@ #include <wobject/xwin.hpp> #include <wobject/xurl.hpp> #include <wobject/xapp.hpp> -class responsewin : public xwin +class responsewin : public xframe { public: - responsewin(void* impl, HWND hWnd) :xwin(impl, hWnd) {} + responsewin(void* impl, HWND hWnd) :xframe(impl, hWnd) {} + virtual int SetAgent() + { + return 1; + } + + virtual int PreOnSetFocus() + { + //返回0——不在执行以下代码;返回其他——执行以下代码。 + return 1; + } + + //焦点激活处理函数 + int OnSetFocus(TEvent* evt, int p) + { + //重置工具条 + SetAgent(); + return 1; + } + + virtual int PreOnCmdDispatch(xstring comdid) + { + //返回0——不在执行以下代码;返回其他——执行以下代码。 + return 1; + } + + virtual int PostOnCmdDispatch(xstring comdid, int rtn) + { + return 1; + } + + int OnCmdDispatch(xstring comdid) + { + int rtn = 0; + if (PreOnCmdDispatch(comdid) == 0) + return 1; + + if (comdid.find(L"action:", 0) >= 0) + rtn = ProcessFlowAction(comdid, 1); + + if (PostOnCmdDispatch(comdid, rtn) != 1) + { + alert(L"error"); + return 1; + } + + return rtn; + } + + //命令处理事件 + int OnXCommand(TEvent* evt, int p) + { + /*xwin::SendMessage(sPHWND.toInt(),0x401,sAssortmentHwnd,0); + struct TEvent + { + int hWnd; //this.GetHWND().toString() + int message;//WM_XCOMMAND 0x401, evt.message.toString()是十进制1045 + int wParam; + int lParam;未使用 + int time; + xpoint pt; + }; + struct TXCommandEvent : public TEvent + { + native string pStrID; + };*/ + //string str = "ccc"+evt.wParam.toString(); + //alert(str); + return OnCmdDispatch(evt->xcommand.pStrID); + } + + int OnClose(TEvent* evt, int p) + { + + return 1; + } + + virtual int PostOnAttachEvent() + { + return 1; + } + + int OnAttachEvent() + { + //绑定工具条点击事件 + AttachEvent(L"WM_XCOMMAND", (FEvent)&responsewin::OnXCommand); + //获取焦点事件,用于重置工具条 + AttachEvent(L"WM_SETFOCUS", (FEvent)&responsewin::OnSetFocus); + //AttachEvent("WM_CLOSE",OnClose); + + PostOnAttachEvent(); + return 0; + } + + virtual int OnInit() + { + return 1; + } + int onload() { + SetAgent(); + OnAttachEvent(); + + OnInit(); return 1; } }; \ No newline at end of file -- Gitblit v1.9.3