From c39c6bce6d945bd0878d82a5eca4c39f15a09301 Mon Sep 17 00:00:00 2001 From: xj qian <qianxj15@sina.com> Date: 星期五, 13 九月 2024 11:21:24 +0800 Subject: [PATCH] update --- jrj/xframe/wobject/xwin.hpp | 43 ++++++++++++++++++++++++++++++++++++++++++- 1 files changed, 42 insertions(+), 1 deletions(-) diff --git a/jrj/xframe/wobject/xwin.hpp b/jrj/xframe/wobject/xwin.hpp index 83ebe7a..4afb28e 100644 --- a/jrj/xframe/wobject/xwin.hpp +++ b/jrj/xframe/wobject/xwin.hpp @@ -11,6 +11,7 @@ using kcontrol = Hxsoft::XFrame::IXFControl; using knode = Hxsoft::XFrame::IXNode; +#define export __declspec(dllexport) #define DeclWinObject_(ty,pty) class __declspec(dllexport) ty : public pty #define CreateWinObject_(ty,pty) \ public:\ @@ -67,7 +68,7 @@ return getKWin()->AttachEvent((LPTSTR)msg,*(Hxsoft::XFrame::FEvent*)&fnEvt,this); } - kcontrol* xcontrol(const wchar_t* ctrlname) + kcontrol* GetControl(const wchar_t* ctrlname) { return getKWin()->GetControl(ctrlname); } @@ -120,6 +121,11 @@ xnode SetAgentNode(xnode node,xnode val) { return xnode(getKWin()->SetAgentNodeContent((knode*)node.getNativePointer(), (knode*)val.getNativePointer())); + } + + Hxsoft::XFrame::IXPage* GetXPage() + { + return getKWin()->GetXPage(); } LPARAM GetWinParam() @@ -185,6 +191,41 @@ return -1; } + int openUrl(xstring aurl, LPARAM para) + { + KXMLDOMDocument x; + + xurl::get(GetServerUrl(), aurl, L"", x); + KXMLDOMNode n = x.selectSingleNode(L"//resource/@src"); + if (n) + { + string xq = n.text(); + OpenWindow(xq, (LPARAM)para); + return 1; + } + else + { + n = x.selectSingleNode(L"//resource[@vface!='' and @view!='']"); + if (n) + { + xstring vface = n.selectSingleNode(L"@vface").text(); + xstring view = n.selectSingleNode(L"@view").text(); + xstring config = n.selectSingleNode(L"@config").text(); + + if (vface == L"." || vface == L"") + { + string v = n.selectSingleNode(L"@url").text(); + xstring burl = xstring(aurl).mid(0, xstring(aurl).find(v, 0)); + return openUrl(burl + view, para); + } + else + return openUrl(vface + L"/" + view, para); + } + } + return -1; + } + + int CloseWindow() { return getKWin()->CloseWindow(); -- Gitblit v1.9.3