From 378d4b51e3112a3a27eabfd3aa97caec2bd5dafd Mon Sep 17 00:00:00 2001 From: LiFan <2308045698@qq.com> Date: 星期五, 05 七月 2024 17:17:50 +0800 Subject: [PATCH] update --- jrj/xframe/vbusiness/vframe/responsewin.vframe.vbusiness.hpp | 116 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 116 insertions(+), 0 deletions(-) diff --git a/jrj/xframe/vbusiness/vframe/responsewin.vframe.vbusiness.hpp b/jrj/xframe/vbusiness/vframe/responsewin.vframe.vbusiness.hpp index e69de29..7e20d9b 100644 --- a/jrj/xframe/vbusiness/vframe/responsewin.vframe.vbusiness.hpp +++ b/jrj/xframe/vbusiness/vframe/responsewin.vframe.vbusiness.hpp @@ -0,0 +1,116 @@ +#pragma once + +#include <wobject/xwin.hpp> +#include <wobject/xurl.hpp> +#include <wobject/xapp.hpp> +class responsewin : public xframe +{ +public: + 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