From a4d2315ee4ca3f6177b4fb2526bed2feff3d89be Mon Sep 17 00:00:00 2001
From: lifan <2308045698@qq.com>
Date: 星期三, 22 十月 2025 16:52:58 +0800
Subject: [PATCH] update
---
jrj/project/business/BasicCode/QuickCode_Tree.cpp | 92 ++++++++++++++++++---------------------------
1 files changed, 37 insertions(+), 55 deletions(-)
diff --git a/jrj/project/business/BasicCode/QuickCode_Tree.cpp b/jrj/project/business/BasicCode/QuickCode_Tree.cpp
index b8b99b0..ff264df 100644
--- a/jrj/project/business/BasicCode/QuickCode_Tree.cpp
+++ b/jrj/project/business/BasicCode/QuickCode_Tree.cpp
@@ -8,7 +8,7 @@
#include "viewobject/view.base.hpp"
using xml = KXMLDOMDocument;
-class __declspec(dllexport) QuickCode_Tree : public xwin
+class __declspec(dllexport) QuickCode_Tree : public listwin
{
public:
xdwgrid dw_list;
@@ -25,19 +25,14 @@
xstring m_QueryTxt;
xnode m_agentNode;
public:
- QuickCode_Tree(void* implPtr, HWND hWnd) :xwin(implPtr, hWnd) {}
+ QuickCode_Tree(void* implPtr, HWND hWnd) :listwin(implPtr, hWnd) {}
public:
static QuickCode_Tree* CreateInstance(void* implPtr, void* hWnd)
{
QuickCode_Tree* pWin = new QuickCode_Tree(implPtr, (HWND)hWnd);
return pWin;
}
- int alert(xstring str)
- {
- TApp::alert(this, str);
- //win::MessageBox(GetHWND(),str,L"提示:",0);
- return 0;
- }
+
int SetAgent()
{
xstring xfNodeAgentArea = L"agentarea";
@@ -49,7 +44,8 @@
else
{
KXMLDOMElement xframeElement = GetElement();
- KXMLDOMElement agent = xframeElement.selectSingleNode(L"agent/" + xfNodeAgentArea + L"[1]/*");
+ //KXMLDOMElement agent = xframeElement.selectSingleNode(L"agent/" + xfNodeAgentArea + L"[1]/*");
+ KXMLDOMElement agent = m_configDoc.selectSingleNode(L"Config/" + xfNodeAgentArea + L"[1]/*");
if (agent)
{
xstring s = agent.xml();
@@ -80,7 +76,7 @@
return -1;
}
//trace(x.xml());
- if (x.xml() == L"")
+ if ((xstring)x.xml() == L"")
{
xml xx;
xx.loadXML(L"<root/>");
@@ -289,14 +285,14 @@
//trace(x.xml());
//trace(strtpl);
xstring aa = strtpl;
- var doc = x;
- var n = doc.selectSingleNode(L"//resource[@url='" + aa + L"']/@src");
+ auto doc = x;
+ auto n = doc.selectSingleNode(L"//resource[@url='" + aa + L"']/@src");
//trace(n.text());
xaserverarg arg;
arg.AddArg(L"sheet", n.text());
- arg.AddArg(L"search", list::m_QueryTxt);
+ arg.AddArg(L"search", listwin::m_QueryTxt);
openUrl(L"view.dlg.vface/xpage/grid/column/search", arg);
xstring ok = arg.GetArgString(L"return");
if (ok == L"ok") {
@@ -331,9 +327,9 @@
kp.loadXML(L"<root></root>");
KXMLDOMElement ele = kp.documentElement();
- var list = e.selectNodes(L"item[@update.modify='1' or @update.delete='1' ]");
+ auto list = e.selectNodes(L"item[@update.modify='1' or @update.delete='1' ]");
int j;
- int k = list.length;
+ int k = list.length();
for (j = 0; j < k; j++)
{
KXMLDOMElement ele1 = list.item(j);
@@ -409,8 +405,7 @@
int OnSetFocus(TEvent* evt, LPARAM p)
{
SetAgent();
- tv_1 = new treeview;
- tv_1.setNativePointer(GetControl(L"tv_1"));
+ tv_1 = GetControl(L"tv_1");
HTREEITEM root = tv_1.GetRootItem();
tv_1.ExpandItem(root);
@@ -426,14 +421,14 @@
//xstring str = hdr.data;
xstring colname = hdr.colname;
- xstring str = dw_list.GetItemString(row, colname);
+ xstring str = dw_list.GetItemString(row, colname.c_str());
arg.AddArg(L"value", str);
openUrl(L"/sale/view/view.dlg/xpage/memo/edit", arg);
xstring comdid = arg.GetArgString(L"comdid");
if (comdid == L"xmOK")
{
xstring value = arg.GetArgString(L"value");
- dw_list.SetItemString(row, colname, value);
+ dw_list.SetItemString(row, colname.c_str(), value);
dw_list.Redraw();
}
@@ -441,7 +436,7 @@
}
int ItemOutput()
{
- xstring d = xaserver::GetCurrentDate();
+ xstring d = publiccode::GetCurrentDate();
d = d.left(10) + L"";
dw_list.SaveAs(d);
return 1;
@@ -491,10 +486,10 @@
while (row > 0)
{
xstring tmp;
- if (dw_list.GetItemDisplayString(row, col))
- tmp = dw_list.GetItemDisplayString(row, col);
+ if (dw_list.GetItemDisplayString(row, col.c_str()))
+ tmp = dw_list.GetItemDisplayString(row, col.c_str());
else
- tmp = dw_list.GetItemString(row, col);
+ tmp = dw_list.GetItemString(row, col.c_str());
str += tmp + L"\r\n";
row = dw_list.GetNextSelectRow(row + 1);
}
@@ -507,25 +502,25 @@
DWNMHDR& hdr = *(DWNMHDR*)evt->notify.pnmh;
int row = hdr.row;
- int m = win::CreatePopupMenu();
+ HMENU m = CreatePopupMenu();
int MF_STRING = 0x00000000;
int MF_DISABLED = 0x00000002;
int TPM_RIGHTBUTTON = 0x0002;
int TPM_RETURNCMD = 0x0100;
int MF_CHECKED = 0x8;
int MF_SEPARATOR = 0x0800;
- win::AppendMenu(m, MF_STRING, 1, L"复制行");
- win::AppendMenu(m, MF_STRING, 101, L"复制列");
- win::AppendMenu(m, MF_SEPARATOR, -1, L"");
- win::AppendMenu(m, MF_STRING, 2, L"全选");
- win::AppendMenu(m, MF_SEPARATOR, -1, L"");
- win::AppendMenu(m, MF_STRING, 4, L"导出到Excel");
- win::AppendMenu(m, MF_SEPARATOR, -1, L"");
- win::AppendMenu(m, MF_STRING, 6, L"显示列设置");
- xrect xr;
+ AppendMenu(m, MF_STRING, 1, L"复制行");
+ AppendMenu(m, MF_STRING, 101, L"复制列");
+ AppendMenu(m, MF_SEPARATOR, -1, L"");
+ AppendMenu(m, MF_STRING, 2, L"全选");
+ AppendMenu(m, MF_SEPARATOR, -1, L"");
+ AppendMenu(m, MF_STRING, 4, L"导出到Excel");
+ AppendMenu(m, MF_SEPARATOR, -1, L"");
+ AppendMenu(m, MF_STRING, 6, L"显示列设置");
+ RECT xr;
xpoint pt;
- win::GetCursorPos(pt);
- int ret = win::TrackPopupMenu(m, TPM_RIGHTBUTTON | TPM_RETURNCMD, pt.x, pt.y, 0, GetHWND(), xr);
+ GetCursorPos(pt);
+ int ret = TrackPopupMenu(m, TPM_RIGHTBUTTON | TPM_RETURNCMD, pt.x, pt.y, 0, GetHWND(), &xr);
//trace(ret);
HCURSOR hCursor = xutil::SetCursorWait();
@@ -562,10 +557,10 @@
{
p += L"&";
int i = 1;
- while (p.find(L"=L", 0) > 0)
+ while (p.find(L"=", 0) > 0)
{
- xstring name = p.mid(0, p.find(L"=L", 0));
- xstring value = p.mid(p.find(L"=L", 0) + 1, p.find(L"&", 0) - p.find(L"=L", 0) - 1);
+ xstring name = p.mid(0, p.find(L"=", 0));
+ xstring value = p.mid(p.find(L"=", 0) + 1, p.find(L"&", 0) - p.find(L"=", 0) - 1);
if (name == n) return L"" + value;
i += 1;
p = p.mid(p.find(L"&", 0) + 1, p.length());
@@ -577,20 +572,7 @@
{
if (GetWinParam())
{
- xpage xp = new xpage;
- xp.setNativePointer(GetXPage());
- xstring aurl = xp.GetWkUrl();
- xaserverarg arg;
- if (aurl && aurl.find(L"native=true", 0) > 0)
- {
- int p = GetParam();
- arg;
- arg.setNativePointer(p);
- }
- else
- {
- arg = GetParam();
- }
+ xaserverarg arg = GetArg();
xstring config = arg.GetArgString(L"config");
xml x;
@@ -614,7 +596,7 @@
getURLParam();
KXMLDOMDocument ee = m_configDoc;
xstring id = m_id;
- var n = ee.selectSingleNode(L"//list/dwview[@type='dwgrid'][@id='" + id + L"']");
+ auto n = ee.selectSingleNode(L"//list/dwview[@type='dwgrid'][@id='" + id + L"']");
if (n)
{
KXMLDOMElement e = n;
@@ -639,6 +621,7 @@
trace(tpl);
}
+ return 1;
}
int onload()
{
@@ -684,8 +667,7 @@
stree += L"</xtree></vbox>";
SetAgentNode(tnode, stree);
- tv_1 = new treeview;
- tv_1.setNativePointer(GetControl(L"tv_1"));
+ tv_1 = GetControl(L"tv_1");
HTREEITEM root = tv_1.GetRootItem();
tv_1.ExpandItem( root);
--
Gitblit v1.9.3