| | |
| | | use "xcontrol.vframe.vbusiness.vd" |
| | | use "xbase.vframe.vbusiness.vd" |
| | | use "base.view.vd" |
| | | unit trade |
| | | [ |
| | | class DocFileSaveDlg: public xframe |
| | | #include <wobject/xstring.hpp> |
| | | #include <xcontrol/xtreeview.hpp> |
| | | #include <xcontrol/xdwgrid.hpp> |
| | | #include <wobject/xdouble.hpp> |
| | | #include <xcontrol/xlayersheet.hpp> |
| | | #include <xcontrol/xdatetimepick.hpp> |
| | | |
| | | |
| | | #include "vbusiness/vframe/listwin.vframe.vbusiness.hpp" |
| | | #include "viewobject/view.base.hpp" |
| | | |
| | | using xml = KXMLDOMDocument; |
| | | class __declspec(dllexport) DocFileSaveDlg: public xframe |
| | | { |
| | | public: |
| | | xlistview lv_view; |
| | | xnode m_agentNode; //Agent Condition |
| | | int columnCount ; |
| | | |
| | | public: |
| | | DocFileSaveDlg(void* implPtr, HWND hWnd) :xframe(implPtr, hWnd) {} |
| | | public: |
| | | static DocFileSaveDlg* CreateInstance(void* implPtr, void* hWnd) |
| | | { |
| | | DocFileSaveDlg* pWin = new DocFileSaveDlg(implPtr, (HWND)hWnd); |
| | | return pWin; |
| | | } |
| | | //焦点激活处理函数 |
| | | int OnSetFocus(ref TEvent evt,int param) |
| | | int OnSetFocus(TEvent* evt, LPARAM param) |
| | | { |
| | | //重置工具条 |
| | | return 1; |
| | |
| | | |
| | | |
| | | //命令发布函数 |
| | | int OnCmdDispatch(string comdid) |
| | | int OnCmdDispatch(xstring comdid) |
| | | { |
| | | if(comdid=="xmOk") |
| | | if(comdid==L"xmOk") |
| | | { |
| | | string filename = GetControl("filename").GetText(); |
| | | if(filename=="") return 1; |
| | | xaserverarg arg = GetParam(); |
| | | xstring filename =xcontrol(GetControl(L"filename")).GetText(); |
| | | if(filename==L"") return 1; |
| | | xaserverarg arg = GetArg(); |
| | | if(!arg) return 1; |
| | | arg.AddArg("result","ok"); |
| | | arg.AddArg("filename",filename); |
| | | arg.AddArg(L"result",L"ok"); |
| | | arg.AddArg(L"filename",filename); |
| | | CloseWindow(); |
| | | return 1; |
| | | } |
| | | else if(comdid=="xmCancel") |
| | | else if(comdid==L"xmCancel") |
| | | { |
| | | CloseWindow(); |
| | | return 1; |
| | |
| | | } |
| | | |
| | | //命令处理事件 |
| | | int OnXCommand(ref TXCommandEvent evt,int param) |
| | | int OnXCommand(TEvent* evt, LPARAM param) |
| | | { |
| | | return OnCmdDispatch(evt.pStrID); |
| | | return OnCmdDispatch(evt->xcommand.pStrID); |
| | | } |
| | | |
| | | int OnAttachEvent() |
| | | { |
| | | //绑定工具条点击事件 |
| | | AttachEvent("WM_XCOMMAND",OnXCommand); |
| | | AttachEvent(L"WM_XCOMMAND", (FEvent)&DocFileSaveDlg::OnXCommand); |
| | | //获取焦点事件,用于重置工具条 |
| | | AttachEvent("WM_SETFOCUS",OnSetFocus); |
| | | AttachEvent(L"WM_SETFOCUS", (FEvent)&DocFileSaveDlg::OnSetFocus); |
| | | return 1; |
| | | } |
| | | |
| | | |
| | | int SetListViewHeaderColumn(string Url) |
| | | int SetListViewHeaderColumn(xstring Url) |
| | | { |
| | | const int LVCFMT_LEFT = 0; |
| | | for(int i=0;i<3;i++) lv_view.DeleteColumn(lv_view.GetId(),1); |
| | | lv_view.InsertColumn(lv_view.GetId(),0,"创建人员",LVCFMT_LEFT,80,0); |
| | | lv_view.InsertColumn(lv_view.GetId(),0,"创建日期",LVCFMT_LEFT,80,0); |
| | | lv_view.InsertColumn(lv_view.GetId(),0,"名称",0,120,0); |
| | | for(int i=0;i<3;i++) lv_view.DeleteColumn(1); |
| | | lv_view.InsertColumn(0,L"创建人员",LVCFMT_LEFT,80,0); |
| | | lv_view.InsertColumn(0,L"创建日期",LVCFMT_LEFT,80,0); |
| | | lv_view.InsertColumn(0,L"名称",0,120,0); |
| | | columnCount = 3; |
| | | return 1; |
| | | } |
| | | |
| | | int Retrieve(string src) |
| | | int Retrieve(xstring src) |
| | | { |
| | | xml x = ViewObject::RetrieveData("/sale/data/TDocument3/folder/list", "src",src); |
| | | xml x = ViewObject::RetrieveData(L"/sale/data/TDocument3/folder/list", L"src",src); |
| | | if(x) |
| | | { |
| | | msxml::IXMLDOMElement ele = x.GetXmlDoc().documentElement; |
| | | msxml::IXMLDOMNodeList nlist=ele.SelectNodes("*"); |
| | | int s=nlist.length; |
| | | KXMLDOMElement ele = x.documentElement(); |
| | | KXMLDOMNodeList nlist=ele.selectNodes(L"*"); |
| | | int s=nlist.length(); |
| | | if (s>0) |
| | | { |
| | | for (int i=0; i<s; i++) |
| | | { |
| | | msxml::IXMLDOMElement e=nlist.item(i); |
| | | string name=e.getAttribute("caption"); |
| | | int nItem = xlistview::InsertItemEx(lv_view.GetId(),0,name,23,cast(e as int)); |
| | | KXMLDOMElement e=nlist.item(i); |
| | | xstring name=e.getAttribute(L"caption"); |
| | | int nItem = lv_view.InsertItemEx(0,name,23,e); |
| | | |
| | | xlistview::SetItemText(lv_view.GetId(),nItem,1,e.getAttribute("Creator")); |
| | | xlistview::SetItemText(lv_view.GetId(),nItem,2,e.getAttribute("CreateDate")); |
| | | lv_view.SetItemText(nItem,1,e.getAttribute(L"Creator")); |
| | | lv_view.SetItemText(nItem,2,e.getAttribute(L"CreateDate")); |
| | | } |
| | | } |
| | | } |
| | |
| | | |
| | | int onload() |
| | | { |
| | | lv_view = GetControl("lv_view"); |
| | | //xlistview::SetdwStyle(lv_view.GetId(),0); |
| | | SetArg(); |
| | | lv_view = GetControl(L"lv_view"); |
| | | //lv_view.SetdwStyle(0); |
| | | |
| | | columnCount = 0; |
| | | SetListViewHeaderColumn(""); |
| | | SetListViewHeaderColumn(L""); |
| | | OnAttachEvent(); |
| | | |
| | | if(GetParam()) |
| | | if(GetWinParam()) |
| | | { |
| | | xaserverarg arg = GetParam(); |
| | | string src = arg.GetArgString("src"); |
| | | xaserverarg arg = GetArg(); |
| | | xstring src = arg.GetArgString(L"src"); |
| | | Retrieve(src); |
| | | } |
| | | |
| | |
| | | |
| | | return 1; |
| | | } |
| | | }; |
| | | ] |
| | | }; |