class MaintTemplatePrintWin : public xframe
|
{
|
xcell cell;
|
xnode m_agentNode; //Agent Condition
|
string args;
|
|
int SetAgent()
|
{
|
string xfNodeAgentArea = "agentarea";
|
xnode anode = GetAgentNode(xfNodeAgentArea);
|
if(m_agentNode)
|
{
|
SetAgentNodeContent (anode,m_agentNode);
|
}
|
else
|
{
|
msxml::IXMLDOMElement xframeElement = GetElement();
|
msxml::IXMLDOMElement agent = xframeElement.selectSingleNode("agent/"+xfNodeAgentArea+"[1]/*");
|
if(agent)
|
{
|
string s = agent.xml;
|
m_agentNode = SetAgentNodeContent (anode,s);
|
}
|
}
|
return 1;
|
}
|
|
//½¹µã¼¤»î´¦Àíº¯Êý
|
int OnSetFocus(ref TEvent evt,int param)
|
{
|
//ÖØÖù¤¾ßÌõ
|
SetAgent();
|
return 1;
|
}
|
|
int SendCtrlCmd(xcontrol xc, string cmd)
|
{
|
win32::SendMessage(xc.GetId(),0x401,cmd,0);
|
return 1;
|
}
|
|
//ÃüÁî·¢²¼º¯Êý
|
int OnCmdDispatch(string comdid)
|
{
|
if(comdid.left(3) == "IK_")
|
{
|
string cmd = comdid.mid(3, comdid.length());
|
SendCtrlCmd(GetControl("cell"),cmd);
|
return 1;
|
}
|
else if(comdid=="xmFileOpen")
|
{
|
cell.OpenFile();
|
cell.Redraw();
|
return 1;
|
}
|
else if(comdid=="xmFileSave")
|
{
|
cell.SaveFile();
|
return 1;
|
}
|
else if(comdid=="xmFileSaveAs")
|
{
|
cell.SaveFileAs();
|
return 1;
|
}
|
return 0;
|
}
|
|
//ÃüÁî´¦Àíʼþ
|
int OnXCommand(ref TXCommandEvent evt,int param)
|
{
|
return OnCmdDispatch(evt.pStrID);
|
}
|
|
int OnAttachEvent()
|
{
|
//°ó¶¨¹¤¾ßÌõµã»÷ʼþ
|
AttachEvent("WM_XCOMMAND",OnXCommand);
|
//»ñÈ¡½¹µãʼþ£¬ÓÃÓÚÖØÖù¤¾ßÌõ
|
AttachEvent("WM_SETFOCUS",OnSetFocus);
|
}
|
|
int onload()
|
{
|
cell = GetControl("cell");
|
SetAgent();
|
|
OnAttachEvent();
|
|
if(GetParam())
|
{
|
args = GetParam();
|
cell.openUrl("/sale/data/SysPrintTemplate/getdevxsl",args);
|
}
|
else
|
args ="";
|
|
return 1;
|
}
|
|
int onloaded()
|
{
|
|
return 1;
|
}
|
};
|