From 50a37dbe8b73033a6295c9794c0f2f1b8db2b469 Mon Sep 17 00:00:00 2001
From: xj qian <qianxj15@sina.com>
Date: 星期五, 28 六月 2024 18:03:04 +0800
Subject: [PATCH] update check dlg
---
jrj/project/printview/Template.Print.Dialog.cpp | 276 ++++----
jrj/project/workflow/workflow.chkdlg_vd.cpp | 141 ++--
jrj/project/printview/Template.Print.ViewEx.cpp | 664 ++++++++++----------
jrj/project/workflow/workflow.actionlog_vd.cpp | 130 ++--
jrj/ext-jrj/ext-jrj.vcxproj | 12
jrj/xframe/xcontrol/xflowchart.hpp | 205 ++++++
jrj/project/printview/Maint.Template.PrintEx.cpp | 24
jrj/project/workflow/workflow.actionlog.cpp | 129 ++--
jrj/xframe/kobject/kflowchart.hpp | 110 +++
jrj/ext-jrj/ext-jrj.vcxproj.filters | 6
jrj/project/workflow/workflow.chkdlg.cpp | 135 ++--
11 files changed, 1,083 insertions(+), 749 deletions(-)
diff --git a/jrj/ext-jrj/ext-jrj.vcxproj b/jrj/ext-jrj/ext-jrj.vcxproj
index 6ba13da..4f8c5c6 100644
--- a/jrj/ext-jrj/ext-jrj.vcxproj
+++ b/jrj/ext-jrj/ext-jrj.vcxproj
@@ -126,7 +126,7 @@
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableUAC>false</EnableUAC>
- <AdditionalDependencies>xarch.shape.lib;xarch.base.lib;xarch.util.lib;xarch.network.lib;xarch.xframe.lib;xarch.xcontrol.lib;xoffice.xcell.lib;xoffice.xgrid.lib;xoffice.xreport.lib;shlwapi.lib;%(AdditionalDependencies);$(CoreLibraryDependencies)</AdditionalDependencies>
+ <AdditionalDependencies>xarch.shape.lib;xarch.base.lib;xarch.util.lib;xarch.network.lib;xarch.xframe.lib;xarch.xcontrol.lib;xoffice.xcell.lib;xoffice.xgrid.lib;xoffice.xreport.lib;shlwapi.lib;xoffice.xflow.lib;%(AdditionalDependencies);$(CoreLibraryDependencies)</AdditionalDependencies>
<AdditionalLibraryDirectories>D:\xclient64</AdditionalLibraryDirectories>
</Link>
<PostBuildEvent>
@@ -179,6 +179,7 @@
<ClInclude Include="..\xframe\kobject\kdwpages.hpp" />
<ClInclude Include="..\xframe\kobject\kdwtable.hpp" />
<ClInclude Include="..\xframe\kobject\kdwview.hpp" />
+ <ClInclude Include="..\xframe\kobject\kflowchart.hpp" />
<ClInclude Include="..\xframe\kobject\klayersheet.hpp" />
<ClInclude Include="..\xframe\kobject\knode.hpp" />
<ClInclude Include="..\xframe\kobject\kpage.hpp" />
@@ -223,6 +224,7 @@
<ClInclude Include="..\xframe\xcontrol\xdwgrid.hpp" />
<ClInclude Include="..\xframe\xcontrol\xdwpages.hpp" />
<ClInclude Include="..\xframe\xcontrol\xdwtable.hpp" />
+ <ClInclude Include="..\xframe\xcontrol\xflowchart.hpp" />
<ClInclude Include="..\xframe\xcontrol\xlayersheet.hpp" />
<ClInclude Include="..\xframe\xcontrol\xreport.hpp" />
<ClInclude Include="..\xframe\xcontrol\xshtml.hpp" />
@@ -349,19 +351,19 @@
<ClCompile Include="..\project\vindexmenu.cpp" />
<ClCompile Include="..\project\workflow\workflow.actionlog.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
- <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">false</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\project\workflow\workflow.actionlog_vd.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
- <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">false</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\project\workflow\workflow.chkdlg.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
- <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">false</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\project\workflow\workflow.chkdlg_vd.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
- <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">false</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\xframe\src\nmemory.cpp" />
<ClCompile Include="..\xframe\src\nstring.cpp" />
diff --git a/jrj/ext-jrj/ext-jrj.vcxproj.filters b/jrj/ext-jrj/ext-jrj.vcxproj.filters
index 536699b..3d1393c 100644
--- a/jrj/ext-jrj/ext-jrj.vcxproj.filters
+++ b/jrj/ext-jrj/ext-jrj.vcxproj.filters
@@ -282,6 +282,12 @@
<ClInclude Include="..\xframe\xcontrol\xcell.hpp">
<Filter>澶存枃浠�</Filter>
</ClInclude>
+ <ClInclude Include="..\xframe\xcontrol\xflowchart.hpp">
+ <Filter>xframe\xcontrol</Filter>
+ </ClInclude>
+ <ClInclude Include="..\xframe\kobject\kflowchart.hpp">
+ <Filter>xframe\kobject</Filter>
+ </ClInclude>
</ItemGroup>
<ItemGroup>
<ClCompile Include="dllmain.cpp">
diff --git a/jrj/project/printview/Maint.Template.PrintEx.cpp b/jrj/project/printview/Maint.Template.PrintEx.cpp
index 7ec0627..5a7291c 100644
--- a/jrj/project/printview/Maint.Template.PrintEx.cpp
+++ b/jrj/project/printview/Maint.Template.PrintEx.cpp
@@ -6,7 +6,7 @@
int SetAgent()
{
- string xfNodeAgentArea = "agentarea";
+ string xfNodeAgentArea = L"agentarea";
xnode anode = GetAgentNode(xfNodeAgentArea);
if(m_agentNode)
{
@@ -15,7 +15,7 @@
else
{
msxml::IXMLDOMElement xframeElement = GetElement();
- msxml::IXMLDOMElement agent = xframeElement.selectSingleNode("agent/"+xfNodeAgentArea+"[1]/*");
+ msxml::IXMLDOMElement agent = xframeElement.selectSingleNode(L"agent/"+xfNodeAgentArea+L"[1]/*");
if(agent)
{
string s = agent.xml;
@@ -42,24 +42,24 @@
//命令发布函数
int OnCmdDispatch(string comdid)
{
- if(comdid.left(3) == "IK_")
+ if(comdid.left(3) == L"IK_")
{
string cmd = comdid.mid(3, comdid.length());
- SendCtrlCmd(GetControl("cell"),cmd);
+ SendCtrlCmd(GetControl(L"cell"),cmd);
return 1;
}
- else if(comdid=="xmFileOpen")
+ else if(comdid==L"xmFileOpen")
{
cell.OpenFile();
cell.Redraw();
return 1;
}
- else if(comdid=="xmFileSave")
+ else if(comdid==L"xmFileSave")
{
cell.SaveFile();
return 1;
}
- else if(comdid=="xmFileSaveAs")
+ else if(comdid==L"xmFileSaveAs")
{
cell.SaveFileAs();
return 1;
@@ -76,14 +76,14 @@
int OnAttachEvent()
{
//绑定工具条点击事件
- AttachEvent("WM_XCOMMAND",OnXCommand);
+ AttachEvent(L"WM_XCOMMAND",OnXCommand);
//获取焦点事件,用于重置工具条
- AttachEvent("WM_SETFOCUS",OnSetFocus);
+ AttachEvent(L"WM_SETFOCUS",OnSetFocus);
}
int onload()
{
- cell = GetControl("cell");
+ cell = GetControl(L"cell");
SetAgent();
OnAttachEvent();
@@ -91,10 +91,10 @@
if(GetParam())
{
args = GetParam();
- cell.openUrl("/sale/data/SysPrintTemplate/getdevxsl",args);
+ cell.openUrl(L"/sale/data/SysPrintTemplate/getdevxsl",args);
}
else
- args ="";
+ args =L"";
return 1;
}
diff --git a/jrj/project/printview/Template.Print.Dialog.cpp b/jrj/project/printview/Template.Print.Dialog.cpp
index a243a8b..a2abeb4 100644
--- a/jrj/project/printview/Template.Print.Dialog.cpp
+++ b/jrj/project/printview/Template.Print.Dialog.cpp
@@ -14,7 +14,7 @@
int OnHtml()
{
- string s1="<catalog>"+
+ string s1=L"<catalog>"+
" <book id='bk101'>"+
" <author>Gambardella, Matthew</author>"+
" <title>XML Developer's Guide</title>"+
@@ -30,7 +30,7 @@
" <genre>Fantasy</genre>"+
" <price>5.95</price>"+
" <publish_date>2000-12-16</publish_date>"+
- " <description>A former architect battles corporate zombies, "+
+ " <description>A former architect battles corporate zombies, L"+
" an evil sorceress, and her own childhood to become queen "+
" of the world.</description>"+
" </book>"+
@@ -40,7 +40,7 @@
x.LoadXml(s1);
//trace(x.GetXml());
- //string s2="<?xml version='1.0'?>"+
+ //string s2=L"<?xml version='1.0'?>"+
string s2=
"<xsl:stylesheet version='1.0'"+
" xmlns:xsl='http://www.w3.org/1999/XSL/Transform' >"+
@@ -87,7 +87,7 @@
int OnRetrieve()
{
string username = publiccode::GetUser().name;
- if(username != "admin" && m_Dir != username )
+ if(username != L"admin" && m_Dir != username )
{
bupdate = false;
}else
@@ -98,10 +98,10 @@
x.setNativePointer(xml::CreateInstance());
xaserverarg arg = new xaserverarg;
arg.setNativePointer(arg.CreateInstance());
- arg.AddArg("Entity",m_EntityName);
- arg.AddArg("Dir",m_Dir);
+ arg.AddArg(L"Entity",m_EntityName);
+ arg.AddArg(L"Dir",m_Dir);
dw_list.Reset();
- if (url::get("/sale/data/SysPrintTemplate/listDialog",arg.GetString(),x) != 1)
+ if (url::get(L"/sale/data/SysPrintTemplate/listDialog",arg.GetString(),x) != 1)
{
trace(x.GetXmlDoc().text);
return -1;
@@ -119,7 +119,7 @@
int OnNewTempl()
{
- OpenWindow("dev:xpage[Maint.Template.Print.vx]");
+ OpenWindow(L"dev:xpage[Maint.Template.Print.vx]");
return 1;
}
@@ -128,20 +128,20 @@
int row = dw_list.GetRow();
if(row<0 || row>dw_list.GetRowCount())
{
- alert("请选择要维护的模板!");
+ alert(L"请选择要维护的模板!");
return 1;
}
else
{
msxml::IXMLDOMElement ele = dw_list.GetRowElement(row);
- string sguid = ele.selectSingleNode("ID").text;
- string sTemplName = ele.selectSingleNode("TemplName").text;
- //string sFile = m_filePath + sguid+".xsl";
- string sFile = m_filePath + ele.selectSingleNode("urlPath").text;
- arg_param.AddArg("xsl",sFile);
- arg_param.AddArg("return","cancel");
+ string sguid = ele.selectSingleNode(L"ID").text;
+ string sTemplName = ele.selectSingleNode(L"TemplName").text;
+ //string sFile = m_filePath + sguid+L".xsl";
+ string sFile = m_filePath + ele.selectSingleNode(L"urlPath").text;
+ arg_param.AddArg(L"xsl",sFile);
+ arg_param.AddArg(L"return",L"cancel");
- OpenWindow("dev:xpage[Maint.Template.Print.vx]",cast(arg_param.GetString() as int));
+ OpenWindow(L"dev:xpage[Maint.Template.Print.vx]",cast(arg_param.GetString() as int));
CloseWindow();
}
@@ -154,19 +154,19 @@
}
int OnAddTempl()
{
- if (m_Dir=="")
+ if (m_Dir==L"")
{
- alert("请选择模板目录!");
+ alert(L"请选择模板目录!");
return 0;
}
string sguid = publiccode::GetGuid();
- string sname= sguid +".xsl";
- string suri= "rpttemplate"+"\\"+m_EntityName; //rpttemplate\SO
- //suri = "supplier00";
- string ret = xaserver::UploadFile(suri, sname, this.GetHWND(),"",false);
- if (ret == "-1")
+ string sname= sguid +L".xsl";
+ string suri= L"rpttemplate"+L"\\"+m_EntityName; //rpttemplate\SO
+ //suri = L"supplier00";
+ string ret = xaserver::UploadFile(suri, sname, this.GetHWND(),L"",false);
+ if (ret == L"-1")
{
- alert("上传的文件没选择!");
+ alert(L"上传的文件没选择!");
return 1;
}
else
@@ -175,25 +175,25 @@
x.setNativePointer(xml::CreateInstance());
xaserverarg args = new xaserverarg;
args.setNativePointer(args.CreateInstance());
- args.AddArg("sID",sguid);
- args.AddArg("sEntity",m_EntityName);
- args.AddArg("sDir",m_Dir);
- args.AddArg("urlPath", sname);
+ args.AddArg(L"sID",sguid);
+ args.AddArg(L"sEntity",m_EntityName);
+ args.AddArg(L"sDir",m_Dir);
+ args.AddArg(L"urlPath", sname);
//alert(m_Dir);
- while(ret.find("\\",0)>=0)
- ret = ret.mid(ret.find("\\",0) + 1,9999);
+ while(ret.find(L"\\",0)>=0)
+ ret = ret.mid(ret.find(L"\\",0) + 1,9999);
- args.AddArg("sTemplName",ret);
+ args.AddArg(L"sTemplName",ret);
//trace(args.GetString());
- if (url::get("/sale/data/SysPrintTemplate/Save",args.GetString(),x) != 1)
+ if (url::get(L"/sale/data/SysPrintTemplate/Save",args.GetString(),x) != 1)
{
- trace("error:"+x.GetXml());
- alert("保存出错了!");
+ trace(L"error:"+x.GetXml());
+ alert(L"保存出错了!");
return 1;
}
else
{
- alert("上传模板成功!");
+ alert(L"上传模板成功!");
OnRetrieve();
}
}
@@ -206,29 +206,29 @@
int row = dw_list.GetRow();
if(row<0 || row>dw_list.GetRowCount())
{
- alert("请选择要删除的模板!");
+ alert(L"请选择要删除的模板!");
return 0;
}
else
{
- if (win32::MessageBox(GetHWND(),"确定要删除选中的模板?","提示",1) == 2)
+ if (win32::MessageBox(GetHWND(),L"确定要删除选中的模板?",L"提示",1) == 2)
return 0;
msxml::IXMLDOMElement ele = dw_list.GetRowElement(row);
- string sguid = ele.selectSingleNode("ID").text;
+ string sguid = ele.selectSingleNode(L"ID").text;
xml x=new xml;
x.setNativePointer(xml::CreateInstance());
xaserverarg args = new xaserverarg;
args.setNativePointer(args.CreateInstance());
- args.AddArg("sID",sguid);
- if (url::get("/sale/data/SysPrintTemplate/Delete",args.GetString(),x) != 1)
+ args.AddArg(L"sID",sguid);
+ if (url::get(L"/sale/data/SysPrintTemplate/Delete",args.GetString(),x) != 1)
{
- trace("error:"+x.GetXml());
- alert("删除出错了!");
+ trace(L"error:"+x.GetXml());
+ alert(L"删除出错了!");
return 0;
}
else
{
- alert("删除成功!");
+ alert(L"删除成功!");
OnRetrieve();
}
}
@@ -255,11 +255,11 @@
int OnOpenDocument()
{
if(dw_doclist.GetRowCount() < 1) return 1;
- string documentid = dw_doclist.GetRowElement(dw_doclist.GetRow()).getAttribute("guid");
+ string documentid = dw_doclist.GetRowElement(dw_doclist.GetRow()).getAttribute(L"guid");
//string billid = dw_docList
- arg_param.AddArg("DocumentID",documentid);
- arg_param.AddArg("return","ok");
- arg_param.AddArg("action","open");
+ arg_param.AddArg(L"DocumentID",documentid);
+ arg_param.AddArg(L"return",L"ok");
+ arg_param.AddArg(L"action",L"open");
CloseWindow();
return 1;
}
@@ -269,35 +269,35 @@
int row = dw_list.GetRow();
if(row<0 || row>dw_list.GetRowCount())
{
- alert("请选择要打印的模板!");
+ alert(L"请选择要打印的模板!");
return 1;
}
else
{
msxml::IXMLDOMElement ele = dw_list.GetRowElement(row);
- trace("\r\n---------------");
+ trace(L"\r\n---------------");
trace(ele.xml);
- string sguid = ele.selectSingleNode("ID").text;
- string pre = "";
- if(ele.selectSingleNode("TemplPre")) pre = ele.selectSingleNode("TemplPre").text;
- string sTemplName = ele.selectSingleNode("TemplName").text;
- //string sFile = m_filePath + sguid+".xsl";
+ string sguid = ele.selectSingleNode(L"ID").text;
+ string pre = L"";
+ if(ele.selectSingleNode(L"TemplPre")) pre = ele.selectSingleNode(L"TemplPre").text;
+ string sTemplName = ele.selectSingleNode(L"TemplName").text;
+ //string sFile = m_filePath + sguid+L".xsl";
trace(sTemplName);
- string sFile = m_filePath + ele.selectSingleNode("urlPath").text;
- arg_param.AddArg("xsl",sFile);
- arg_param.AddArg("return","ok");
- arg_param.AddArg("template-name",sTemplName);
- arg_param.AddArg("template-guid",sguid);
- arg_param.AddArg("template-pre",pre);
- arg_param.AddArg("action","new");
+ string sFile = m_filePath + ele.selectSingleNode(L"urlPath").text;
+ arg_param.AddArg(L"xsl",sFile);
+ arg_param.AddArg(L"return",L"ok");
+ arg_param.AddArg(L"template-name",sTemplName);
+ arg_param.AddArg(L"template-guid",sguid);
+ arg_param.AddArg(L"template-pre",pre);
+ arg_param.AddArg(L"action",L"new");
trace(arg_param.GetString());
CloseWindow();
- /*xaserver::CreateDirectory("C:/Temp");
- int openRet = xaserver::DownLoadFile(GetServerUrl(),m_filePath+file,sTemplName,"C:/Temp/"+sTemplName);
+ /*xaserver::CreateDirectory(L"C:/Temp");
+ int openRet = xaserver::DownLoadFile(GetServerUrl(),m_filePath+file,sTemplName,L"C:/Temp/"+sTemplName);
if(openRet < 0)
{
- alert("文件打开失败!");
+ alert(L"文件打开失败!");
return 0;
}
@@ -307,7 +307,7 @@
int FILE_SHARE_WRITE = 0x00000002;
int OPEN_EXISTING = 3;
int FILE_ATTRIBUTE_ARCHIVE =0x00000020;
- int hFile = xwin::CreateFile("C:/Temp/"+sTemplName,GENERIC_READ|GENERIC_WRITE,FILE_SHARE_READ|FILE_SHARE_WRITE,0,OPEN_EXISTING,0,0);
+ int hFile = xwin::CreateFile(L"C:/Temp/"+sTemplName,GENERIC_READ|GENERIC_WRITE,FILE_SHARE_READ|FILE_SHARE_WRITE,0,OPEN_EXISTING,0,0);
if (hFile >0)
{
//int GMEM_MOVEABLE=0x0002;
@@ -318,8 +318,8 @@
//int SizeReadWrite;
//xwin::ReadFile(hFile,pMemory,MEMSIZE - 1,SizeReadWrite,0);
int filesize = xwin::GetFileSize(hFile,0);
- trace("filesize = %d",filesize);
- string buffer = "".space(filesize+1);
+ trace(L"filesize = %d",filesize);
+ string buffer = L"".space(filesize+1);
int readsize = new int;
xwin::ReadFile(hFile,buffer,filesize,readsize,0);
trace(buffer);
@@ -327,10 +327,10 @@
//GlobalUnlock(pMemory);
//GlobalFree(hMemory);
} */
- /*openRet = xwin::ShellExecute(0,"open","C:/Temp/"+sTemplName,"","",5);
+ /*openRet = xwin::ShellExecute(0,L"open",L"C:/Temp/"+sTemplName,L"",L"",5);
if(openRet < 32)
{
- alert("文件打开失败2!");
+ alert(L"文件打开失败2!");
return 0;
}*/
}
@@ -346,18 +346,18 @@
xaserverarg arg = new xaserverarg;
arg.setNativePointer(xaserverarg::CreateInstance());
- arg.AddArg("content",x.GetXml());
+ arg.AddArg(L"content",x.GetXml());
- if (url::get("/sale/data/SysPrintTemplate/updateinfo",arg.GetString(),x) != 1)
+ if (url::get(L"/sale/data/SysPrintTemplate/updateinfo",arg.GetString(),x) != 1)
{
- trace("error:"+x.GetXml());
- alert("保存出错了!");
+ trace(L"error:"+x.GetXml());
+ alert(L"保存出错了!");
return 1;
}
else
{
dw_list.ResetUpdateStatus();
- alert("保存成功!");
+ alert(L"保存成功!");
}
return 1;
@@ -366,7 +366,7 @@
int PreOnCmdDispatch(string comdid)
{
//返回0——不在执行以下代码;返回其他——执行以下代码。
- if(comdid.left(8) == "xmPanel:"){
+ if(comdid.left(8) == L"xmPanel:"){
string no = comdid.mid(8, 99);
//int id = no.toInt();
@@ -375,24 +375,24 @@
x.LoadXml(strNode);
msxml::IXMLDOMDocument doc= x.GetXmlDoc();
msxml::IXMLDOMElement e = doc.documentElement;
- string slable =e.selectSingleNode("//xtoolbutton[@name='"+comdid+"']/@caption").text;
+ string slable =e.selectSingleNode(L"//xtoolbutton[@name='"+comdid+L"']/@caption").text;
m_Dir = slable;
OnRetrieve();
return 1;
}
- if (comdid=="xmAddDir") return OnAddDir();
- if (comdid=="xmAddTempl" && bupdate) return OnAddTempl();
- if (comdid=="xmDelTempl" && bupdate) return OnDelTempl();
- if (comdid=="xmMaintTempl" && bupdate) return OnMaintTempl();
- if (comdid=="xmNewTempl" && bupdate) return OnNewTempl();
- if (comdid=="xmHtml") return OnHtml();
- if (comdid=="xmOk") return OnOk();
- if (comdid=="xmSave") return OnSave();
- if(comdid=="xmOpen") return OnOpenDocument();
- else if (comdid=="xmCancel")
+ if (comdid==L"xmAddDir") return OnAddDir();
+ if (comdid==L"xmAddTempl" && bupdate) return OnAddTempl();
+ if (comdid==L"xmDelTempl" && bupdate) return OnDelTempl();
+ if (comdid==L"xmMaintTempl" && bupdate) return OnMaintTempl();
+ if (comdid==L"xmNewTempl" && bupdate) return OnNewTempl();
+ if (comdid==L"xmHtml") return OnHtml();
+ if (comdid==L"xmOk") return OnOk();
+ if (comdid==L"xmSave") return OnSave();
+ if(comdid==L"xmOpen") return OnOpenDocument();
+ else if (comdid==L"xmCancel")
{
- arg_param.AddArg("return","cancel");
+ arg_param.AddArg(L"return",L"cancel");
CloseWindow();
return 1;
}
@@ -402,13 +402,13 @@
int PostOnAttachEvent()
{
- //AttachEvent("dw_list","DWV_ROWFOCUSCHANGED",OnRowChanged);
- //AttachEvent("dw_list","DWV_CLICKED",OnClicked);
- //AttachEvent("dw_list","DWV_RCLICKED",OnRClicked);
- //AttachEvent("dw_list","DWV_ITEMCHANGED",OnItemChanged);
- //AttachEvent("dw_list","DWV_CHILDCONTENT",OnChildContent);
- AttachEvent("dw_doclist","DWV_DOUBLECLICKED",OnDocListDoubleClicked);
- AttachEvent("dw_list","DWV_DOUBLECLICKED",OnDoubleClicked);
+ //AttachEvent(L"dw_list",L"DWV_ROWFOCUSCHANGED",OnRowChanged);
+ //AttachEvent(L"dw_list",L"DWV_CLICKED",OnClicked);
+ //AttachEvent(L"dw_list",L"DWV_RCLICKED",OnRClicked);
+ //AttachEvent(L"dw_list",L"DWV_ITEMCHANGED",OnItemChanged);
+ //AttachEvent(L"dw_list",L"DWV_CHILDCONTENT",OnChildContent);
+ AttachEvent(L"dw_doclist",L"DWV_DOUBLECLICKED",OnDocListDoubleClicked);
+ AttachEvent(L"dw_list",L"DWV_DOUBLECLICKED",OnDoubleClicked);
return 1;
}
@@ -417,12 +417,12 @@
PUser puser = new PUser;
puser = publiccode::GetUser();
string susername = puser.name;
- if (susername !="admin")
+ if (susername !=L"admin")
{
- string xfNodeAgentArea = "DirButton";
+ string xfNodeAgentArea = L"DirButton";
xnode anode = GetAgentNode(xfNodeAgentArea);
msxml::IXMLDOMElement xframeElement = GetElement();
- string tools="<vbox name='DirButton' height='48' />";
+ string tools=L"<vbox name='DirButton' height='48' />";
SetAgentNodeContent(anode, tools);
}
return 1;
@@ -437,10 +437,10 @@
x.setNativePointer(xml::CreateInstance());
xaserverarg arg = new xaserverarg;
arg.setNativePointer(arg.CreateInstance());
- arg.AddArg("EntityName",m_EntityName,"");
- arg.AddArg("EntityID",m_EntityID,"");
- arg.AddArg("susername",susername,""); //
- if (url::get("/sale/data/SysPrintTemplate/Dir",arg.GetString(),x) != 1)
+ arg.AddArg(L"EntityName",m_EntityName,L"");
+ arg.AddArg(L"EntityID",m_EntityID,L"");
+ arg.AddArg(L"susername",susername,L""); //
+ if (url::get(L"/sale/data/SysPrintTemplate/Dir",arg.GetString(),x) != 1)
{
trace(x.GetXmlDoc().text);
return -1;
@@ -448,29 +448,29 @@
{
string s = x.GetXml();
}
- msxml::IXMLDOMNodeList nlist = x.GetXmlDoc().selectNodes("//Entity");
+ msxml::IXMLDOMNodeList nlist = x.GetXmlDoc().selectNodes(L"//Entity");
int i;
int nlen = nlist.length;
- string toolStr = "<vbox name='Dir'>";
+ string toolStr = L"<vbox name='Dir'>";
string deptName= publiccode::GetUser().deptname;
- if(deptName=="跟单部" && m_EntityName=="GDN3"){
+ if(deptName==L"跟单部" && m_EntityName==L"GDN3"){
for(i=2; i<nlen; i++)
{
msxml::IXMLDOMElement e1 = nlist.item(i);
- string sDir1 = e1.selectSingleNode("@Dir").text;
- string str1 = "<xtoolbutton image='15' caption='"+sDir1+"' height='24' name='xmPanel:"+i.toString()+"' style='background-color:none #ceecce none #ffffff'/>";
+ string sDir1 = e1.selectSingleNode(L"@Dir").text;
+ string str1 = L"<xtoolbutton image='15' caption='"+sDir1+L"' height='24' name='xmPanel:"+i.toString()+L"' style='background-color:none #ceecce none #ffffff'/>";
toolStr += str1;
if (i==2)
m_Dir = sDir1;
}
- }else if(deptName.find("业务")>=0 && m_EntityName=="GDN3" )
+ }else if(deptName.find(L"业务")>=0 && m_EntityName==L"GDN3" )
{
for(i=1; i<2; i++)
{
msxml::IXMLDOMElement e2 = nlist.item(i);
- string sDir2 = e2.selectSingleNode("@Dir").text;
- string str2 = "<xtoolbutton image='15' caption='"+sDir2+"' height='24' name='xmPanel:"+i.toString()+"' style='background-color:none #ceecce none #ffffff'/>";
+ string sDir2 = e2.selectSingleNode(L"@Dir").text;
+ string str2 = L"<xtoolbutton image='15' caption='"+sDir2+L"' height='24' name='xmPanel:"+i.toString()+L"' style='background-color:none #ceecce none #ffffff'/>";
toolStr += str2;
if (i==1)
@@ -479,8 +479,8 @@
for(i=4; i<nlen; i++)
{
msxml::IXMLDOMElement e3 = nlist.item(i);
- string sDir3 = e3.selectSingleNode("@Dir").text;
- string str3 = "<xtoolbutton image='15' caption='"+sDir3+"' height='24' name='xmPanel:"+i.toString()+"' style='background-color:none #ceecce none #ffffff'/>";
+ string sDir3 = e3.selectSingleNode(L"@Dir").text;
+ string str3 = L"<xtoolbutton image='15' caption='"+sDir3+L"' height='24' name='xmPanel:"+i.toString()+L"' style='background-color:none #ceecce none #ffffff'/>";
toolStr += str3;
}
@@ -488,8 +488,8 @@
for(i=0; i<nlen; i++)
{
msxml::IXMLDOMElement e = nlist.item(i);
- string sDir = e.selectSingleNode("@Dir").text;
- string str = "<xtoolbutton image='15' caption='"+sDir+"' height='24' name='xmPanel:"+i.toString()+"' style='background-color:none #ceecce none #ffffff'/>";
+ string sDir = e.selectSingleNode(L"@Dir").text;
+ string str = L"<xtoolbutton image='15' caption='"+sDir+L"' height='24' name='xmPanel:"+i.toString()+L"' style='background-color:none #ceecce none #ffffff'/>";
toolStr += str;
if (i==0)
@@ -497,10 +497,10 @@
}
}
- toolStr += "</vbox>";
+ toolStr += L"</vbox>";
strNode = toolStr;
//trace(toolStr);
- xnode anode = GetAgentNode("Dir");
+ xnode anode = GetAgentNode(L"Dir");
xwin::SetAgentNodeContent(anode,toolStr) ;
OnRetrieve();
@@ -510,35 +510,35 @@
int OnInit()
{
SetAgent();
- dw_list = this.GetControl("dw_list");
- dw_list.openUrl("/sale/view/view.base/template/PrintView/listDialog");
+ dw_list = this.GetControl(L"dw_list");
+ dw_list.openUrl(L"/sale/view/view.base/template/PrintView/listDialog");
dw_list.SetReadOnly(true);
dw_list.SetSelectionMode(4);
- dw_list.SetColumnState("ID",false);
+ dw_list.SetColumnState(L"ID",false);
- dw_doclist = GetControl("dw_doclist");
- dw_doclist.openUrl("/sale/view/GDN/template/doclist");
+ dw_doclist = GetControl(L"dw_doclist");
+ dw_doclist.openUrl(L"/sale/view/GDN/template/doclist");
string sUrl = GetServerUrl();
sUrl = sUrl.mid(0, sUrl.length() - 19);
- m_filePath = "/business/rpttemplate";
+ m_filePath = L"/business/rpttemplate";
arg_param = new xaserverarg;
if (GetParam())
{
int p = GetParam();
arg_param.setNativePointer(p);
- m_EntityName = arg_param.GetArgString("EntityName");
- m_EntityID = arg_param.GetArgString("EntityID");
- m_EntityNo = arg_param.GetArgString("EntityNo");
+ m_EntityName = arg_param.GetArgString(L"EntityName");
+ m_EntityID = arg_param.GetArgString(L"EntityID");
+ m_EntityNo = arg_param.GetArgString(L"EntityNo");
xaserverarg arg = new xaserverarg;
arg.setNativePointer(xaserverarg::CreateInstance());
- arg.AddArg("EntityName", m_EntityName);
- arg.AddArg("EntityID", m_EntityID);
- arg.AddArg("EntityNo", m_EntityNo);
+ arg.AddArg(L"EntityName", m_EntityName);
+ arg.AddArg(L"EntityID", m_EntityID);
+ arg.AddArg(L"EntityNo", m_EntityNo);
xml x =new xml;
x.setNativePointer(xml::CreateInstance());
- if(url::get("/sale/data/DocumentList3/bill/doclist", arg.GetString(),x)!=1)
+ if(url::get(L"/sale/data/DocumentList3/bill/doclist", arg.GetString(),x)!=1)
{
string error = x.GetXmlDoc().text;
trace(error);
@@ -551,12 +551,12 @@
else
{
arg_param.setNativePointer(arg_param.CreateInstance());
- m_EntityName = "SO";
- m_EntityID ="00000000-0000-0000-0000-000000000000";
+ m_EntityName = L"SO";
+ m_EntityID =L"00000000-0000-0000-0000-000000000000";
}
- m_Dir = "";
- m_filePath = m_filePath + "/" + m_EntityName+"/";
+ m_Dir = L"";
+ m_filePath = m_filePath + L"/" + m_EntityName+L"/";
//trace(m_filePath);
CreateDir();
@@ -570,9 +570,9 @@
/*if (GetParam())
{
- string action = arg_param.GetArgString("action");
- if(action=="open" || (action=="" && dw_doclist.GetRowCount() > 0))
- SwitchLayer("sheet2","frame");
+ string action = arg_param.GetArgString(L"action");
+ if(action==L"open" || (action==L"" && dw_doclist.GetRowCount() > 0))
+ SwitchLayer(L"sheet2",L"frame");
}
*/
@@ -585,9 +585,9 @@
/*if (GetParam())
{
- string action = arg_param.GetArgString("action");
- if(action=="open" || (action=="" && dw_doclist.GetRowCount() > 0))
- SwitchLayer("sheet2","frame");
+ string action = arg_param.GetArgString(L"action");
+ if(action==L"open" || (action==L"" && dw_doclist.GetRowCount() > 0))
+ SwitchLayer(L"sheet2",L"frame");
}
*/
return 1;
diff --git a/jrj/project/printview/Template.Print.ViewEx.cpp b/jrj/project/printview/Template.Print.ViewEx.cpp
index da0560a..33c4d29 100644
--- a/jrj/project/printview/Template.Print.ViewEx.cpp
+++ b/jrj/project/printview/Template.Print.ViewEx.cpp
@@ -78,7 +78,7 @@
string GetModulePath()
{
- string str ="";
+ string str =L"";
str = str.space(255);
GetModuleFileName(0,str,250);
PathRemoveFileSpec(str);
@@ -86,11 +86,11 @@
}
string GetModuleTmpPath()
{
- string str ="";
+ string str =L"";
str = str.space(255);
GetModuleFileName(0,str,250);
PathRemoveFileSpec(str);
- string tmp = str + "\\Temp";
+ string tmp = str + L"\\Temp";
xaserver::CreateDirectory(tmp);
return tmp;
}
@@ -102,7 +102,7 @@
szFileName[0] = 0;
szPath[0] = 0;
- if(initFileName !="")
+ if(initFileName !=L"")
{
int len = initFileName.length();
char[] tmp = initFileName;
@@ -128,7 +128,7 @@
ofn.nMaxFile = 255;
ofn.lpstrFileTitle = szFileName;
ofn.nMaxFileTitle = 255;
- ofn.lpstrTitle = "请指定文件名";
+ ofn.lpstrTitle = L"请指定文件名";
ofn.lpstrDefExt = ext;
//"jpg";
ofn.lpstrInitialDir = 0;
@@ -152,58 +152,58 @@
int OnExport()
{
string pre = billPre;
- if(pre=="")
+ if(pre==L"")
{
pre = m_EntityName;
- if(m_EntityName=="SaleOrder") pre="PI";
- if(m_EntityName=="GDN3")pre="INV";
+ if(m_EntityName==L"SaleOrder") pre=L"PI";
+ if(m_EntityName==L"GDN3")pre=L"INV";
}
- string file1 = GetSaveFileName(pre+m_EntityNo+".xlsx",
+ string file1 = GetSaveFileName(pre+m_EntityNo+L".xlsx",
"Excel1文件(*.xlsx)\0*.xlsx;*.xls\0Excel97文件(*.xls)\0*.xls\0PDF文件(*.pdf)\0*.pdf\0",
"xlsx");
- if(file1 =="") return 1;
+ if(file1 ==L"") return 1;
if(win32::PathFileExists(file1))
{
- int res = win32::MessageBox(this.GetHWND(), "文件已经存在,是否覆盖?","提示",4);
+ int res = win32::MessageBox(this.GetHWND(), L"文件已经存在,是否覆盖?",L"提示",4);
if(res != 6) return 1;
}
- trace("\r\n link excel");
+ trace(L"\r\n link excel");
excel = new cexcel;
int hexcel = cexcel::CreateInstance();
excel.setNativePointer(hexcel);
if(hexcel == 0)
{
- alert("不能连接Excel");
+ alert(L"不能连接Excel");
return 1;
}
string gid = publiccode::GetGuid();
- string filename= pre+m_EntityNo+"_.htm";
- xutil::SaveToFile(GetModuleTmpPath() + "\\"+ filename, htmlStr,"","","");
- trace("\r\n excel to open");
- excel .OpenDocument(GetModuleTmpPath() + "\\"+ filename);
- trace("\r\n trans shape");
+ string filename= pre+m_EntityNo+L"_.htm";
+ xutil::SaveToFile(GetModuleTmpPath() + L"\\"+ filename, htmlStr,L"",L"",L"");
+ trace(L"\r\n excel to open");
+ excel .OpenDocument(GetModuleTmpPath() + L"\\"+ filename);
+ trace(L"\r\n trans shape");
//excel .put_Visible(true);
excel.TransShape();
- trace("\r\n save to tmp excel file");
- if(file1.find(".xls"))
+ trace(L"\r\n save to tmp excel file");
+ if(file1.find(L".xls"))
{
- if(win32::PathFileExists(GetModuleTmpPath() + "\\"+ pre+m_EntityNo+"_.xls"))
- DeleteFile(GetModuleTmpPath() + "\\"+ pre+m_EntityNo+"_.xls");
- excel.SaveToFile(GetModuleTmpPath() + "\\"+ pre+m_EntityNo+"_.xls");
- //alert(GetModuleTmpPath() + "\\"+ pre+m_EntityNo+"_.xls");
+ if(win32::PathFileExists(GetModuleTmpPath() + L"\\"+ pre+m_EntityNo+L"_.xls"))
+ DeleteFile(GetModuleTmpPath() + L"\\"+ pre+m_EntityNo+L"_.xls");
+ excel.SaveToFile(GetModuleTmpPath() + L"\\"+ pre+m_EntityNo+L"_.xls");
+ //alert(GetModuleTmpPath() + L"\\"+ pre+m_EntityNo+L"_.xls");
}
else
{
- if(win32::PathFileExists(GetModuleTmpPath() + "\\"+ pre+m_EntityNo+"_.xlsx"))
- DeleteFile(GetModuleTmpPath() + "\\"+ pre+m_EntityNo+"_.xlsx");
- excel.SaveToFile(GetModuleTmpPath() + "\\"+ pre+m_EntityNo+"_.xlsx");
+ if(win32::PathFileExists(GetModuleTmpPath() + L"\\"+ pre+m_EntityNo+L"_.xlsx"))
+ DeleteFile(GetModuleTmpPath() + L"\\"+ pre+m_EntityNo+L"_.xlsx");
+ excel.SaveToFile(GetModuleTmpPath() + L"\\"+ pre+m_EntityNo+L"_.xlsx");
}
- trace("\r\n save to excel file");
- if(win32::PathFileExists(file1)) //GetModuleTmpPath() + "\\"+ pre+m_EntityNo+"_.xlsx"))
+ trace(L"\r\n save to excel file");
+ if(win32::PathFileExists(file1)) //GetModuleTmpPath() + L"\\"+ pre+m_EntityNo+L"_.xlsx"))
DeleteFile(file1);
excel.SaveToFile(file1);
@@ -219,17 +219,17 @@
string gid = publiccode::GetGuid();
string pre = m_EntityName;
- if(m_EntityName=="SaleOrder") pre="PI";
- if(m_EntityName=="GDN3")pre="INV";
- string filename= pre+m_EntityNo+".htm";
- string filenameex= pre+m_EntityNo+".xlsx";
- xutil::SaveToFile(GetModuleTmpPath() + "\\"+ filename, htmlStr,"","","");
- excel .OpenDocument(GetModuleTmpPath() + "\\"+ filename);
+ if(m_EntityName==L"SaleOrder") pre=L"PI";
+ if(m_EntityName==L"GDN3")pre=L"INV";
+ string filename= pre+m_EntityNo+L".htm";
+ string filenameex= pre+m_EntityNo+L".xlsx";
+ xutil::SaveToFile(GetModuleTmpPath() + L"\\"+ filename, htmlStr,L"",L"",L"");
+ excel .OpenDocument(GetModuleTmpPath() + L"\\"+ filename);
//excel.put_Visible(true);
excel.TransShape();
- if(win32::PathFileExists(GetModuleTmpPath() + "\\"+ filenameex))
- DeleteFile(GetModuleTmpPath() + "\\"+ filenameex);
- excel.SaveToFile(GetModuleTmpPath() + "\\"+ filenameex);
+ if(win32::PathFileExists(GetModuleTmpPath() + L"\\"+ filenameex))
+ DeleteFile(GetModuleTmpPath() + L"\\"+ filenameex);
+ excel.SaveToFile(GetModuleTmpPath() + L"\\"+ filenameex);
excel.put_Visible(true);
excel.Release(excel.ptr_native_);
@@ -238,71 +238,71 @@
string getfilePath()
{
- string path=GetModulePath()+"\\resource\\image";
- string filename="contract.jpg";
- filename="sign.png";
- filename="jrj_maersk.png";
- filename="HomeDecorSign.png";
- xaserver::DownLoadFile(GetServerUrl(),"/business/rpttemplate/"+filename,"",path+"\\"+filename);
- filename="HomeDecorLogo.jpg";
- xaserver::DownLoadFile(GetServerUrl(),"/business/rpttemplate/"+filename,"",path+"\\"+filename);
+ string path=GetModulePath()+L"\\resource\\image";
+ string filename=L"contract.jpg";
+ filename=L"sign.png";
+ filename=L"jrj_maersk.png";
+ filename=L"HomeDecorSign.png";
+ xaserver::DownLoadFile(GetServerUrl(),L"/business/rpttemplate/"+filename,L"",path+L"\\"+filename);
+ filename=L"HomeDecorLogo.jpg";
+ xaserver::DownLoadFile(GetServerUrl(),L"/business/rpttemplate/"+filename,L"",path+L"\\"+filename);
return path;
}
string replaceInnerElement(string html)
{
string str = html;
- if(str.find("[$element:")<0) return str;
+ if(str.find(L"[$element:")<0) return str;
int len = 0;
int pos = 0;
int pos1 = 0;
- string pre="";
- string left="";
- string right="";
- string tag="";
+ string pre=L"";
+ string left=L"";
+ string right=L"";
+ string tag=L"";
- len = "[$element:".length();
+ len = L"[$element:".length();
while(true)
{
- pos = str.find("[$element:");
+ pos = str.find(L"[$element:");
if(pos < 0) break;
left = str.left(pos);
right = str.mid(pos+ len,999999);
- pos1 = right.find("]");
+ pos1 = right.find(L"]");
if(pos1>=0)
{
tag = right.left(pos1);
- if(tag.right(1)=="$") tag=tag.left(tag.length() - 1);
- pre = pre + left + "<" + tag +">";
+ if(tag.right(1)==L"$") tag=tag.left(tag.length() - 1);
+ pre = pre + left + L"<" + tag +L">";
str = right.mid(pos1+ 1,999999);
}else
{
- pre = pre + left+"<";
+ pre = pre + left+L"<";
str = right;
}
}
str = pre + str;
- pre = "";
- len = "[/$element:".length();
+ pre = L"";
+ len = L"[/$element:".length();
while(true)
{
- pos = str.find("[/$element:");
+ pos = str.find(L"[/$element:");
if(pos < 0) break;
left = str.left(pos);
right = str.mid(pos+ len,999999);
- pos1 = right.find("]");
+ pos1 = right.find(L"]");
if(pos1>=0)
{
tag = right.left(pos1);
- if(tag.right(1)=="$") tag=tag.left(tag.length() - 1);
- pre = pre + left + "</" + tag +">";
+ if(tag.right(1)==L"$") tag=tag.left(tag.length() - 1);
+ pre = pre + left + L"</" + tag +L">";
str = right.mid(pos1+ 1,999999);
}else
{
- pre = pre + left+"</";
+ pre = pre + left+L"</";
str = right;
}
}
@@ -312,13 +312,13 @@
string adjustXsl(string str,string localPath)
{
- //if(str.find("%")>=0) str = str.replace("%","");
- if(str.find("[$path]/rpttemplate")>=0) str = str.replace("[$path]/rpttemplate",localPath);
+ //if(str.find(L"%")>=0) str = str.replace(L"%",L"");
+ if(str.find(L"[$path]/rpttemplate")>=0) str = str.replace(L"[$path]/rpttemplate",localPath);
str = replaceInnerElement(str);
return str;
}
- string DownLoadSKUNoPic(string SKUNo,string CustomerID="",string CustomerItemNo="")
+ string DownLoadSKUNoPic(string SKUNo,string CustomerID=L"",string CustomerItemNo=L"")
{
if(SKUNo.length()>20) return DownLoadPaperPic(SKUNo);
@@ -327,51 +327,51 @@
x.setNativePointer(xml::CreateInstance());
xaserverarg arg = new xaserverarg;
arg.setNativePointer(arg.CreateInstance());
- arg.AddArg("SKUNo",SKUNo);
+ arg.AddArg(L"SKUNo",SKUNo);
- string src ="/sale/data/ProductLibrary3/pref/picture/imagelistSKUNo";
- if(CustomerID !="")
+ string src =L"/sale/data/ProductLibrary3/pref/picture/imagelistSKUNo";
+ if(CustomerID !=L"")
{
- arg.AddArg("CustomerID",CustomerID);
- arg.AddArg("CustomerItemNo",CustomerItemNo);
- src ="/sale/data/ProductLibrary3/pref/picture/customer/imagelistSKUNo";
+ arg.AddArg(L"CustomerID",CustomerID);
+ arg.AddArg(L"CustomerItemNo",CustomerItemNo);
+ src =L"/sale/data/ProductLibrary3/pref/picture/customer/imagelistSKUNo";
}
- //trace("SKUNo="+SKUNo);//要有展示图片查询条件内必定要skuno
+ //trace(L"SKUNo=L"+SKUNo);//要有展示图片查询条件内必定要skuno
if(url::get(src,arg.GetString(),x)!=1)
{
- trace("error for download skuno pic!");
+ trace(L"error for download skuno pic!");
return "";
}
- string spath = "";
+ string spath = L"";
string path =GetModuleTmpPath();
- string ext = "jpg";
- if(x.GetXmlDoc().selectSingleNode("//FileExt[1]"))
+ string ext = L"jpg";
+ if(x.GetXmlDoc().selectSingleNode(L"//FileExt[1]"))
{
- ext = x.GetXmlDoc().selectSingleNode("//FileExt[1]").text;
- }else if(CustomerID !="")
+ ext = x.GetXmlDoc().selectSingleNode(L"//FileExt[1]").text;
+ }else if(CustomerID !=L"")
{
- src ="/sale/data/ProductLibrary3/pref/picture/imagelistSKUNo";
+ src =L"/sale/data/ProductLibrary3/pref/picture/imagelistSKUNo";
if(url::get(src,arg.GetString(),x)!=1)
{
- trace("error for download skuno pic!");
+ trace(L"error for download skuno pic!");
return "";
}
- if(x.GetXmlDoc().selectSingleNode("//FileExt[1]"))
- ext = x.GetXmlDoc().selectSingleNode("//FileExt[1]").text;
+ if(x.GetXmlDoc().selectSingleNode(L"//FileExt[1]"))
+ ext = x.GetXmlDoc().selectSingleNode(L"//FileExt[1]").text;
}
- string filename = SKUNo + "." + ext;
- if(x.GetXmlDoc().selectSingleNode("//PicPath[1]"))
- spath = x.GetXmlDoc().selectSingleNode("//PicPath[1]").text;
- if(spath != "")
+ string filename = SKUNo + L"." + ext;
+ if(x.GetXmlDoc().selectSingleNode(L"//PicPath[1]"))
+ spath = x.GetXmlDoc().selectSingleNode(L"//PicPath[1]").text;
+ if(spath != L"")
{
- xaserver::DownLoadFile(GetServerUrl(),spath,"",path+"/"+filename);
+ xaserver::DownLoadFile(GetServerUrl(),spath,L"",path+L"/"+filename);
}
- return "file://"+ path+"/"+filename;
+ return "file://"+ path+L"/"+filename;
}
- string DownLoadSKUNoPic(string SKUNo,string CustomerID="",string CustomerItemNo="")
+ string DownLoadSKUNoPic(string SKUNo,string CustomerID=L"",string CustomerItemNo=L"")
{
if(SKUNo.length()>20) return DownLoadPaperPic(SKUNo);
@@ -380,48 +380,48 @@
x.setNativePointer(xml::CreateInstance());
xaserverarg arg = new xaserverarg;
arg.setNativePointer(arg.CreateInstance());
- arg.AddArg("SKUNo",SKUNo);
+ arg.AddArg(L"SKUNo",SKUNo);
- string src ="/sale/data/ProductLibrary3/pref/picture/imagelistSKUNo";
- if(CustomerID !="")
+ string src =L"/sale/data/ProductLibrary3/pref/picture/imagelistSKUNo";
+ if(CustomerID !=L"")
{
- arg.AddArg("CustomerID",CustomerID);
- arg.AddArg("CustomerItemNo",CustomerItemNo);
- src ="/sale/data/ProductLibrary3/pref/picture/customer/imagelistSKUNo";
+ arg.AddArg(L"CustomerID",CustomerID);
+ arg.AddArg(L"CustomerItemNo",CustomerItemNo);
+ src =L"/sale/data/ProductLibrary3/pref/picture/customer/imagelistSKUNo";
}
- //trace("SKUNo="+SKUNo);//要有展示图片查询条件内必定要skuno
+ //trace(L"SKUNo=L"+SKUNo);//要有展示图片查询条件内必定要skuno
if(url::get(src,arg.GetString(),x)!=1)
{
- trace("error for download skuno pic!");
+ trace(L"error for download skuno pic!");
return "";
}
- string spath = "";
+ string spath = L"";
string path =GetModuleTmpPath();
- string ext = "jpg";
- if(x.GetXmlDoc().selectSingleNode("//FileExt[1]"))
+ string ext = L"jpg";
+ if(x.GetXmlDoc().selectSingleNode(L"//FileExt[1]"))
{
- ext = x.GetXmlDoc().selectSingleNode("//FileExt[1]").text;
- }else if(CustomerID !="")
+ ext = x.GetXmlDoc().selectSingleNode(L"//FileExt[1]").text;
+ }else if(CustomerID !=L"")
{
- src ="/sale/data/ProductLibrary3/pref/picture/imagelistSKUNo";
+ src =L"/sale/data/ProductLibrary3/pref/picture/imagelistSKUNo";
if(url::get(src,arg.GetString(),x)!=1)
{
- trace("error for download skuno pic!");
+ trace(L"error for download skuno pic!");
return "";
}
- if(x.GetXmlDoc().selectSingleNode("//FileExt[1]"))
- ext = x.GetXmlDoc().selectSingleNode("//FileExt[1]").text;
+ if(x.GetXmlDoc().selectSingleNode(L"//FileExt[1]"))
+ ext = x.GetXmlDoc().selectSingleNode(L"//FileExt[1]").text;
}
- string filename = SKUNo + "." + ext;
- if(x.GetXmlDoc().selectSingleNode("//PicPath[1]"))
- spath = x.GetXmlDoc().selectSingleNode("//PicPath[1]").text;
- if(spath != "")
+ string filename = SKUNo + L"." + ext;
+ if(x.GetXmlDoc().selectSingleNode(L"//PicPath[1]"))
+ spath = x.GetXmlDoc().selectSingleNode(L"//PicPath[1]").text;
+ if(spath != L"")
{
- xaserver::DownLoadFile(GetServerUrl(),spath,"",path+"/"+filename);
+ xaserver::DownLoadFile(GetServerUrl(),spath,L"",path+L"/"+filename);
}
- return "file://"+ path+"/"+filename;
+ return "file://"+ path+L"/"+filename;
}
string GetImageUrl(string id)
@@ -430,9 +430,9 @@
xp.setNativePointer(xml::CreateInstance());
xaserverarg arg_pic=new xaserverarg;
arg_pic.setNativePointer(arg_pic.CreateInstance());
- arg_pic.AddArg("id",id);
+ arg_pic.AddArg(L"id",id);
- string res = "/sale/data/productlibrary3/image/url";
+ string res = L"/sale/data/productlibrary3/image/url";
if(url::get(res,arg_pic.GetString(),xp)!=1)
{
xp.GetXml();
@@ -440,64 +440,64 @@
}else
{
string path = xp.GetXmlDoc().text;
- if(path !="") return path;
+ if(path !=L"") return path;
}
- return "/business/products/chanpin/"+id.left(2)+"/"+ id+".jpg";
+ return "/business/products/chanpin/"+id.left(2)+L"/"+ id+L".jpg";
}
string DownLoadPaperPic(string guid)
{
string path =GetModuleTmpPath();
- string ext = "jpg";
- string filename = guid + "." + ext;
+ string ext = L"jpg";
+ string filename = guid + L"." + ext;
string spath = GetImageUrl(guid);
//alert(spath);
- xaserver::DownLoadFile(GetServerUrl(),spath,"",path+"/"+filename);
- return "file://"+ path+"/"+filename;
+ xaserver::DownLoadFile(GetServerUrl(),spath,L"",path+L"/"+filename);
+ return "file://"+ path+L"/"+filename;
}
string DownLoadPaperPic1(string guid)
{
string path =GetModuleTmpPath();
- string ext = "jpg";
- string filename = guid + "." + ext;
+ string ext = L"jpg";
+ string filename = guid + L"." + ext;
string str = guid.mid(0,2);
- string spath = "/business/products/chanpin/"+str+"/"+guid+".jpg";
- xaserver::DownLoadFile(GetServerUrl(),spath,"",path+"/"+filename);
- return "file://"+ path+"/"+filename;
+ string spath = L"/business/products/chanpin/"+str+L"/"+guid+L".jpg";
+ xaserver::DownLoadFile(GetServerUrl(),spath,L"",path+L"/"+filename);
+ return "file://"+ path+L"/"+filename;
}
string DownLoadUrlPic(string src)
{
string guid = publiccode::GetGuid();
string path =GetModuleTmpPath();
- string ext = "jpg";
- string filename = guid + "." + ext;
+ string ext = L"jpg";
+ string filename = guid + L"." + ext;
string spath = src;
- xaserver::DownLoadFile(GetServerUrl(),spath,"",path+"/"+filename);
- return "file://"+ path+"/"+filename;
+ xaserver::DownLoadFile(GetServerUrl(),spath,L"",path+L"/"+filename);
+ return "file://"+ path+L"/"+filename;
}
int OnHtml(xaserverarg arg)
{
int hCursor = xutil::SetCursorWait();
- string sEntityName = arg.GetArgString("EntityName");
- string sEntityID = arg.GetArgString("EntityID");
- string dataUrl = arg.GetArgString("DataUrl");
- if(dataUrl=="")
- dataUrl = "/sale/data/"+sEntityName+"/print/dataset";
- else if(dataUrl.left(1)!="/")
- dataUrl = "/sale/data/"+sEntityName+ "/"+ dataUrl;
+ string sEntityName = arg.GetArgString(L"EntityName");
+ string sEntityID = arg.GetArgString(L"EntityID");
+ string dataUrl = arg.GetArgString(L"DataUrl");
+ if(dataUrl==L"")
+ dataUrl = L"/sale/data/"+sEntityName+L"/print/dataset";
+ else if(dataUrl.left(1)!=L"/")
+ dataUrl = L"/sale/data/"+sEntityName+ L"/"+ dataUrl;
if(!m_dataset)
{
xml x0 = new xml;
x0.setNativePointer(xml::CreateInstance());
if (url::get(dataUrl,arg.GetString(),x0) != 1)
{
- alert("数据集出错了!");
+ alert(L"数据集出错了!");
return 0;
}
trace(x0.GetXml());
@@ -506,14 +506,14 @@
string sPath;
sPath = getfilePath();
- arg.AddArg("sPath",sPath);
+ arg.AddArg(L"sPath",sPath);
m_spath = sPath;
xml xsl = new xml;
xsl.setNativePointer(xml::CreateInstance());
- if (url::get("/sale/data/SysPrintTemplate/getxsl",arg.GetString(),xsl) != 1)
+ if (url::get(L"/sale/data/SysPrintTemplate/getxsl",arg.GetString(),xsl) != 1)
{
- alert("数据模板错误!");
+ alert(L"数据模板错误!");
return 0;
}
@@ -523,68 +523,68 @@
xsl.LoadXml(xslStr);
//trace(m_dataset.GetXml());
- trace("\r\n--------\r\n"+xslStr);
+ trace(L"\r\n--------\r\n"+xslStr);
m_strHtml = m_dataset.GetXmlDoc().transformNode(xsl.GetXmlDoc());
- string aspace = m_strHtml.replace("[空]"," ",0);
- aspace = aspace.replace("[line]","<br/>",0);
- string scontent = aspace.replace("<?xml version=\"1.0\"?>","",0);
+ string aspace = m_strHtml.replace(L"[空]",L" ",0);
+ aspace = aspace.replace(L"[line]",L"<br/>",0);
+ string scontent = aspace.replace(L"<?xml version=\"1.0\"?>",L"",0);
- string head ="";
+ string head =L"";
string tail = scontent;
- int pos = tail.find("src=\"item-picture:");
+ int pos = tail.find(L"src=\"item-picture:");
while(pos > 0)
{
- int spos = pos+"src=\"item-picture:".length();
- int pos1 = tail.find("\"",spos+1);
+ int spos = pos+L"src=\"item-picture:".length();
+ int pos1 = tail.find(L"\"",spos+1);
string skuno = tail.mid(spos,pos1 - spos ).trim();
- string CustomerID="";
- string CustomerItemNo="";
- if(skuno.find(",")>0)
+ string CustomerID=L"";
+ string CustomerItemNo=L"";
+ if(skuno.find(L",L")>0)
{
- CustomerID = skuno.left(skuno.find(",")).trim();
- skuno = skuno.mid(skuno.find(",")+1,256).trim();
+ CustomerID = skuno.left(skuno.find(L",L")).trim();
+ skuno = skuno.mid(skuno.find(L",L")+1,256).trim();
}
- if(skuno.find(",")>0)
+ if(skuno.find(L",L")>0)
{
- CustomerItemNo = skuno.left(skuno.find(",")).trim();
- skuno = skuno.mid(skuno.find(",")+1,256).trim();
+ CustomerItemNo = skuno.left(skuno.find(L",L")).trim();
+ skuno = skuno.mid(skuno.find(L",L")+1,256).trim();
}
string src = DownLoadSKUNoPic(skuno,CustomerID,CustomerItemNo);
- head += tail.left(pos) + "src=\"" + src;
+ head += tail.left(pos) + L"src=\"" + src;
tail = tail.mid(pos1,999999999);
- pos = tail.find("src=\"item-picture:");
+ pos = tail.find(L"src=\"item-picture:");
}
scontent = head + tail;
- head ="";
+ head =L"";
tail = scontent;
- int position = tail.find("src=\"paper-picture:");
+ int position = tail.find(L"src=\"paper-picture:");
while(position > 0)
{
- int sposition = position+"src=\"paper-picture:".length();
- int position1 = tail.find("\"",sposition+1);
+ int sposition = position+L"src=\"paper-picture:".length();
+ int position1 = tail.find(L"\"",sposition+1);
string guid = tail.mid(sposition,position1 - sposition ).trim();
string src2 = DownLoadPaperPic(guid);
- head += tail.left(position) + "src=\"" + src2;
+ head += tail.left(position) + L"src=\"" + src2;
tail = tail.mid(position1,999999999);
- position = tail.find("src=\"paper-picture:");
+ position = tail.find(L"src=\"paper-picture:");
}
scontent = head + tail;
- head ="";
+ head =L"";
tail = scontent;
- position = tail.find("src=\"src-picture:");
+ position = tail.find(L"src=\"src-picture:");
while(position > 0)
{
- sposition = position+"src=\"src-picture:".length();
- position1 = tail.find("\"",sposition+1);
+ sposition = position+L"src=\"src-picture:".length();
+ position1 = tail.find(L"\"",sposition+1);
guid = tail.mid(sposition,position1 - sposition ).trim();
src2 = DownLoadUrlPic(guid);
- head += tail.left(position) + "src=\"" + src2;
+ head += tail.left(position) + L"src=\"" + src2;
tail = tail.mid(position1,999999999);
- position = tail.find("src=\"src-picture:");
+ position = tail.find(L"src=\"src-picture:");
}
scontent = head + tail;
@@ -594,10 +594,10 @@
xml x1 = new xml;
x1.setNativePointer(xml ::CreateInstance());
- //string xcontent = m_strHtml.replace(" ","[空]",0);
- string xcontent = m_strHtml.replace("[空]"," ",0);
- int pos0 = xcontent.find("<xml");
- int pos2 = xcontent.find("</xml>");
+ //string xcontent = m_strHtml.replace(L" ",L"[空]",0);
+ string xcontent = m_strHtml.replace(L"[空]",L" ",0);
+ int pos0 = xcontent.find(L"<xml");
+ int pos2 = xcontent.find(L"</xml>");
if(pos0>=0)
{
string str = xcontent.left(pos0)+ xcontent.mid(pos2+6,9999999);
@@ -608,7 +608,7 @@
{
/*if(!showgrid)
{
- SendCtrlCmd(cell,"xmFormatShowGrid");
+ SendCtrlCmd(cell,L"xmFormatShowGrid");
showgrid = true;
}*/
cell.LoadTemplate(x1.GetXmlDoc());
@@ -623,20 +623,20 @@
int updateHtml()
{
_mshtml::IHTMLDocument3 doc = ole_print.GetHtmlDocument();
- _mshtml::IHTMLElementCollection rows = doc.getElementsByTagName("tr");
- _mshtml::IHTMLElementCollection rows2 = doc.getElementsByTagName("td");
+ _mshtml::IHTMLElementCollection rows = doc.getElementsByTagName(L"tr");
+ _mshtml::IHTMLElementCollection rows2 = doc.getElementsByTagName(L"td");
int len = rows.length;
int len2 = rows2.length;
for(int i=0; i < len - 1;i++)
{
_mshtml::IHTMLElement e = rows.item(i,i);
- e.style.setAttribute("height",e.offsetHeight,0);
+ e.style.setAttribute(L"height",e.offsetHeight,0);
e.Release();
}
for( i=0; i < len2 - 1;i++)
{
_mshtml::IHTMLElement e2 = rows2.item(i,i);
- e2.style.setAttribute("width",e.offsetWidth,0);
+ e2.style.setAttribute(L"width",e.offsetWidth,0);
e2.Release();
}
rows.Release();
@@ -652,29 +652,29 @@
xaserverarg arg = new xaserverarg;
arg.setNativePointer(GetParam());
int p = arg.ptr_native_;
- arg.AddArg("action","open");
- arg.AddArg("DocumentID","");
- arg.AddArg("ok","");
- openUrl("/sale/view/view.dlg/xpage/Template/PrintDialog", p);
- string ret = arg.GetArgString("return");
- string action = arg.GetArgString("action");
- if (ret =="ok")
+ arg.AddArg(L"action",L"open");
+ arg.AddArg(L"DocumentID",L"");
+ arg.AddArg(L"ok",L"");
+ openUrl(L"/sale/view/view.dlg/xpage/Template/PrintDialog", p);
+ string ret = arg.GetArgString(L"return");
+ string action = arg.GetArgString(L"action");
+ if (ret ==L"ok")
{
- if(action =="open")
+ if(action ==L"open")
{
- m_DocumentID = arg.GetArgString("DocumentID");
+ m_DocumentID = arg.GetArgString(L"DocumentID");
xml x = new xml;
x.setNativePointer(xml::CreateInstance());
string prestr = m_DocumentID.mid(0,2);
prestr = prestr.upper();
- xaserver::LoadUrl(GetServerUrl(),"/business/data/bill/"+prestr+"/"+ m_DocumentID+".jpg","",x);
- if(x.GetXml()!="")
+ xaserver::LoadUrl(GetServerUrl(),L"/business/data/bill/"+prestr+L"/"+ m_DocumentID+L".jpg",L"",x);
+ if(x.GetXml()!=L"")
{
if(x.GetXmlDoc())
{
/*if(!showgrid)
{
- SendCtrlCmd(cell,"xmFormatShowGrid");
+ SendCtrlCmd(cell,L"xmFormatShowGrid");
showgrid = true;
}*/
cell.LoadTemplate(x.GetXmlDoc());
@@ -683,21 +683,21 @@
ole_print.LoadHtml(x.GetXml());
}else
{
- ole_print.LoadHtml("<html><body>未找到对应的文档</body></html>");
- //cell.LoadHtml("<html><body>未找到对应的文档</body></html>");
+ ole_print.LoadHtml(L"<html><body>未找到对应的文档</body></html>");
+ //cell.LoadHtml(L"<html><body>未找到对应的文档</body></html>");
}
}
else
{
- string templateName = arg.GetArgString("template-name");
+ string templateName = arg.GetArgString(L"template-name");
win32::SetWindowText(GetHWND(),templateName);
billName = templateName;
- billPre = arg.GetArgString("template-pre");
- billID = arg.GetArgString("template-guid");
- m_EntityID = arg.GetArgString("EntityID");
- m_EntityNo = arg.GetArgString("EntityNo");
- m_EntityName = arg.GetArgString("EntityName");
- m_DocumentID = "";
+ billPre = arg.GetArgString(L"template-pre");
+ billID = arg.GetArgString(L"template-guid");
+ m_EntityID = arg.GetArgString(L"EntityID");
+ m_EntityNo = arg.GetArgString(L"EntityNo");
+ m_EntityName = arg.GetArgString(L"EntityName");
+ m_DocumentID = L"";
OnHtml(arg);
@@ -714,29 +714,29 @@
xaserverarg arg = new xaserverarg;
arg.setNativePointer(GetParam());
int p = arg.ptr_native_;
- arg.AddArg("ok","");
- openUrl("/sale/view/view.dlg/xpage/Template/PrintDialog", p);
- string ret = arg.GetArgString("return");
- string action = arg.GetArgString("action");
- if (ret =="ok")
+ arg.AddArg(L"ok",L"");
+ openUrl(L"/sale/view/view.dlg/xpage/Template/PrintDialog", p);
+ string ret = arg.GetArgString(L"return");
+ string action = arg.GetArgString(L"action");
+ if (ret ==L"ok")
{
updated = false;
- if(action =="open")
+ if(action ==L"open")
{
- m_DocumentID = arg.GetArgString("DocumentID");
+ m_DocumentID = arg.GetArgString(L"DocumentID");
xml x = new xml;
x.setNativePointer(xml::CreateInstance());
string prestr = m_DocumentID.mid(0,2);
prestr = prestr.upper();
- xaserver::LoadUrl(GetServerUrl(),"/business/data/bill/"+prestr+"/"+ m_DocumentID+".jpg","",x);
- if(x.GetXml()!="")
+ xaserver::LoadUrl(GetServerUrl(),L"/business/data/bill/"+prestr+L"/"+ m_DocumentID+L".jpg",L"",x);
+ if(x.GetXml()!=L"")
{
- string content = "";
- if(x.GetXmlDoc().documentElement.tagName=="Bill")
+ string content = L"";
+ if(x.GetXmlDoc().documentElement.tagName==L"Bill")
{
content = x.GetXmlDoc().documentElement.text;
- content = content.replace("[空]"," ",0);
+ content = content.replace(L"[空]",L" ",0);
ole_print.LoadHtml(content);
}else
{
@@ -744,39 +744,39 @@
{
/*if(!showgrid)
{
- SendCtrlCmd(cell,"xmFormatShowGrid");
+ SendCtrlCmd(cell,L"xmFormatShowGrid");
showgrid = true;
}*/
xml x1 = new xml;
x1.setNativePointer(xml::CreateInstance());
string content1 = x.GetXml();
- content1 = content1.replace("[空]"," ",0);
+ content1 = content1.replace(L"[空]",L" ",0);
//trace(content1);
x1.LoadXml(content1);
cell.LoadTemplate(x1.GetXmlDoc());
cell.Redraw();
}
content = x.GetXml();
- content = content.replace("[空]"," ",0);
+ content = content.replace(L"[空]",L" ",0);
ole_print.LoadHtml(content);
}
}else
{
- ole_print.LoadHtml("<html><body>未找到对应的文档</body></html>");
- //cell.LoadHtml("<html><body>未找到对应的文档</body></html>");
+ ole_print.LoadHtml(L"<html><body>未找到对应的文档</body></html>");
+ //cell.LoadHtml(L"<html><body>未找到对应的文档</body></html>");
}
}
else
{
- string templateName = arg.GetArgString("template-name");
+ string templateName = arg.GetArgString(L"template-name");
win32::SetWindowText(GetHWND(),templateName);
billName = templateName;
- billPre = arg.GetArgString("template-pre");
- billID = arg.GetArgString("template-guid");
- m_EntityID = arg.GetArgString("EntityID");
- m_EntityNo = arg.GetArgString("EntityNo");
- m_EntityName = arg.GetArgString("EntityName");
- m_DocumentID = "";
+ billPre = arg.GetArgString(L"template-pre");
+ billID = arg.GetArgString(L"template-guid");
+ m_EntityID = arg.GetArgString(L"EntityID");
+ m_EntityNo = arg.GetArgString(L"EntityNo");
+ m_EntityName = arg.GetArgString(L"EntityName");
+ m_DocumentID = L"";
OnHtml(arg);
}
}
@@ -786,46 +786,46 @@
int SetAgent()
{
- string xfNodeAgentArea = "agentarea";
+ string xfNodeAgentArea = L"agentarea";
xnode anode = GetAgentNode(xfNodeAgentArea);
msxml::IXMLDOMElement xframeElement = GetElement();
- msxml::IXMLDOMNode agent = xframeElement.selectSingleNode("agent/"+xfNodeAgentArea+"[1]/*");
+ msxml::IXMLDOMNode agent = xframeElement.selectSingleNode(L"agent/"+xfNodeAgentArea+L"[1]/*");
msxml::IXMLDOMNodeList nlist;
int index;
int nlen;
msxml::IXMLDOMElement ele;
- string tools="<hbox class=''>";
+ string tools=L"<hbox class=''>";
if(agent)
{
- nlist = agent.SelectNodes(".//xtoolbutton");
+ nlist = agent.SelectNodes(L".//xtoolbutton");
nlen = nlist.length;
for(index=0;index<nlen;index++)
{
ele = nlist.item(index);
- string name = ele.selectSingleNode("@name").text;
- string label = ele.selectSingleNode("@caption").text;
+ string name = ele.selectSingleNode(L"@name").text;
+ string label = ele.selectSingleNode(L"@caption").text;
string image;
- string src = "";
- if(ele.selectSingleNode("@image"))
- image = ele.selectSingleNode("@image").text;
+ string src = L"";
+ if(ele.selectSingleNode(L"@image"))
+ image = ele.selectSingleNode(L"@image").text;
else
- image = "0 22";
+ image = L"0 22";
- if(ele.selectSingleNode("@src"))
- src = ele.selectSingleNode("@src").text;
+ if(ele.selectSingleNode(L"@src"))
+ src = ele.selectSingleNode(L"@src").text;
int strLen = label.length();
int width = 60 + (strLen - 2) * 10;
string tool;
- if (src != "")
- tool = "<xtoolbutton src='"+src+"' caption='"+label+"' name='"+name+"' height='28' class1='action'/>";
+ if (src != L"")
+ tool = L"<xtoolbutton src='"+src+L"' caption='"+label+L"' name='"+name+L"' height='28' class1='action'/>";
else
- tool = "<xtoolbutton image='"+image+"' caption='"+label+"' name='"+name+"' height='28' class1='action'/>";
+ tool = L"<xtoolbutton image='"+image+L"' caption='"+label+L"' name='"+name+L"' height='28' class1='action'/>";
tools += tool;
}
}
- tools +="</hbox>";
+ tools +=L"</hbox>";
SetAgentNodeContent(anode, tools);
return 1;
}
@@ -843,15 +843,15 @@
editing = !editing;
if(editing)
{
- SwitchLayer("cellview","viewclient");
+ SwitchLayer(L"cellview",L"viewclient");
}else
{
htmlStr = cell.GetHtml();
//string content = htmlStr;
- htmlStr = htmlStr.replace("[空]"," ",0);
- htmlStr = htmlStr.replace("[line]","<br/>",0);
+ htmlStr = htmlStr.replace(L"[空]",L" ",0);
+ htmlStr = htmlStr.replace(L"[line]",L"<br/>",0);
ole_print.LoadHtml(htmlStr);
- SwitchLayer("oleview","viewclient");
+ SwitchLayer(L"oleview",L"viewclient");
}
return 1;
}
@@ -871,7 +871,7 @@
//ole_print.GetHtmlDocument();
//return 1;
_mshtml::IHTMLDocument3 doc = ole_print.GetHtmlDocument();
- _mshtml::IHTMLElementCollection rows = doc.getElementsByTagName("tr");
+ _mshtml::IHTMLElementCollection rows = doc.getElementsByTagName(L"tr");
int len = rows.length;
for(int i=0; i < len - 1;i++)
@@ -879,8 +879,8 @@
//oleobject v = rows.item(i,i);
_mshtml::IHTMLElement e = rows.item(i,i);
_mshtml::IHTMLElement2 e1 = e;
- //e.setAttribute("height",e1.clientHeight,0);
- e.setAttribute("height",300,0);
+ //e.setAttribute(L"height",e1.clientHeight,0);
+ e.setAttribute(L"height",300,0);
e.Release();
e1.Release();
}
@@ -889,12 +889,12 @@
/*
if(PaperPrint == false)
{
- ole_print.GetHtmlDocument().body.style.visibility="hidden";
+ ole_print.GetHtmlDocument().body.style.visibility=L"hidden";
PaperPrint = true;
}
else
{
- ole_print.GetHtmlDocument().body.style.visibility="visible";
+ ole_print.GetHtmlDocument().body.style.visibility=L"visible";
PaperPrint = false;
}
*/
@@ -912,7 +912,7 @@
}
int OnPortrait() //纵向
{
- alert("Portrait");
+ alert(L"Portrait");
return 1;
}
int OnLandscape() //横向
@@ -939,48 +939,48 @@
prestr = prestr.upper();
- content = content.replace("gb2312","utf-16",0);
- content = content.replace(" ","[空]",0);
- content = content.replace("&","",0);
+ content = content.replace(L"gb2312",L"utf-16",0);
+ content = content.replace(L" ",L"[空]",0);
+ content = content.replace(L"&",L"",0);
xml x0 = new xml;
x0.setNativePointer(xml::CreateInstance());
- x0.LoadXml("<Bill/>");
+ x0.LoadXml(L"<Bill/>");
x0.GetXmlDoc().documentElement.text = content;
content = x0.GetXml();
- int ret= xaserver::UploadData("bill"+prestr, guid+".jpg", content);
- if(ret < 0) trace("error upload");
+ int ret= xaserver::UploadData(L"bill"+prestr, guid+L".jpg", content);
+ if(ret < 0) trace(L"error upload");
- string ls_xml ="<DocumentList guid='"+guid+"' update.modify='1' update.new='1'>";
- ls_xml += "<EntityName>"+ m_EntityName + "</EntityName>";
- ls_xml += "<EntityID>"+ m_EntityID + "</EntityID>";
- ls_xml += "<EntityNo>"+ m_EntityNo + "</EntityNo>";
- ls_xml += "<BillID>"+ billID + "</BillID>";
- ls_xml += "<BillName>"+ billName + "</BillName>";
- ls_xml += "</DocumentList>";
+ string ls_xml =L"<DocumentList guid='"+guid+L"' update.modify='1' update.new='1'>";
+ ls_xml += L"<EntityName>"+ m_EntityName + L"</EntityName>";
+ ls_xml += L"<EntityID>"+ m_EntityID + L"</EntityID>";
+ ls_xml += L"<EntityNo>"+ m_EntityNo + L"</EntityNo>";
+ ls_xml += L"<BillID>"+ billID + L"</BillID>";
+ ls_xml += L"<BillName>"+ billName + L"</BillName>";
+ ls_xml += L"</DocumentList>";
xml x = new xml;
x.setNativePointer(xml::CreateInstance());
x.LoadXml(ls_xml);
xaserverarg arg = new xaserverarg;
arg.setNativePointer(xaserverarg::CreateInstance());
- arg.AddArg("content",x.GetXml());
+ arg.AddArg(L"content",x.GetXml());
- if(url::get("/sale/data/DocumentList3/bill/update", arg.GetString(),x)!=1)
+ if(url::get(L"/sale/data/DocumentList3/bill/update", arg.GetString(),x)!=1)
{
string error = x.GetXmlDoc().text;
- alert("err:"+error);
+ alert(L"err:"+error);
return 1;
}
- string str = x.GetXmlDoc().documentElement.getAttribute("text");
- if(str == "true")
+ string str = x.GetXmlDoc().documentElement.getAttribute(L"text");
+ if(str == L"true")
{
- alert("保存成功!");
+ alert(L"保存成功!");
updated = false;
}else
{
- alert("保存失败!");
+ alert(L"保存失败!");
}
return 1;
@@ -996,131 +996,131 @@
{
xaserverarg arg = new xaserverarg;
arg.setNativePointer(GetParam());
- string templateName = arg.GetArgString("template-name");
+ string templateName = arg.GetArgString(L"template-name");
win32::SetWindowText(GetHWND(),templateName);
OnHtml(arg);
billName = templateName;
- billPre = arg.GetArgString("template-pre");
- billID = arg.GetArgString("template-guid");
- m_EntityID = arg.GetArgString("EntityID");
- m_EntityNo = arg.GetArgString("EntityNo");
- m_EntityName = arg.GetArgString("EntityName");
- m_DocumentID = "";
+ billPre = arg.GetArgString(L"template-pre");
+ billID = arg.GetArgString(L"template-guid");
+ m_EntityID = arg.GetArgString(L"EntityID");
+ m_EntityNo = arg.GetArgString(L"EntityNo");
+ m_EntityName = arg.GetArgString(L"EntityName");
+ m_DocumentID = L"";
return 1;
}
int OnCmdDispatch(string comdid)
{
- if(comdid=="xmSort")
+ if(comdid==L"xmSort")
{
- OpenWindow("dev:xpage[DataSort.dialog.vx]",cast(m_dataset as int));
+ OpenWindow(L"dev:xpage[DataSort.dialog.vx]",cast(m_dataset as int));
return 1;
}
- if(comdid=="print:PrintImmediate")
+ if(comdid==L"print:PrintImmediate")
{
updated = true;
return OnPrint();
}
- if(comdid=="print:PrintPaper") {
+ if(comdid==L"print:PrintPaper") {
updated = true;
return PrintPaper();
}
- if(comdid=="print:PrintPreview") {
+ if(comdid==L"print:PrintPreview") {
updated = true;
return OnPrintPreview();
}
- if(comdid=="print:Portrait") {
+ if(comdid==L"print:Portrait") {
updated = true;
return OnPortrait();
}
- if(comdid=="print:Landscape") {
+ if(comdid==L"print:Landscape") {
updated = true;
return OnLandscape();
}
- if(comdid=="print:PageSetup") {
+ if(comdid==L"print:PageSetup") {
updated = true;
return OnPageSetup();
}
- if(comdid=="print:Custom") {
+ if(comdid==L"print:Custom") {
updated = true;
return OnCustom();
}
- if(comdid=="print:PrintDialog")
+ if(comdid==L"print:PrintDialog")
{
if(updated)
{
- int res = win32::MessageBox(this.GetHWND(), "单据已制作,是否保存?","提示",4);
- if(res == 6)OnCmdDispatch("print:AddToDocumentList");
+ int res = win32::MessageBox(this.GetHWND(), L"单据已制作,是否保存?",L"提示",4);
+ if(res == 6)OnCmdDispatch(L"print:AddToDocumentList");
}
if(GetParam())
{
xaserverarg arg1 = new xaserverarg;
arg1.setNativePointer(GetParam());
- arg1.AddArg("action","new");
+ arg1.AddArg(L"action",L"new");
OnPrintDialog();
- arg1.AddArg("action","");
+ arg1.AddArg(L"action",L"");
}
return 1;
}
- if(comdid.find("print:toExcel",0)>=0) {
+ if(comdid.find(L"print:toExcel",0)>=0) {
updated = true;
return OntoExcel();
}
- if(comdid.find("print:Export",0)>=0) {
+ if(comdid.find(L"print:Export",0)>=0) {
updated = true;
return OnExport();
}
- if(comdid.find("print:SaveAs",0)>=0) return OnSaveAs();
- if(comdid.find("print:Edit",0)>=0) {
+ if(comdid.find(L"print:SaveAs",0)>=0) return OnSaveAs();
+ if(comdid.find(L"print:Edit",0)>=0) {
updated = true;
return OnEdit();
}
- if(comdid.find("action:Close",0)>=0) return CloseWindow();
- if(comdid=="print:OpenDocument") return OnOpenDocument();
- if(comdid=="print:AddToDocumentList") return OnAddToDocument();
- if(comdid.find("action:",0)>=0) return ProcessFlowAction(comdid, 1);
+ if(comdid.find(L"action:Close",0)>=0) return CloseWindow();
+ if(comdid==L"print:OpenDocument") return OnOpenDocument();
+ if(comdid==L"print:AddToDocumentList") return OnAddToDocument();
+ if(comdid.find(L"action:",0)>=0) return ProcessFlowAction(comdid, 1);
- if(comdid.left(3) == "xmSort")
+ if(comdid.left(3) == L"xmSort")
{
//string str =
return 1;
}
- if(comdid.left(3) == "IK_")
+ if(comdid.left(3) == L"IK_")
{
string cmd = comdid.mid(3, comdid.length());
SendCtrlCmd(cell,cmd);
return 1;
}
- if(comdid=="print:MaintTemplate")
+ if(comdid==L"print:MaintTemplate")
{
- OpenWindow("dev:xpage[Maint.Template.Print.vx]");
+ OpenWindow(L"dev:xpage[Maint.Template.Print.vx]");
return 1;
}
- if(comdid == "print:RefreshData"){
+ if(comdid == L"print:RefreshData"){
return OnRefreshData();
}
- if(comdid == "xxx")
+ if(comdid == L"xxx")
{
ole_print.ExecWB(27,0);
return 1;
- alert("xxx");
+ alert(L"xxx");
xml x1 = new xml;
x1.setNativePointer(xml::CreateInstance());
- xaserver::ExecXQuery(GetServerUrl(), "[xsl.getdevobj.xq]","<args/>",x1);
+ xaserver::ExecXQuery(GetServerUrl(), L"[xsl.getdevobj.xq]",L"<args/>",x1);
}
- if(comdid == "xxx")
+ if(comdid == L"xxx")
{
xml x = new xml;
x.setNativePointer(xml::CreateInstance());
xaserverarg arg = new xaserverarg;
arg.setNativePointer(arg.CreateInstance());
- arg.AddArg("strHtml",m_strHtml);
- if (url::get("/sale/data/SysPrintTemplate/WebBrowser",arg.GetString(),x) != 1)
+ arg.AddArg(L"strHtml",m_strHtml);
+ if (url::get(L"/sale/data/SysPrintTemplate/WebBrowser",arg.GetString(),x) != 1)
{
- alert("数据集出错了!");
+ alert(L"数据集出错了!");
return 0;
}
string strHtml = x.GetXml();
@@ -1136,9 +1136,9 @@
int OnAttachEvent()
{
- AttachEvent("WM_XCOMMAND",OnXCommand);
- AttachEvent("WM_SETFOCUS",OnSetFocus);
- //AttachEvent("WM_CLOSE",OnCloseOwnerWindow);
+ AttachEvent(L"WM_XCOMMAND",OnXCommand);
+ AttachEvent(L"WM_SETFOCUS",OnSetFocus);
+ //AttachEvent(L"WM_CLOSE",OnCloseOwnerWindow);
return 0;
}
@@ -1156,10 +1156,10 @@
int IDYES = 6;
int IDNO = 7;
int IDCANCEL = 2;
- int re = win32::MessageBox(this.GetHWND(), "单据已制作,是否保存?","提示:",MB_YESNOCANCEL);
+ int re = win32::MessageBox(this.GetHWND(), L"单据已制作,是否保存?",L"提示:",MB_YESNOCANCEL);
if(re==IDCANCEL) return -1;
if(re==IDNO) return 1;
- OnCmdDispatch("print:AddToDocumentList");
+ OnCmdDispatch(L"print:AddToDocumentList");
return -1;
}
@@ -1167,18 +1167,18 @@
{
OnAttachEvent();
AttachCloseWindow();
- ole_print = GetControl("ole_print");
- cell = GetControl("xcell");
+ ole_print = GetControl(L"ole_print");
+ cell = GetControl(L"xcell");
//showgrid = false;
editing = false;
SetAgent();
m_dataset = 0;
- billName = "";
- billID = "";
- billPre = "";
- m_DocumentID = "";
+ billName = L"";
+ billID = L"";
+ billPre = L"";
+ m_DocumentID = L"";
PaperPrint = false;
return 1;
@@ -1191,8 +1191,8 @@
{
xaserverarg arg = new xaserverarg;
arg.setNativePointer(GetParam());
- string templateName = arg.GetArgString("template-name");
- if(templateName =="")
+ string templateName = arg.GetArgString(L"template-name");
+ if(templateName ==L"")
{
OnPrintDialog();
}
@@ -1202,12 +1202,12 @@
win32::SetWindowText(GetHWND(),templateName);
OnHtml(arg);
billName = templateName;
- billPre = arg.GetArgString("template-pre");
- billID = arg.GetArgString("template-guid");
- m_EntityID = arg.GetArgString("EntityID");
- m_EntityNo = arg.GetArgString("EntityNo");
- m_EntityName = arg.GetArgString("EntityName");
- m_DocumentID = "";
+ billPre = arg.GetArgString(L"template-pre");
+ billID = arg.GetArgString(L"template-guid");
+ m_EntityID = arg.GetArgString(L"EntityID");
+ m_EntityNo = arg.GetArgString(L"EntityNo");
+ m_EntityName = arg.GetArgString(L"EntityName");
+ m_DocumentID = L"";
}
}else
OnPrintDialog();
diff --git a/jrj/project/workflow/workflow.actionlog.cpp b/jrj/project/workflow/workflow.actionlog.cpp
index b8dc383..51ba3d8 100644
--- a/jrj/project/workflow/workflow.actionlog.cpp
+++ b/jrj/project/workflow/workflow.actionlog.cpp
@@ -1,66 +1,69 @@
-class workflow_actionlog : public win__
+#include <wobject/xwin.hpp>
+#include <xcontrol/xdwgrid.hpp>
+#include <xcontrol/xflowchart.hpp>
+#include <xcontrol/ximageview.hpp>
+
+using xml = KXMLDOMDocument;
+class __declspec(dllexport) workflow_actionlog : public xwin
+{
+public:
+ workflow_actionlog(void* implPtr, HWND hWnd) :xwin(implPtr, hWnd) {}
+ static workflow_actionlog* CreateInstance(void* implPtr, void* hWnd)
+ {
+ workflow_actionlog* pWin = new workflow_actionlog(implPtr, (HWND)hWnd);
+ return pWin;
+ }
+
+public:
+ //命令发布函数
+ int OnCmdDispatch(xstring comdid)
+ {
+ CloseWindow();
+ return 0;
+ }
+
+ //命令处理事件
+ int OnXCommand(TEvent* evt, int param)
+ {
+ return OnCmdDispatch(evt->xcommand.pStrID);
+ }
+
+ int OnAttachEvent()
+ {
+ //绑定工具条点击事件
+ AttachEvent(L"WM_XCOMMAND", (FEvent)& workflow_actionlog::OnXCommand);
+ return 1;
+ }
+
+
+ int onload()
+ {
+ SetArg();
+ OnAttachEvent();
+
+ xdwgrid dw_loglist = GetControl(L"dw_loglist");
+ dw_loglist.openUrl(L"/sale/view/workflow.view/template/chkdlg/loglist");
+
+ if (GetWinParam())
{
- //命令发布函数
- int OnCmdDispatch(string comdid)
- {
- CloseWindow();
- return 0;
- }
-
- //命令处理事件
- int OnXCommand(ref TXCommandEvent evt,int param)
- {
- return OnCmdDispatch(evt.pStrID);
- }
+ xaserverarg argx;
+ xaserverarg arg = GetArg();
+ argx.AddArg(L"EntityID", arg.GetArgString(L"EntityID"));
+ xml x;
+ xurl::get(L"/sale/data/workflow.core/workflow/chk/loglist", argx.GetString(), x);
+ dw_loglist.Retrieve(x);
+ dw_loglist.SetReadOnly(true);
- int OnAttachEvent()
- {
- //绑定工具条点击事件
- AttachEvent("WM_XCOMMAND",OnXCommand);
- }
-
-
- int onload()
- {
- OnAttachEvent();
-
- xdwgrid__ dw_loglist = new xdwgrid__;
- dw_loglist.setNativePointer(GetControl("dw_loglist"));
- dw_loglist.openUrl("/sale/view/workflow.view/template/chkdlg/loglist");
-
- if(this.GetParam())
- {
- xaserverarg__ argx = new xaserverarg__;
- argx.setNativePointer(argx.CreateInstance());
- xaserverarg__ arg = this.GetParam();
- argx.AddArg("EntityID",arg.GetArgString("EntityID"));
- xml__ x = new xml__;
- x.setNativePointer(xml__ ::CreateInstance());
- url::get("/sale/data/workflow.core/workflow/chk/loglist", argx.GetString(), x);
- dw_loglist.Retrieve(x);
- dw_loglist.SetReadOnly(true);
-
- xflowchart__ dw_chart = new xflowchart__;
- dw_chart.setNativePointer(GetControl("dw_logchart"));
- xml__ xc = new xml__;
- xc.setNativePointer(xml__ ::CreateInstance());
- url::get("/sale/data/workflow.core/workflow/chk/logchart", argx.GetString(), xc);
- msxml::IXMLDOMElement e = xc.GetXmlDoc().documentElement;
- dw_chart.LoadEx(e);
-
- /*
- string xbox = "<vbox><ximage name='pic' transparent='1' src='/business/flow/"+arg.GetArgString("EntityName")+".jpg'/></vbox>";
- xnode__ anode = new xnode__;
- anode.setNativePointer(GetAgentNode("flowimage"));
- SetAgentNodeContent (anode,xbox);*/
-
- imageview__ im = new imageview__;
- im.setNativePointer(GetControl("image"));
- //alert(arg.GetArgString("EntityName"));
- im.AddImages("/business/flow/"+arg.GetArgString("EntityName")+".jpg");
- }
-
- return 1;
- }
+ xflowchart dw_chart = GetControl(L"dw_logchart");
+ xml xc;
+ xurl::get(L"/sale/data/workflow.core/workflow/chk/logchart", argx.GetString(), xc);
+ KXMLDOMElement e = xc.documentElement();
+ dw_chart.Load(e);
- }
\ No newline at end of file
+ ximageview im = GetControl(L"image");
+ im.AddImages((xstring)L"/business/flow/" + arg.GetArgString(L"EntityName") + L".jpg");
+ }
+ return 1;
+ }
+
+};
\ No newline at end of file
diff --git a/jrj/project/workflow/workflow.actionlog_vd.cpp b/jrj/project/workflow/workflow.actionlog_vd.cpp
index 8636365..4a3e131 100644
--- a/jrj/project/workflow/workflow.actionlog_vd.cpp
+++ b/jrj/project/workflow/workflow.actionlog_vd.cpp
@@ -1,70 +1,68 @@
-class workflow_actionlog_vd : public win__
+#include <wobject/xwin.hpp>
+#include <xcontrol/xdwgrid.hpp>
+#include <xcontrol/xflowchart.hpp>
+#include <xcontrol/ximageview.hpp>
+
+using xml = KXMLDOMDocument;
+class __declspec(dllexport) workflow_actionlog_vd : public xwin
+{
+public:
+ workflow_actionlog_vd(void* implPtr, HWND hWnd) :xwin(implPtr, hWnd) {}
+ static workflow_actionlog_vd* CreateInstance(void* implPtr, void* hWnd)
+ {
+ workflow_actionlog_vd* pWin = new workflow_actionlog_vd(implPtr, (HWND)hWnd);
+ return pWin;
+ }
+public:
+ //命令发布函数
+ int OnCmdDispatch(xstring comdid)
+ {
+ CloseWindow();
+ return 0;
+ }
+
+ //命令处理事件
+ int OnXCommand(TEvent* evt, int param)
+ {
+ return OnCmdDispatch(evt->xcommand.pStrID);
+ }
+
+ int OnAttachEvent()
+ {
+ //绑定工具条点击事件
+ AttachEvent(L"WM_XCOMMAND", (FEvent)&workflow_actionlog_vd::OnXCommand);
+ return 1;
+ }
+
+
+ int onload()
+ {
+ SetArg();
+ OnAttachEvent();
+
+ xdwgrid dw_loglist = GetControl(L"dw_loglist");
+ dw_loglist.openUrl(L"/sale/view/workflow.view/template/chkdlg/loglist");
+
+ if (GetWinParam())
{
- //命令发布函数
- int OnCmdDispatch(string comdid)
- {
- CloseWindow();
- return 0;
- }
-
- //命令处理事件
- int OnXCommand(ref TXCommandEvent evt,int param)
- {
- return OnCmdDispatch(evt.pStrID);
- }
+ xaserverarg argx;
+ xaserverarg arg = GetArg();
+ argx.AddArg(L"EntityID", arg.GetArgString(L"EntityID"));
+ xml x;
+ xurl::get(L"/sale/data/workflow.core/workflow/chk/loglist", argx.GetString(), x);
+ dw_loglist.Retrieve(x);
+ dw_loglist.SetReadOnly(true);
- int OnAttachEvent()
- {
- //绑定工具条点击事件
- AttachEvent("WM_XCOMMAND",OnXCommand);
- }
-
-
- int onload()
- {
- OnAttachEvent();
-
-
- xdwgrid__ dw_loglist = new xdwgrid__;
- dw_loglist.setNativePointer(GetControl("dw_loglist"));
- dw_loglist.openUrl("/sale/view/workflow.view/template/chkdlg/loglist");
- if(this.GetParam())
- {
+ xflowchart dw_chart = GetControl(L"dw_logchart");
+ xml xc;
+ xurl::get(L"/sale/data/workflow.core/workflow/chk/logchart", argx.GetString(), xc);
+ KXMLDOMElement e = xc.documentElement();
+ dw_chart.Load(e);
-
- int iArgs = GetParam();
- xaserverarg__ argx = new xaserverarg__;
- argx.setNativePointer(iArgs);
-
- argx.AddArg("EntityID",argx.GetArgString("EntityID"));
-
- xml__ x = new xml__;
- x.setNativePointer(xml__ ::CreateInstance());
- url::get("/sale/data/workflow.core/workflow/chk/loglist", argx.GetString(), x);
- dw_loglist.Retrieve(x);
- dw_loglist.SetReadOnly(true);
-
- xflowchart__ dw_chart = new xflowchart__;
- dw_chart.setNativePointer(GetControl("dw_logchart"));
- xml__ xc = new xml__;
- xc.setNativePointer(xml__ ::CreateInstance());
- url::get("/sale/data/workflow.core/workflow/chk/logchart", argx.GetString(), xc);
- msxml::IXMLDOMElement e = xc.GetXmlDoc().documentElement;
- dw_chart.LoadEx(e);
-
- /*
- string xbox = "<vbox><ximage name='pic' transparent='1' src='/business/flow/"+arg.GetArgString("EntityName")+".jpg'/></vbox>";
- xnode__ anode = new xnode__;
- anode.setNativePointer(GetAgentNode("flowimage"));
- SetAgentNodeContent (anode,xbox);*/
-
- imageview__ im = new imageview__;
- im.setNativePointer(GetControl("image"));
- trace(argx.GetArgString("EntityName"));
- im.AddImages("/business/flow/"+argx.GetArgString("EntityName")+".jpg");
- }
-
- return 1;
- }
+ ximageview im = GetControl(L"image");
+ im.AddImages((xstring)L"/business/flow/" + arg.GetArgString(L"EntityName") + L".jpg");
+ }
+ return 1;
+ }
- }
\ No newline at end of file
+};
\ No newline at end of file
diff --git a/jrj/project/workflow/workflow.chkdlg.cpp b/jrj/project/workflow/workflow.chkdlg.cpp
index 5b60cd1..145cdda 100644
--- a/jrj/project/workflow/workflow.chkdlg.cpp
+++ b/jrj/project/workflow/workflow.chkdlg.cpp
@@ -1,68 +1,77 @@
-class workflow_chkdlg : public win__
+#include <wobject/xwin.hpp>
+#include <xcontrol/xdwgrid.hpp>
+#include <xcontrol/xflowchart.hpp>
+#include <xcontrol/ximageview.hpp>
+
+using xml = KXMLDOMDocument;
+class __declspec(dllexport) workflow_chkdlg : public xwin
+{
+public:
+ workflow_chkdlg(void* implPtr, HWND hWnd) :xwin(implPtr, hWnd) {}
+ static workflow_chkdlg* CreateInstance(void* implPtr, void* hWnd)
+ {
+ workflow_chkdlg* pWin = new workflow_chkdlg(implPtr, (HWND)hWnd);
+ return pWin;
+ }
+public:
+
+ //命令发布函数
+ int OnCmdDispatch(string comdid)
+ {
+ if (GetWinParam())
{
- //命令发布函数
- int OnCmdDispatch(string comdid)
+ xaserverarg arg = GetArg();
+ if (comdid == L"xmOK")
{
- if(this.GetParam())
- {
- if(comdid=="xmOK")
- {
- control__ xc = new control__;
- xc.setNativePointer(GetControl("content"));
- string str = ""+xc.GetText();
- //trace(str);
- xaserverarg__ arg = this.GetParam();
- arg.AddArg("content",str);
- }
- arg.AddArg("comdid",comdid);
- }
- CloseWindow();
- return 0;
+ xcontrol xc = GetControl(L"content");
+ arg.AddArg(L"content", xc.GetText());
}
-
- //命令处理事件
- int OnXCommand(ref TXCommandEvent evt,int param)
- {
- return OnCmdDispatch(evt.pStrID);
- }
+ arg.AddArg(L"comdid", comdid);
+ }
+ CloseWindow();
+ return 0;
+ }
- int OnAttachEvent()
- {
- //绑定工具条点击事件
- AttachEvent("WM_XCOMMAND",OnXCommand);
- }
-
-
- int onload()
- {
- OnAttachEvent();
- xaserverarg__ arg;
- if(this.GetParam())
- {
- arg = this.GetParam();
- control__ xc = new control__;
- xc.setNativePointer(GetControl("content"));
- xc.SetText(""+arg.GetArgString("content"));
- }
-
- xdwgrid__ dw_loglist = new xdwgrid__;
- dw_loglist.setNativePointer(GetControl("dw_loglist"));
- dw_loglist.openUrl("/sale/view/workflow.view/template/chkdlg/loglist");
-
- if(this.GetParam())
- {
- xaserverarg__ argx = new xaserverarg__;
- argx.setNativePointer(argx.CreateInstance());
- arg = this.GetParam();
- argx.AddArg("EntityID",arg.GetArgString("EntityID"));
- xml__ x = new xml__;
- x.setNativePointer(xml__ ::CreateInstance());
- url::get("/sale/data/workflow.core/workflow/chk/loglist", argx.GetString(), x);
- dw_loglist.Retrieve(x);
- dw_loglist.SetReadOnly(true);
- }
-
- return 1;
- }
+ //命令处理事件
+ int OnXCommand(TEvent* evt, int param)
+ {
+ return OnCmdDispatch(evt->xcommand.pStrID);
+ }
- }
\ No newline at end of file
+ int OnAttachEvent()
+ {
+ //绑定工具条点击事件
+ AttachEvent(L"WM_XCOMMAND", (FEvent)&workflow_chkdlg::OnXCommand);
+ return 1;
+ }
+
+
+ int onload()
+ {
+ SetArg();
+ OnAttachEvent();
+ xaserverarg arg;
+ if (GetWinParam())
+ {
+ arg = GetArg();
+ xcontrol xc = GetControl(L"content");
+ xc.SetText(arg.GetArgString(L"content"));
+ }
+
+ xdwgrid dw_loglist = GetControl(L"dw_loglist");
+ dw_loglist.openUrl(L"/sale/view/workflow.view/template/chkdlg/loglist");
+
+ if (GetWinParam())
+ {
+ xaserverarg argx;
+ arg = GetArg();
+ argx.AddArg(L"EntityID", arg.GetArgString(L"EntityID"));
+ xml x ;
+ xurl::get(L"/sale/data/workflow.core/workflow/chk/loglist", argx.GetString(), x);
+ dw_loglist.Retrieve(x);
+ dw_loglist.SetReadOnly(true);
+ }
+
+ return 1;
+ }
+};
\ No newline at end of file
diff --git a/jrj/project/workflow/workflow.chkdlg_vd.cpp b/jrj/project/workflow/workflow.chkdlg_vd.cpp
index c6d51e8..8e86760 100644
--- a/jrj/project/workflow/workflow.chkdlg_vd.cpp
+++ b/jrj/project/workflow/workflow.chkdlg_vd.cpp
@@ -1,76 +1,77 @@
-class workflow_chkdlg_vd : public win__
+#include <wobject/xwin.hpp>
+#include <xcontrol/xdwgrid.hpp>
+#include <xcontrol/xflowchart.hpp>
+#include <xcontrol/ximageview.hpp>
+
+using xml = KXMLDOMDocument;
+class __declspec(dllexport) workflow_chkdlg_vd : public xwin
+{
+public:
+ workflow_chkdlg_vd(void* implPtr, HWND hWnd) :xwin(implPtr, hWnd) {}
+ static workflow_chkdlg_vd* CreateInstance(void* implPtr, void* hWnd)
+ {
+ workflow_chkdlg_vd* pWin = new workflow_chkdlg_vd(implPtr, (HWND)hWnd);
+ return pWin;
+ }
+public:
+
+ //命令发布函数
+ int OnCmdDispatch(string comdid)
+ {
+ if (GetWinParam())
{
- //命令发布函数
- int OnCmdDispatch(string comdid)
+ xaserverarg arg = GetArg();
+ if (comdid == L"xmOK")
{
- if(this.GetParam())
- {
- if(comdid=="xmOK")
- {
- control__ xc = new control__;
- xc.setNativePointer(GetControl("content"));
- string str = ""+xc.GetText();
- //trace(str);
- int iArgs = GetParam();
- xaserverarg__ arg = new xaserverarg__;
- arg.setNativePointer(iArgs);
- arg.AddArg("content",str);
- }
- arg.AddArg("comdid",comdid);
- }
- CloseWindow();
- return 0;
+ xcontrol xc = GetControl(L"content");
+ arg.AddArg(L"content", xc.GetText());
}
-
- //命令处理事件
- int OnXCommand(ref TXCommandEvent evt,int param)
- {
- return OnCmdDispatch(evt.pStrID);
- }
+ arg.AddArg(L"comdid", comdid);
+ }
+ CloseWindow();
+ return 0;
+ }
- int OnAttachEvent()
- {
- //绑定工具条点击事件
- AttachEvent("WM_XCOMMAND",OnXCommand);
- }
-
-
- int onload()
- {
- //alert("新的");
- OnAttachEvent();
- xaserverarg__ arg;
- if(this.GetParam())
- {
- int iArgsx = this.GetParam();
- arg = new xaserverarg__;
- arg.setNativePointer(iArgsx);
- //trace(iArgsx);
- control__ xc = new control__;
- xc.setNativePointer(GetControl("content"));
- xc.SetText(""+arg.GetArgString("content"));
- }
-
- xdwgrid__ dw_loglist = new xdwgrid__;
- dw_loglist.setNativePointer(GetControl("dw_loglist"));
- dw_loglist.openUrl("/sale/view/workflow.view/template/chkdlg/loglist");
-
- if(this.GetParam())
- {
+ //命令处理事件
+ int OnXCommand(TEvent* evt, int param)
+ {
+ return OnCmdDispatch(evt->xcommand.pStrID);
+ }
- int iArgs = GetParam();
- xaserverarg__ argx = new xaserverarg__;
- argx.setNativePointer(iArgs);
-
- argx.AddArg("EntityID",arg.GetArgString("EntityID"));
- xml__ x = new xml__;
- x.setNativePointer(xml__ ::CreateInstance());
- url::get("/sale/data/workflow.core/workflow/chk/loglist", argx.GetString(), x);
- dw_loglist.Retrieve(x);
- dw_loglist.SetReadOnly(true);
- }
-
- return 1;
- }
+ int OnAttachEvent()
+ {
+ //绑定工具条点击事件
+ AttachEvent(L"WM_XCOMMAND", (FEvent)&workflow_chkdlg_vd::OnXCommand);
+ return 1;
+ }
- }
\ No newline at end of file
+
+ int onload()
+ {
+ SetArg();
+ OnAttachEvent();
+ xaserverarg arg;
+ if (GetWinParam())
+ {
+ arg = GetArg();
+ xcontrol xc = GetControl(L"content");
+ xc.SetText(arg.GetArgString(L"content"));
+ }
+
+ xdwgrid dw_loglist = GetControl(L"dw_loglist");
+ dw_loglist.openUrl(L"/sale/view/workflow.view/template/chkdlg/loglist");
+
+ if (GetWinParam())
+ {
+ xaserverarg argx;
+ arg = GetArg();
+ argx.AddArg(L"EntityID", arg.GetArgString(L"EntityID"));
+ xml x;
+ xurl::get(L"/sale/data/workflow.core/workflow/chk/loglist", argx.GetString(), x);
+ dw_loglist.Retrieve(x);
+ dw_loglist.SetReadOnly(true);
+ }
+
+ return 1;
+ }
+};
\ No newline at end of file
diff --git a/jrj/xframe/kobject/kflowchart.hpp b/jrj/xframe/kobject/kflowchart.hpp
new file mode 100644
index 0000000..0417574
--- /dev/null
+++ b/jrj/xframe/kobject/kflowchart.hpp
@@ -0,0 +1,110 @@
+#pragma once
+#include "kcontrol.hpp"
+
+namespace Hxsoft { namespace XFrame {namespace XOffice {namespace XFlowChart{
+
+ //this interface all index param start by one
+ typedef int XFODrawState;
+ #define XFOSELECTION 0x0000
+ #define XFOLINK 0x0001
+ #define XFOWORKNODE 0x0002
+
+ typedef int XFOState;
+ #define XFONORMAL 0x0000
+ #define XFOSELECTED 0x0001
+ #define XFOMOVING 0x0002
+ #define XFORESIZING 0x0004
+ #define XFOLINKING 0x0008
+ #define XFOCREATING 0x0010
+ #define XFOWORKNODING 0x0020
+ #define XFOREADONLY 0x1000
+ #define XFORUNSTATE 0x8000
+
+ typedef int XFOHitPosition;
+ #define XFOHITNONE 0x0000
+ #define XFOHITLEFTTOP 0x0001
+ #define XFOHITRIGHTTOP 0x0002
+ #define XFOHITRIGHTBOTTOM 0x0004
+ #define XFOHITLEFTBOTTOM 0x0008
+
+ #define XFOHITTOPCENTER 0x0010
+ #define XFOHITRIGHTCENTER 0x0020
+ #define XFOHITBOTTOMCENTER 0x0040
+ #define XFOHITLEFTCENTER 0x0080
+
+ class XFlowChartObject
+ {
+ public:
+ typedef int XFlowChartObjectStatus;
+ public:
+ int LoadObject(KXMLDOMElement pElement);
+ int LoadObjectXml(LPTSTR pStrXml);
+ public:
+ void SetFRect(RECT rect);
+ public:
+ XFOHitPosition GetHitResizePat(POINT pt);
+ public:
+ void InvalidatePatRgn(HWND hWnd, POINT& ptOffset);
+ void HitAdjust(XFOHitPosition htpos, int cx, int cy);
+ public:
+ int TestHotHited(POINT pt, RECT& rc);
+ int DrawHoted(HDC hPaintDC, int nIndex);
+ public:
+ LPTSTR GetCaption();
+ KXMLDOMElement GetElement();
+ LPTSTR GetShapeType();
+ RECT& GetRect();
+ public:
+ bool SetUrl(LPTSTR pUrl);
+ bool SetCaption(LPTSTR pCaption);
+ LPTSTR GetUrl();
+ LPTSTR GetGuid();
+ };
+
+ #define FXOLineStyle int
+ #define FXOLINENORMAL 0x0000
+ #define FXOLINEDIRECT 0x0001
+ #define FXOLINECURVE 0x0002
+ #define FXOLINEOWNER 0x0100
+
+ class XFlowChartLink
+ {
+ public:
+ int DrawHoted(HDC hPaintDC, int nIndex);
+ public:
+ //int AutoCalcPoints(const vector<RECT>* rects = NULL);
+ //int AutoCalcPoints(POINT ptStart, int paStart, POINT ptEnd, int paEnd, FXOLineStyle dwLineStyle, const vector<RECT>* rects, vector<POINT>* pts);
+ public:
+ //int LoadObject(vector<class XFlowChartObject*>& DrawObjects, KXMLDOMElement pElement);
+ bool IsHoted(int x, int y);
+ public:
+ XFlowChartObject* GetStartObject();
+ XFlowChartObject* GetEndObject();
+ };
+
+ class IFlowChart :public IXFControl
+ {
+ public:
+ XFlowChartObject* GetSelectedObject();
+ bool SelectedObject(XFlowChartObject* pObject);
+ public:
+ int GetObjectCount();
+ XFlowChartObject* GetObjectByIndex(int nIndex);
+
+ int GetLinkCount();
+ XFlowChartLink* GetLinkbyIndex(int nIndex);
+ public:
+ bool RemoveObject(XFlowChartObject* pObject, bool bDeletedLink = true);
+ XFlowChartObject* AddObject(LPTSTR pShapeType, LPTSTR pCaption, LPTSTR pUrl = NULL, RECT* pRect = NULL);
+ public:
+ bool SetobjectUrl(XFlowChartObject* pObject, LPTSTR pUrl);
+ bool SetobjectCaption(XFlowChartObject* pObject, LPTSTR pCaption);
+ public:
+ XFlowChartLink* AddLink(XFlowChartObject* pFrom, XFlowChartObject* pTo, bool bDoubleArrow = true);
+ public:
+ XFlowChartObject* GetObjectAt(POINT pt);
+ public:
+ int Save(KXMLDOMElement pElement);
+ int Load(KXMLDOMElement pElement);
+ };
+}}}}
\ No newline at end of file
diff --git a/jrj/xframe/xcontrol/xflowchart.hpp b/jrj/xframe/xcontrol/xflowchart.hpp
new file mode 100644
index 0000000..fac615b
--- /dev/null
+++ b/jrj/xframe/xcontrol/xflowchart.hpp
@@ -0,0 +1,205 @@
+#pragma once
+
+#include "wobject/xcontrol.hpp"
+#include "kobject/kflowchart.hpp"
+
+using kflowchart = Hxsoft::XFrame::XOffice::XFlowChart::IFlowChart;
+using kflowchartlink = Hxsoft::XFrame::XOffice::XFlowChart::XFlowChartLink;
+using kflowchartobject = Hxsoft::XFrame::XOffice::XFlowChart::XFlowChartObject;
+
+struct FLCNMHDR : public NMHDR
+{
+ LPTSTR pWorkNode;
+ kflowchartobject* pObj;
+ kflowchartlink* pLink;
+};
+
+class xflowchartobject :public xnative
+{
+public:
+ xflowchartobject(void* impl) :xnative(impl) {}
+public:
+ kflowchartobject* GetKFlowchartobject()
+ {
+ return (kflowchartobject*)this->GetNativePtr();
+ }
+public:
+ int LoadObject(KXMLDOMElement pElement)
+ {
+ return GetKFlowchartobject()->LoadObject(pElement);
+ }
+ int LoadObjectXml(LPTSTR pStrXml)
+ {
+ return GetKFlowchartobject()->LoadObjectXml(pStrXml);
+ }
+public:
+ void SetFRect(RECT rect)
+ {
+ return GetKFlowchartobject()->SetFRect(rect);
+ }
+public:
+ Hxsoft::XFrame::XOffice::XFlowChart::XFOHitPosition GetHitResizePat(POINT pt)
+ {
+ return GetKFlowchartobject()->GetHitResizePat(pt);
+ }
+public:
+ void InvalidatePatRgn(HWND hWnd, POINT& ptOffset)
+ {
+ return GetKFlowchartobject()->InvalidatePatRgn(hWnd, ptOffset);
+ }
+ void HitAdjust(Hxsoft::XFrame::XOffice::XFlowChart::XFOHitPosition htpos, int cx, int cy)
+ {
+ return GetKFlowchartobject()->HitAdjust(htpos, cx, cy);
+ }
+public:
+ int TestHotHited(POINT pt, RECT& rc)
+ {
+ return GetKFlowchartobject()->TestHotHited(pt, rc);
+ }
+ int DrawHoted(HDC hPaintDC, int nIndex)
+ {
+ return GetKFlowchartobject()->DrawHoted(hPaintDC, nIndex);
+ }
+public:
+ LPTSTR GetCaption()
+ {
+ return GetKFlowchartobject()->GetCaption();
+ }
+ KXMLDOMElement GetElement()
+ {
+ return GetKFlowchartobject()->GetElement();
+ }
+ LPTSTR GetShapeType()
+ {
+ return GetKFlowchartobject()->GetShapeType();
+ }
+ RECT& GetRect()
+ {
+ return GetKFlowchartobject()->GetRect();
+ }
+public:
+ bool SetUrl(LPTSTR pUrl)
+ {
+ return GetKFlowchartobject()->SetUrl(pUrl);
+ }
+ bool SetCaption(LPTSTR pCaption)
+ {
+ return GetKFlowchartobject()->SetCaption(pCaption);
+ }
+ LPTSTR GetUrl()
+ {
+ return GetKFlowchartobject()->GetUrl();
+ }
+ LPTSTR GetGuid()
+ {
+ return GetKFlowchartobject()->GetGuid();
+ }
+};
+
+class xflowchartlink : public xnative
+{
+public:
+ xflowchartlink(void* impl) :xnative(impl) {}
+public:
+ kflowchartlink* GetKFlowchartLink() {
+ return (kflowchartlink*)GetNativePtr();
+ }
+public:
+ int DrawHoted(HDC hPaintDC, int nIndex)
+ {
+ return GetKFlowchartLink()->DrawHoted(hPaintDC, nIndex);
+ }
+public:
+ bool IsHoted(int x, int y)
+ {
+ return GetKFlowchartLink()->IsHoted(x,y);
+ }
+public:
+ kflowchartobject* GetStartObject()
+ {
+ return GetKFlowchartLink()->GetStartObject();
+ }
+ kflowchartobject* GetEndObject()
+ {
+ return GetKFlowchartLink()->GetEndObject();
+ }
+};
+
+class xflowchart :public xcontrol
+{
+public:
+ xflowchart(void* impl) :xcontrol(impl) {}
+public:
+ kflowchart* GetKFlowChart()
+ {
+ return (kflowchart*)GetNativePtr();
+ }
+public:
+ kflowchartobject* GetSelectedObject()
+ {
+ return GetKFlowChart()->GetSelectedObject();
+ }
+ bool SelectedObject(kflowchartobject* pObject)
+ {
+ return GetKFlowChart()->SelectedObject(pObject);
+ }
+public:
+ int GetObjectCount()
+ {
+ return GetKFlowChart()->GetObjectCount();
+ }
+ kflowchartobject* GetObjectByIndex(int nIndex)
+ {
+ return GetKFlowChart()->GetObjectByIndex(nIndex);
+ }
+
+ int GetLinkCount()
+ {
+ return GetKFlowChart()->GetLinkCount();
+ }
+ kflowchartlink* GetLinkbyIndex(int nIndex)
+ {
+ return GetKFlowChart()->GetLinkbyIndex(nIndex);
+ }
+public:
+ bool RemoveObject(kflowchartobject* pObject, bool bDeletedLink = true)
+ {
+ return GetKFlowChart()->RemoveObject(pObject, bDeletedLink);
+ }
+ kflowchartobject* AddObject(LPTSTR pShapeType, LPTSTR pCaption, LPTSTR pUrl = NULL, RECT* pRect = NULL)
+ {
+ return GetKFlowChart()->AddObject(pShapeType, pCaption, pUrl, pRect);
+ }
+public:
+ bool SetobjectUrl(kflowchartobject* pObject, LPTSTR pUrl)
+ {
+ return GetKFlowChart()->SetobjectUrl(pObject, pUrl);
+ }
+ bool SetobjectCaption(kflowchartobject* pObject, LPTSTR pCaption)
+ {
+ return GetKFlowChart()->SetobjectCaption(pObject, pCaption);
+ }
+public:
+ kflowchartlink* AddLink(kflowchartobject* pFrom, kflowchartobject* pTo, bool bDoubleArrow = true)
+ {
+ return GetKFlowChart()->AddLink(pFrom, pTo, bDoubleArrow);
+ }
+public:
+ kflowchartobject* GetObjectAt(POINT pt)
+ {
+ return GetKFlowChart()->GetObjectAt(pt);
+ }
+public:
+ int Save(KXMLDOMElement pElement)
+ {
+ return GetKFlowChart()->Save(pElement);
+ }
+ int Load(KXMLDOMElement pElement)
+ {
+ return GetKFlowChart()->Load(pElement);
+ }
+};
+
+
+
+
--
Gitblit v1.9.3