From 3c2935ab1cb1fc0de54ab8ba388b85ce93fffcf6 Mon Sep 17 00:00:00 2001
From: xj qian <qianxj15@sina.com>
Date: 星期一, 08 七月 2024 18:06:01 +0800
Subject: [PATCH] update total

---
 jrj/project/total3/ViewTotalWin.cpp |   78 ++++++++++++++++++--------------------
 1 files changed, 37 insertions(+), 41 deletions(-)

diff --git a/jrj/project/total3/ViewTotalWin.cpp b/jrj/project/total3/ViewTotalWin.cpp
index f6feafe..ef4b7f1 100644
--- a/jrj/project/total3/ViewTotalWin.cpp
+++ b/jrj/project/total3/ViewTotalWin.cpp
@@ -228,7 +228,7 @@
 			HCURSOR hCursor = xutil::SetCursorWait();
 			KXMLDOMElement e = xcombobox::GetItemData(evt->command.hCtrl, h);
 			SwitchReport(e);
-			PostMessage(GetHWND(), 0x401, L"xmQuery", 0);
+			PostMessage(GetHWND(), 0x401, (WPARAM)L"xmQuery", 0);
 			//OnCmdDispatch(L"xmQuery");
 			xutil::RestoreCursor(hCursor);
 		}
@@ -260,25 +260,25 @@
 	//命令处理事件
 	int OnXCommand(TEvent* evt, int param)
 	{
-		return OnCmdDispatch(evt->command.pStrID);
+		return OnCmdDispatch(evt->xcommand.pStrID);
 	}
 
 	int SendImageMessage(int row)
 	{
 		if (dw_list.GetItemString(row, L"GDNLineID") != L"")
-			SendMessage(hWndImageView, 0x401, (WPARAM)(L"xmRetrieve:GDNLineID:" + dw_list.GetItemString(row, L"GDNLineID"), 0).c_str());
+			SendMessage(hWndImageView, 0x401, (WPARAM)(L"xmRetrieve:GDNLineID:" + dw_list.GetItemString(row, L"GDNLineID")).c_str(),0);
 		else if (dw_list.GetItemString(row, L"ItemID") != L"")
-			SendMessage(hWndImageView, 0x401, (WPARAM)L"xmRetrieve:SKUID:" + dw_list.GetItemString(row, L"ItemID"), 0);
+			SendMessage(hWndImageView, 0x401, (WPARAM)(L"xmRetrieve:SKUID:" + dw_list.GetItemString(row, L"ItemID")).c_str(), 0);
 		else if (dw_list.GetItemString(row, L"SKUID") != L"")
-			SendMessage(hWndImageView, 0x401, (WPARAM)L"xmRetrieve:SKUID:" + dw_list.GetItemString(row, L"SKUID"), 0);
+			SendMessage(hWndImageView, 0x401, (WPARAM)(L"xmRetrieve:SKUID:" + dw_list.GetItemString(row, L"SKUID")).c_str(), 0);
 		else if (dw_list.GetItemString(row, L"GoodsNo") != L"")
-			SendMessage(hWndImageView, 0x401, (WPARAM)L"xmRetrieve:GoodsNo:" + dw_list.GetItemString(row, L"GoodsNo"), 0);
+			SendMessage(hWndImageView, 0x401, (WPARAM)(L"xmRetrieve:GoodsNo:" + dw_list.GetItemString(row, L"GoodsNo")).c_str(), 0);
 		return 1;
 	}
 
-	int OnDWClick(ref TNotifyEvent evt, int p)
+	int OnDWClick(TEvent* evt, int p)
 	{
-		ref DWNMHDR  hdr = trust(evt.pnmh as ref DWNMHDR);
+		DWNMHDR&  hdr = *(DWNMHDR*)evt->notify.pnmh;
 		xstring value = hdr.data;
 		xstring colname = hdr.colname;
 		int row = hdr.row;
@@ -335,18 +335,18 @@
 		}
 		else if (colname == L"HasImage")
 		{
-			xwin pwin = OpenWindow(L"dev:xpage[testImage.vx]", 0);
-			hWndImageView = pwin.GetHWND();
+			xwin* pwin = OpenWindow(L"dev:xpage[testImage.vx]", 0);
+			hWndImageView = pwin->GetHWND();
 			SendImageMessage(row);
 		}
 
 		return 1;
 	}
 
-	int OnRowChanged(ref TNotifyEvent evt, int p)
+	int OnRowChanged(TEvent* evt, int p)
 	{
 
-		ref DWNMHDR  hdr = trust(evt.pnmh as ref DWNMHDR);
+		DWNMHDR& hdr = *(DWNMHDR*)evt->notify.pnmh;
 		int row = hdr.row;
 		if (row < 1) return 1;
 
@@ -360,20 +360,20 @@
 	int ShowRetrieveingTip()
 	{
 		dataretrieveing = true;
-		xwin pwin = OpenWindow(L"dev:xpage[TestRetrieveing.vx]", 0);
-		hWndRetrieveTip = pwin.GetHWND();
+		xwin* pwin = OpenWindow(L"dev:xpage[TestRetrieveing.vx]", 0);
+		hWndRetrieveTip = pwin->GetHWND();
 		return 1;
 	}
 	int CloseRetrieveTip()
 	{
 		dataretrieveing = false;
-		SendMessage(hWndRetrieveTip, 0x401, L"RetrieveFinished", 0);
+		SendMessage(hWndRetrieveTip, 0x401, (WPARAM)L"RetrieveFinished", 0);
 		hWndRetrieveTip = 0;
 
 		return 1;
 	}
 
-	int OnRetrieveFinished(ref TNotifyEvent evt, int p)
+	int OnRetrieveFinished(TEvent* evt, int p)
 	{
 		CloseRetrieveTip();
 		//dataretrieveing = false;
@@ -384,13 +384,13 @@
 	int OnAttachEvent()
 	{
 		//绑定工具条点击事件
-		AttachEvent(L"WM_XCOMMAND", OnXCommand);
+		AttachEvent(L"WM_XCOMMAND", (FEvent)&ViewTotalWin::OnXCommand);
 		//获取焦点事件,用于重置工具条
-		AttachEvent(L"WM_SETFOCUS", OnSetFocus);
-		AttachEvent(L"cb_report", L"CBN_SELCHANGE", OnCombboChanged);
-		AttachEvent(L"dw_report", L"DWV_CLICKED", OnDWClick);
-		AttachEvent(L"dw_report", L"DWV_ROWFOCUSCHANGED", OnRowChanged);//绑定行更改触发事件OnRowChanged
-		AttachEvent(L"dw_report", (0x400 + 81).toString(), OnRetrieveFinished);
+		AttachEvent(L"WM_SETFOCUS", (FEvent)&ViewTotalWin::OnSetFocus);
+		AttachEvent(L"cb_report", L"CBN_SELCHANGE", (FEvent)&ViewTotalWin::OnCombboChanged);
+		AttachEvent(L"dw_report", L"DWV_CLICKED", (FEvent)&ViewTotalWin::OnDWClick);
+		AttachEvent(L"dw_report", L"DWV_ROWFOCUSCHANGED", (FEvent)&ViewTotalWin::OnRowChanged);//绑定行更改触发事件OnRowChanged
+		AttachEvent(L"dw_report", xstring(0x400 + 81), (FEvent)&ViewTotalWin::OnRetrieveFinished);
 	}
 
 	int  OnRetrieve(xstring dataurl, xstring argstr)
@@ -399,8 +399,7 @@
 		if (dataretrieveing) return -1;
 		dw_list.Reset();
 
-		xml x = new.xml();
-		x.setNativePointer(xml::CreateInstance());
+		xml x ;
 		xaserverarg arg ;
 		
 		arg.AddArg(L"arg", argstr);
@@ -408,10 +407,10 @@
 		xstring sheettype = rptEle.getAttribute(L"reporttype");
 		if (sheettype == L"") sheettype = L"report";
 		//ShowRetrieveingTip();
-		if (url::get(dataurl, arg.GetString(), x) != 1)
+		if (xurl::get(dataurl, arg.GetString(), x) != 1)
 		{
 
-			trace(L"错误信息=L" + x.text);
+			trace((xstring)L"错误信息=L" + x.text());
 			dw_list.Redraw();
 			return -1;
 		}
@@ -429,7 +428,7 @@
 			}
 			else if (sheettype == L"office")
 			{
-				dw_office.LoadTemplate(x);
+				dw_office.LoadTemplate(x,0);
 				for (int i = 0; i < dw_office.GetSheetCount(); i++)
 				{
 					xcell sheet = dw_office.GetSheet(i);
@@ -442,12 +441,11 @@
 
 	xml getReportSet(xstring category)
 	{
-		xml x = new.xml();
-		x.setNativePointer(xml::CreateInstance());
+		xml x ;
 		xaserverarg arg ;
 		
 		arg.AddArg(L"category", category);
-		if (url::get(L"/sale/data/Total3/reportset", arg.GetString(), x) != 1)
+		if (xurl::get(L"/sale/data/Total3/reportset", arg.GetString(), x) != 1)
 		{
 			return 0;
 		}
@@ -456,15 +454,14 @@
 
 	xstring GetReportFieldRole()
 	{
-		xml x = new.xml();
-		x.setNativePointer(xml::CreateInstance());
+		xml x ;
 		xaserverarg arg ;
 		
-		if (url::get(L"/sale/data/Total3/report/field", arg.GetString(), x) != 1)
+		if (xurl::get(L"/sale/data/Total3/report/field", arg.GetString(), x) != 1)
 		{
-			return "";
+			return L"";
 		}
-		xstring str = x.text;
+		xstring str = x.text();
 		return str;
 	}
 
@@ -478,25 +475,24 @@
 		fieldRoleStr = GetReportFieldRole();
 
 		argStr = L"";
-		rptEle = 0;
 		xcombobox xc = GetControl(L"cb_report");
 
 		m_category = L"total/trade";
-		if (GetParam()) {
-			xaserverarg arg ;
-			arg.setNativePointer(GetParam());
+		SetArg();
+		if (GetWinParam()) {
+			xaserverarg arg = GetArg();
 			m_category = arg.GetArgString(L"category");
 		}
 		xml x = getReportSet(m_category);
 		if (x)
 		{
 			KXMLDOMNodeList nlist = x.selectNodes(L"//reports/report");
-			int len = nlist.length;
+			int len = nlist.length();
 			for (int i = 0; i < len; i++)
 			{
 				KXMLDOMElement rpt = nlist.item(i);
 				xstring name = rpt.getAttribute(L"name");
-				xcombobox::AddItem(xc.GetId(), name, trust(rpt as int));
+				xc.AddItem( name, rpt);
 				if (i == 0) xc.SetText(name);
 				if (i == 0) rptEle = rpt;
 			}

--
Gitblit v1.9.3