From 3ae6fded83ac8ef5cec50b402ec046268329027f Mon Sep 17 00:00:00 2001 From: xj qian <qianxj15@sina.com> Date: 星期三, 17 七月 2024 20:56:30 +0800 Subject: [PATCH] update code --- jrj/xframe/wobject/xwin.hpp | 37 ++++++++++++++++++++++++++++++++++++- 1 files changed, 36 insertions(+), 1 deletions(-) diff --git a/jrj/xframe/wobject/xwin.hpp b/jrj/xframe/wobject/xwin.hpp index 618b738..15de5fc 100644 --- a/jrj/xframe/wobject/xwin.hpp +++ b/jrj/xframe/wobject/xwin.hpp @@ -16,7 +16,7 @@ public:\ ty(void* impl,HWND hWnd):pty(impl,hWnd){}\ public:\ - ty * CreateInstance(void* impl,void* hWnd)\ + static ty * CreateInstance(void* impl,void* hWnd)\ {\ return new ty(impl,(HWND)hWnd);\ } @@ -185,6 +185,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