#include <wobject/xstring.hpp>
|
#include <xcontrol/xtreeview.hpp>
|
#include <xcontrol/xdwgrid.hpp>
|
|
#include "vbusiness/vframe/listwin.vframe.vbusiness.hpp"
|
#include "viewobject/view.base.hpp"
|
#include "vbusiness/vframe/frame.vframe.vbusiness.hpp"
|
|
|
using xml = KXMLDOMDocument;
|
class __declspec(dllexport) ViewTotalArgWin : public xframe
|
{
|
public:
|
xdwtable dw_arg;
|
xaserverarg arg;
|
xnode m_agentNode; //Agent Condition
|
public:
|
ViewTotalArgWin(void* implPtr, HWND hWnd) :xframe(implPtr, hWnd) {}
|
public:
|
static ViewTotalArgWin* CreateInstance(void* implPtr, void* hWnd)
|
{
|
ViewTotalArgWin* pWin = new ViewTotalArgWin(implPtr, (HWND)hWnd);
|
return pWin;
|
}
|
/*int SetAgent()
|
{
|
xstring xfNodeAgentArea = L"agentarea";
|
xnode anode = GetAgentNode(xfNodeAgentArea);
|
if(m_agentNode)
|
{
|
SetAgentNodeContent (anode,m_agentNode);
|
}
|
else
|
{
|
msxml::IXMLDOMElement xframeElement = GetElement();
|
msxml::IXMLDOMElement agent = xframeElement.selectSingleNode(L"agent/"+xfNodeAgentArea+L"[1]/*");
|
if(agent)
|
{
|
xstring s = agent.xml;
|
m_agentNode = SetAgentNodeContent (anode,s);
|
}
|
}
|
return 1;
|
}*/
|
|
//½¹µã¼¤»î´¦Àíº¯Êý
|
int OnSetFocus(TEvent * evt, int param)
|
{
|
//ÖØÖù¤¾ßÌõ
|
//SetAgent();
|
return 1;
|
}
|
|
//ÃüÁî·¢²¼º¯Êý
|
int OnCmdDispatch(xstring comdid)
|
{
|
if (comdid == L"xmOk")
|
{
|
xml x;
|
|
dw_arg.AcceptText();
|
dw_arg.DwUpdateAllTo(x);
|
//trace(L"--------" + x.xml());
|
arg.AddArg(L"arg", x.xml());
|
arg.AddArg(L"action", L"ok");
|
CloseWindow();
|
|
return 1;
|
}
|
else if (comdid == L"xmCancel")
|
{
|
arg.AddArg(L"action", L"cancel");
|
CloseWindow();
|
return 1;
|
}
|
return 0;
|
}
|
|
//ÃüÁî´¦Àíʼþ
|
int OnXCommand(TEvent* evt, int param)
|
{
|
return OnCmdDispatch(evt->xcommand.pStrID);
|
}
|
|
int OnAttachEvent()
|
{
|
//°ó¶¨¹¤¾ßÌõµã»÷ʼþ
|
AttachEvent(L"WM_XCOMMAND", (FEvent)&ViewTotalArgWin::OnXCommand);
|
//»ñÈ¡½¹µãʼþ£¬ÓÃÓÚÖØÖù¤¾ßÌõ
|
AttachEvent(L"WM_SETFOCUS", (FEvent)&ViewTotalArgWin::OnSetFocus);
|
return 1;
|
}
|
|
int onload()
|
{
|
SetArg();
|
dw_arg = GetControl(L"dw_arg");
|
|
if (GetWinParam())
|
{
|
arg = GetArg();
|
xstring dw = arg.GetArgString(L"argurl");
|
dw_arg.openUrl(dw);
|
|
dw_arg.SetColHeaderHeight(0);
|
dw_arg.SetRowSelectorWidth(0);
|
dw_arg.SetHScrollState(false);
|
dw_arg.SetVScrollState(false);
|
|
xstring d = arg.GetArgString(L"arg");
|
if (d != L"")
|
{
|
xml x ;
|
|
x.loadXML(d);
|
dw_arg.Retrieve(x);
|
}
|
}
|
dw_arg.SetEditUpperMode(true);
|
dw_arg.SetItemString(1, L"QuoteSuccess/type", L"ÊÇ");
|
dw_arg.SetItemString(1, L"ApprovalStatusName", L"6");
|
dw_arg.SetItemDisplayString(1, L"ApprovalStatusName", L"ÒÑÉóºË");
|
dw_arg.SetItemString(1, L"GDN.ETD/type", L"ÈÕÆÚ·¶Î§");
|
dw_arg.SetItemString(1, L"QuoteSuccess/type", L"ÊÇ");
|
|
OnAttachEvent();
|
|
return 1;
|
}
|
|
int onloaded()
|
{
|
//SetAgent();
|
|
return 1;
|
}
|
};
|