#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(TEvent* evt, LPARAM param)
|
{
|
//ÖØÖù¤¾ßÌõ
|
return 1;
|
}
|
|
|
//ÃüÁî·¢²¼º¯Êý
|
int OnCmdDispatch(xstring comdid)
|
{
|
if(comdid==L"xmOk")
|
{
|
xstring filename =xcontrol(GetControl(L"filename")).GetText();
|
if(filename==L"") return 1;
|
xaserverarg arg = GetArg();
|
if(!arg) return 1;
|
arg.AddArg(L"result",L"ok");
|
arg.AddArg(L"filename",filename);
|
CloseWindow();
|
return 1;
|
}
|
else if(comdid==L"xmCancel")
|
{
|
CloseWindow();
|
return 1;
|
}
|
return 0;
|
}
|
|
//ÃüÁî´¦Àíʼþ
|
int OnXCommand(TEvent* evt, LPARAM param)
|
{
|
return OnCmdDispatch(evt->xcommand.pStrID);
|
}
|
|
int OnAttachEvent()
|
{
|
//°ó¶¨¹¤¾ßÌõµã»÷ʼþ
|
AttachEvent(L"WM_XCOMMAND", (FEvent)&DocFileSaveDlg::OnXCommand);
|
//»ñÈ¡½¹µãʼþ£¬ÓÃÓÚÖØÖù¤¾ßÌõ
|
AttachEvent(L"WM_SETFOCUS", (FEvent)&DocFileSaveDlg::OnSetFocus);
|
return 1;
|
}
|
|
|
int SetListViewHeaderColumn(xstring Url)
|
{
|
const int LVCFMT_LEFT = 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(xstring src)
|
{
|
xml x = ViewObject::RetrieveData(L"/sale/data/TDocument3/folder/list", L"src",src);
|
if(x)
|
{
|
KXMLDOMElement ele = x.documentElement();
|
KXMLDOMNodeList nlist=ele.selectNodes(L"*");
|
int s=nlist.length();
|
if (s>0)
|
{
|
for (int i=0; i<s; i++)
|
{
|
KXMLDOMElement e=nlist.item(i);
|
xstring name=e.getAttribute(L"caption");
|
int nItem = lv_view.InsertItemEx(0,name,23,e);
|
|
lv_view.SetItemText(nItem,1,e.getAttribute(L"Creator"));
|
lv_view.SetItemText(nItem,2,e.getAttribute(L"CreateDate"));
|
}
|
}
|
}
|
return 1;
|
}
|
|
int onload()
|
{
|
SetArg();
|
lv_view = GetControl(L"lv_view");
|
//lv_view.SetdwStyle(0);
|
|
columnCount = 0;
|
SetListViewHeaderColumn(L"");
|
OnAttachEvent();
|
|
if(GetWinParam())
|
{
|
xaserverarg arg = GetArg();
|
xstring src = arg.GetArgString(L"src");
|
Retrieve(src);
|
}
|
|
return 1;
|
}
|
|
int onloaded()
|
{
|
//SetAgent();
|
|
return 1;
|
}
|
};
|