#include #include #include #include #include #include #include #include #include #include "XDevEditPage.hpp" using xml = KXMLDOMDocument; class export dw_xwkdlg : public XDevEditPage { public: dw_xwkdlg(void* implPtr, HWND hWnd) :XDevEditPage(implPtr, hWnd) {} public: static dw_xwkdlg* CreateInstance(void* implPtr, void* hWnd) { dw_xwkdlg* pWin = new dw_xwkdlg(implPtr, (HWND)hWnd); return pWin; } private: // xtreeview tv_folder; public: //ÃüÁî·¢²¼º¯Êý int OnCmdDispatch(xstring comdid) { if (GetWinParam()) { SetArg(); xaserverarg arg = GetArg(); if (comdid == L"xmDevOk") { HTREEITEM hItem = tv_folder.GetSelectedItem(); if (!hItem) { MessageBox(0,L"ÇëÑ¡Ôñ¹¦ÄÜÄ£¿é!",L"",0); return 1; } KXMLDOMElement e = tv_folder.GetItemData(hItem); //xstring node = e.tagName(); xstring node = e.getAttribute(L"name"); if (node== L"file") { xstring caption = e.getAttribute(L"caption"); xstring guid = e.getAttribute(L"guid"); arg.AddArg(L"guid",L"" + guid); arg.AddArg(L"caption",L"" + caption); } else { MessageBox(0,L"ÇëÑ¡Ôñ¹¦ÄÜÄ£¿é!",L"",0); return 1; } } else { arg.AddArg(L"guid",L""); arg.AddArg(L"caption",L""); } } CloseWindow(); return 0; } //ÃüÁî´¦Àíʼþ int OnXCommand(TEvent* evt, LPARAM p) { return OnCmdDispatch(evt->xcommand.pStrID); } int OnAttachEvent() { //°ó¶¨¹¤¾ßÌõµã»÷ʼþ AttachEvent(L"WM_XCOMMAND", (FEvent)&dw_xwkdlg::OnXCommand); return 1; } int OnInitial() { OnAttachEvent(); return 1; } int onload() { SetArg(); tv_folder = GetControl(L"DevExplorer"); OnInitial(); if (GetWinParam()) alert(L"xxx"); return 1; } };