| | |
| | | class MaintTemplatePrintWin : public xframe |
| | | #include <wobject/xstring.hpp> |
| | | #include <xcontrol/xtreeview.hpp> |
| | | #include <xcontrol/xdwgrid.hpp> |
| | | #include <xcontrol/xlayersheet.hpp> |
| | | |
| | | #include "vbusiness/vframe/maint.vframe.vbusiness.hpp" |
| | | #include "viewobject/view.base.hpp" |
| | | |
| | | using xml = KXMLDOMDocument; |
| | | |
| | | class __declspec(dllexport) MaintTemplatePrintWin : public xframe |
| | | { |
| | | public: |
| | | xcell cell; |
| | | xnode m_agentNode; //Agent Condition |
| | | string args; |
| | | |
| | | xstring args; |
| | | public: |
| | | MaintTemplatePrintWin(void* implPtr, HWND hWnd) :xframe(implPtr, hWnd) {} |
| | | public: |
| | | static MaintTemplatePrintWin* CreateInstance(void* implPtr, void* hWnd) |
| | | { |
| | | MaintTemplatePrintWin* pWin = new MaintTemplatePrintWin(implPtr, (HWND)hWnd); |
| | | return pWin; |
| | | } |
| | | int SetAgent() |
| | | { |
| | | string xfNodeAgentArea = L"agentarea"; |
| | | xstring xfNodeAgentArea = L"agentarea"; |
| | | xnode anode = GetAgentNode(xfNodeAgentArea); |
| | | if(m_agentNode) |
| | | { |
| | | SetAgentNodeContent (anode,m_agentNode); |
| | | SetAgentNode (anode,m_agentNode); |
| | | } |
| | | else |
| | | { |
| | | msxml::IXMLDOMElement xframeElement = GetElement(); |
| | | msxml::IXMLDOMElement agent = xframeElement.selectSingleNode(L"agent/"+xfNodeAgentArea+L"[1]/*"); |
| | | KXMLDOMElement xframeElement = GetElement(); |
| | | KXMLDOMElement agent = xframeElement.selectSingleNode(L"agent/"+xfNodeAgentArea+L"[1]/*"); |
| | | if(agent) |
| | | { |
| | | string s = agent.xml; |
| | | m_agentNode = SetAgentNodeContent (anode,s); |
| | | xstring s = agent.xml(); |
| | | m_agentNode = SetAgentNode (anode,s); |
| | | } |
| | | } |
| | | return 1; |
| | | } |
| | | |
| | | //焦点激活处理函数 |
| | | int OnSetFocus(ref TEvent evt,int param) |
| | | int OnSetFocus(TEvent* evt, LPARAM p) |
| | | { |
| | | //重置工具条 |
| | | SetAgent(); |
| | | return 1; |
| | | } |
| | | } |
| | | |
| | | int SendCtrlCmd(xcontrol xc, string cmd) |
| | | int SendCtrlCmd(xcontrol xc, xstring cmd) |
| | | { |
| | | win32::SendMessage(xc.GetId(),0x401,cmd,0); |
| | | return 1; |
| | | } |
| | | |
| | | //命令发布函数 |
| | | int OnCmdDispatch(string comdid) |
| | | int OnCmdDispatch(xstring comdid) |
| | | { |
| | | if(comdid.left(3) == L"IK_") |
| | | { |
| | | string cmd = comdid.mid(3, comdid.length()); |
| | | xstring cmd = comdid.mid(3, comdid.length()); |
| | | SendCtrlCmd(GetControl(L"cell"),cmd); |
| | | return 1; |
| | | } |
| | |
| | | } |
| | | |
| | | //命令处理事件 |
| | | int OnXCommand(ref TXCommandEvent evt,int param) |
| | | int OnXCommand(TEvent* evt, LPARAM p) |
| | | { |
| | | return OnCmdDispatch(evt.pStrID); |
| | | return OnCmdDispatch(evt->xcommand.pStrID); |
| | | } |
| | | |
| | | int OnAttachEvent() |
| | | { |
| | | //绑定工具条点击事件 |
| | | AttachEvent(L"WM_XCOMMAND",OnXCommand); |
| | | AttachEvent(L"WM_XCOMMAND", (FEvent)&MaintTemplatePrintWin::OnXCommand); |
| | | //获取焦点事件,用于重置工具条 |
| | | AttachEvent(L"WM_SETFOCUS",OnSetFocus); |
| | | AttachEvent(L"WM_SETFOCUS", (FEvent)&MaintTemplatePrintWin::OnSetFocus); |
| | | } |
| | | |
| | | int onload() |
| | |
| | | |
| | | OnAttachEvent(); |
| | | |
| | | if(GetParam()) |
| | | if(GetWinParam()) |
| | | { |
| | | args = GetParam(); |
| | | args = GetParamString(); |
| | | cell.openUrl(L"/sale/data/SysPrintTemplate/getdevxsl",args); |
| | | } |
| | | else |
| | |
| | | |
| | | return 1; |
| | | } |
| | | }; |
| | | |