From 7f6a81baf9f4f4560cdde66520c2f41c9af03490 Mon Sep 17 00:00:00 2001
From: xj qian <qianxj15@sina.com>
Date: 星期三, 23 十月 2024 18:07:13 +0800
Subject: [PATCH] update

---
 jrj/xframe/xcontrol/xdwgrid.hpp |  168 +++++++++++++++++++++++++++++++++++---------------------
 1 files changed, 105 insertions(+), 63 deletions(-)

diff --git a/jrj/xframe/xcontrol/xdwgrid.hpp b/jrj/xframe/xcontrol/xdwgrid.hpp
index 8b423d2..ae30a2b 100644
--- a/jrj/xframe/xcontrol/xdwgrid.hpp
+++ b/jrj/xframe/xcontrol/xdwgrid.hpp
@@ -52,7 +52,7 @@
 	{
 		return getKReport()->SaveAs_(pXmlArg);
 	}
-	int SaveAs(KXMLDOMDocument& xml, LPCTSTR pFileName = NULL) //鍙﹀瓨涓�
+	int SaveAs(KXMLDOMDocument xml, LPCTSTR pFileName = NULL) //鍙﹀瓨涓�
 	{
 		return getKReport()->SaveAs_(xml,pFileName);
 	}
@@ -71,6 +71,7 @@
 	int SelectRow(int nRow, bool bSelect = true) { return getKReport()->SelectRow_(nRow, bSelect); }
 	int SelectRow(int sRow, int eRow, bool bSelect = true) { return getKReport()->SelectRow_(sRow, eRow, bSelect); }
 	int GetNextSelectRow(int nStartRow) { return getKReport()->GetNextSelectRow_(nStartRow); }
+	int GetPrevSelectRow(int nStartRow) { return getKReport()->GetPrevSelectRow(nStartRow); }
 	bool IsRowSelected(int nRow) { return getKReport()->IsRowSelected_(nRow); }
 	//int SetSelectBkColor(COLORREF color){return getKReport()->SetSelectBkColor_(color);}
 	int SetSelectionMode(int nMode) { return getKReport()->SetSelectionMode_(nMode); } //0 unselection 1 singleSelection 2 multiselection 3 multiselectionex 
@@ -83,8 +84,8 @@
 	//int Retrieve(ITrans *pTrans,LPCTSTR pDataUrl, LPCTSTR pArgStr);//璇诲彇鏁版嵁
 	int Retrieve(LPCTSTR pDataUrl, LPCTSTR pArgStr) { return getKReport()->Retrieve_(pDataUrl, pArgStr); }//璇诲彇鏁版嵁
 
-	int Retrieve(KXMLDOMElement  pElement) { return getKReport()->Retrieve_(pElement); }//璇诲彇鏁版嵁
-	int Retrieve(KXMLDOMDocument& xml) { return  getKReport()->Retrieve_(xml); }//璇诲彇鏁版嵁
+	int Retrieve(KXMLDOMElement  pElement) { return pElement?getKReport()->Retrieve_(pElement):0; }//璇诲彇鏁版嵁
+	int Retrieve(KXMLDOMDocument xml) { return  xml?getKReport()->Retrieve_(xml):0; }//璇诲彇鏁版嵁
 
 public:
 	int SetDataObject(LPCTSTR pServer, LPCTSTR pUrl) { return getKReport()->SetDataObject_(pServer, pUrl); }//璁剧疆妯℃澘瀵硅薄
@@ -101,6 +102,11 @@
 public:
 	int	Reset() { return getKReport()->Reset_(); }
 	int	ResetUpdateStatus() { return getKReport()->ResetUpdateStatus_(); }
+public:
+	LPTSTR GetColumnProps(LPCTSTR pColName) { return getKReport()->GetColumnProps_(pColName); } //寰楀埌鍒楁暣浣揦ML灞炴��
+	int SetColumnProps(LPCTSTR pColName, LPCTSTR pXmlProp) { return getKReport()->SetColumnProps_(pColName, pXmlProp); } //璁剧疆鍒楁暣浣揦ML灞炴��
+	LPTSTR GetColumnProp(LPCTSTR pColName, LPCTSTR pItem) { return getKReport()->GetColumnProp_(pColName, pItem); } //寰楀埌鍒楀睘鎬�
+	int SetColumnProp(LPCTSTR pColName, LPCTSTR pItem, LPCTSTR pProp) { return getKReport()->SetColumnProp_(pColName, pItem, pProp); }//璁剧疆鍒楀睘鎬�
 
 public:
 	int event_ItemFocusChanged(int nRow, int nCol) { return getKReport()->event_ItemFocusChanged_(nRow, nCol); }
@@ -255,7 +261,7 @@
 	}
 	int AcceptText()
 	{
-		return getKReport()->AcceptText();
+		return getKReport()->AcceptText_();
 	}
 	int ShowRowTo(int row)
 	{
@@ -270,9 +276,9 @@
 		return getKReport()->GetTitleName(col);
 	}
 public:
-	int SetRowSort(LPTSTR colName, bool colOrder = true)
+	int SetRowSort(LPCTSTR colName, bool colOrder = true)
 	{
-		return getKReport()->SetRowSort(colName, colOrder);
+		return getKReport()->SetRowSort((LPTSTR)colName, colOrder);
 	}
 	int SetClickEditFlag(bool f)
 	{
@@ -280,7 +286,7 @@
 	}
 	int Redraw()
 	{
-		return getKReport()->RedrawEx();
+		return getKReport()->Redraw();
 	}
 	bool SetRowMove(int row, int movecount)
 	{
@@ -302,9 +308,9 @@
 	{
 		return getKReport()->RetrieveDiff(xml);
 	}
-	int Filter(LPTSTR pColumn, LPTSTR pStr)
+	int Filter(LPCTSTR pColumn, LPCTSTR pStr)
 	{
-		return getKReport()->Filter(pColumn, pStr);
+		return getKReport()->Filter((LPTSTR)pColumn, (LPTSTR)pStr);
 	}
 public:
 	int SetHeaderText(int row, int col, LPTSTR name)
@@ -334,15 +340,24 @@
 		return getKReport()->AddRepeats(colName);
 	}
 public:
-	LPTSTR GetColumnProp(int nCol, LPCTSTR pItem)
+	void ShowEditor()
 	{
-		return getKReport()->GetColumnProp(nCol, pItem);
+		getKReport()->ShowEditor();
+	}
+public:
+	/*
+	LPCTSTR GetColumnProp(int nCol, LPCTSTR pItem)
+	{
+		return L"";
+		//return getKReport()->GetColumnProp(nCol, pItem);
 	}
 
-	LPTSTR GetColumnProp(LPCTSTR pColName, LPCTSTR pItem)
+	LPCTSTR GetColumnProp(LPCTSTR pColName, LPCTSTR pItem)
 	{
-		return getKReport()->GetColumnProp(pColName, pItem);
+		return L"";
+		//return getKReport()->GetColumnProp(pColName, pItem);
 	}
+	*/
 
 	int GetItemInt(int row, int col)
 	{
@@ -350,9 +365,9 @@
 		return str.toInt();
 	}
 
-	int GetItemInt(int row, string col)
+	int GetItemInt(int row, xstring col)
 	{
-		xstring str = GetItemString(row, col);
+		xstring str = GetItemString(row, col.c_str());
 		return str.toInt();
 	}
 
@@ -373,9 +388,9 @@
 		return SetItemString(row, col, xstring(str));
 	}
 
-	bool SetItemInt(int row, string col, int str)
+	bool SetItemInt(int row, xstring col, int str)
 	{
-		return SetItemString(row, col, xstring(str));
+		return SetItemString(row, col.c_str(), xstring(str));
 	}
 
 	bool SetItemDouble(int row, int col, double str)
@@ -383,9 +398,70 @@
 		return SetItemString(row, col, xstring(str));
 	}
 
-	bool SetItemDouble(int row, string col, double str)
+	bool SetItemDouble(int row, xstring col, double str)
 	{
 		return SetItemString(row, col, xstring(str));
+	}
+
+	int DataBI(LPCTSTR pSchema = NULL) //鏁版嵁BI鍒嗘瀽
+	{
+		return getKReport()->DataBI_(pSchema);
+	}
+	LPTSTR DataAnalysis(LPCTSTR pSchema = NULL)
+	{
+		return getKReport()->DataAnalysis(pSchema);
+	}
+
+	xstring GetItemString(int nRow, xstring ColumnName, kdwgrid::DWBuffer dwBuffer = kdwgrid::dbuf_normal)
+	{
+		return getKReport()->GetItemString_(nRow, ColumnName.c_str(),dwBuffer);
+	}
+
+	bool SetItemString(int nRow, int ColumnName, xstring lptStr, kdwgrid::DWBuffer dwBuffer = kdwgrid::dbuf_normal)
+	{
+		return getKReport()->SetItemString_(nRow, ColumnName, lptStr.c_str(), dwBuffer);
+	}
+
+	bool SetItemString(int nRow, LPCTSTR ColumnName, xstring lptStr, kdwgrid::DWBuffer dwBuffer = kdwgrid::dbuf_normal)
+	{
+		return getKReport()->SetItemString_(nRow, ColumnName, lptStr.c_str(), dwBuffer);
+	}
+
+	bool SetItemString(int nRow, xstring ColumnName,xstring lptStr, kdwgrid::DWBuffer dwBuffer = kdwgrid::dbuf_normal)
+	{
+		return getKReport()->SetItemString_(nRow, ColumnName.c_str(), lptStr.c_str(), dwBuffer);
+	}
+	bool SetItemString(int nRow, xstring ColumnName, LPCTSTR lptStr, kdwgrid::DWBuffer dwBuffer = kdwgrid::dbuf_normal)
+	{
+		return getKReport()->SetItemString_(nRow, ColumnName.c_str(), lptStr, dwBuffer);
+	}
+
+	xstring GetItemDisplayString(int nRow, xstring ColumnName, kdwgrid::DWBuffer dwBuffer = kdwgrid::dbuf_normal)
+	{
+		return getKReport()->GetItemDisplayString(nRow, ColumnName.c_str(), dwBuffer);
+	}
+
+	bool SetItemDisplayString(int nRow, int ColumnName, xstring lptStr, kdwgrid::DWBuffer dwBuffer = kdwgrid::dbuf_normal)
+	{
+		return getKReport()->SetItemDisplayString(nRow, ColumnName, lptStr.c_str(), dwBuffer);
+	}
+
+	bool SetItemDisplayString(int nRow, LPCTSTR ColumnName, xstring lptStr, kdwgrid::DWBuffer dwBuffer = kdwgrid::dbuf_normal)
+	{
+		return getKReport()->SetItemDisplayString(nRow, ColumnName, lptStr.c_str(), dwBuffer);
+	}
+
+	bool SetItemDisplayString(int nRow, xstring ColumnName, xstring lptStr, kdwgrid::DWBuffer dwBuffer = kdwgrid::dbuf_normal)
+	{
+		return getKReport()->SetItemDisplayString(nRow, ColumnName.c_str(), lptStr.c_str(), dwBuffer);
+	}
+	bool SetItemDisplayString(int nRow, xstring ColumnName, LPCTSTR lptStr, kdwgrid::DWBuffer dwBuffer = kdwgrid::dbuf_normal)
+	{
+		return getKReport()->SetItemDisplayString(nRow, ColumnName.c_str(), lptStr, dwBuffer);
+	}
+	LPCTSTR GetItemTipString(int nRow, xstring ColumnName, kdwgrid::DWBuffer dwBuffer = kdwgrid::dbuf_normal)
+	{
+		return getKReport()->GetItemTipString(nRow, ColumnName.c_str(), dwBuffer);
 	}
 
 public:
@@ -458,52 +534,18 @@
 		return L"";
 	}
 
+	int SetGuid(int row,xstring val)
+	{
+		KXMLDOMElement  e = GetRowElement(row);
+		if (e)
+		{
+			e.setAttribute(L"guid",val.c_str());
+			return 1;
+		}
+		return 0;
+	}
+
 public:
-#if 0
-	int GetItemInt(int row, int col)
-	{
-		xstring str = GetItemString(row, col);
-		return str.toInt();
-	}
-
-	double GetItemDouble(int row, int col)
-	{
-		xstring str = GetItemString(row, col);
-		return str.toDouble();
-	}
-
-	int GetItemInt(int row, string col)
-	{
-		xstring str = GetItemString(row, col);
-		return str.toInt();
-	}
-
-	double GetItemDouble(int row, string col)
-	{
-		xstring str = GetItemString(row, col);
-		return str.toDouble();
-	}
-
-	bool SetItemInt(int row, int col, int str)
-	{
-		return SetItemString(row, col, xstring(str));
-	}
-
-	bool SetItemDouble(int row, int col, double str)
-	{
-		return SetItemString(row, col, xstring(str));
-	}
-
-	bool SetItemInt(int row, string col, int str)
-	{
-		return SetItemString(row, col, xstring(str));
-	}
-
-	bool SetItemDouble(int row, string col, double str)
-	{
-		return SetItemString(row, col, xstring(str));
-	}
-#endif
 
 	int DwRetrieve(string ServerUrl, string src, string argstr)
 	{

--
Gitblit v1.9.3