| | |
| | | #include <xcontrol/xsedit.hpp> |
| | | #include <xcontrol/xcombobox.hpp> |
| | | #include <xcontrol/xreport.hpp> |
| | | #include "XDevEditPage.hpp" |
| | | |
| | | using xml = KXMLDOMDocument; |
| | | class export XDevEditXFile : public xwin |
| | | class export XDevEditXFile : public XDevEditPage |
| | | { |
| | | public: |
| | | XDevEditXFile(void* implPtr, HWND hWnd) :xwin(implPtr, hWnd) {} |
| | | XDevEditXFile(void* implPtr, HWND hWnd) :XDevEditPage(implPtr, hWnd) {} |
| | | public: |
| | | static XDevEditXFile* CreateInstance(void* implPtr, void* hWnd) |
| | | { |
| | |
| | | xml x; |
| | | if (!x.loadXML(content)) |
| | | { |
| | | KXMLDOMParseError pError = x.parseError; |
| | | KXMLDOMParseError pError = x.parseError(); |
| | | if (pError) |
| | | { |
| | | xstring str = pError.srcText(); |
| | |
| | | |
| | | //find project folder |
| | | xstring prjguid = L""; |
| | | int pitem = GetProjectItem(tv_folder,hItem); |
| | | HTREEITEM pitem = GetProjectItem(tv_folder,hItem); |
| | | if (pitem) |
| | | prjguid = ((KXMLDOMElement)tv_folder.GetItemData(pitem)).getAttribute(L"guid"); |
| | | |
| | |
| | | { |
| | | auto f = e.selectSingleNode(L"//*[@uri='" + name + L"']"); |
| | | if (f) { |
| | | xstring guid = KXMLDOMElement(f).selectSingleNode(L"@guid").text;//.getAttribute(L"guid"); |
| | | xstring guid = f.selectSingleNode(L"@guid").text();//.getAttribute(L"guid"); |
| | | if (guid == L"") |
| | | return ""; |
| | | return L""; |
| | | arg.AddArg(L"guid",guid); |
| | | } |
| | | else |
| | | return ""; |
| | | return L""; |
| | | } |
| | | KXMLDOMElement p = tv_folder.GetItemData(hP2Item); |
| | | xstring guid = p.getAttribute(L"guid"); |
| | |
| | | return L""; |
| | | } |
| | | |
| | | int OnDoubleClicked(ref TNotifyEvent evt,int param) |
| | | int OnDoubleClicked(TEvent* evt,LPARAM param) |
| | | { |
| | | ref DWNMHDR hdr = evt.pnmh; |
| | | DWNMHDR& hdr = *(DWNMHDR*)evt->notify.pnmh; |
| | | int row = hdr.row; |
| | | KXMLDOMElement e = xp.GetRowElement(row); |
| | | xstring filename = e.getAttribute(L"type"); |
| | |
| | | int OnAttachEvent() |
| | | { |
| | | //绑定工具条点击事件 |
| | | AttachEvent(L"WM_XCOMMAND",OnXCommand); |
| | | AttachEvent(L"WM_XCOMMAND",(FEvent)&XDevEditXFile::OnXCommand); |
| | | //获取焦点事件,用于重置工具条 |
| | | AttachEvent(L"WM_SETFOCUS",OnSetFocus); |
| | | AttachEvent(L"xreport",L"DWV_DOUBLECLICKED",OnDoubleClicked); |
| | | AttachEvent(L"WM_SETFOCUS", (FEvent)&XDevEditXFile::OnSetFocus); |
| | | AttachEvent(L"xreport",L"DWV_DOUBLECLICKED", (FEvent)&XDevEditXFile::OnDoubleClicked); |
| | | } |
| | | |
| | | int LoadData() |