| | |
| | | #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; |
| | |
| | | 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"; |
| | |
| | | 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(); |
| | |
| | | return -1; |
| | | } |
| | | //trace(x.xml()); |
| | | if (x.xml() == L"") |
| | | if ((xstring)x.xml() == L"") |
| | | { |
| | | xml xx; |
| | | xx.loadXML(L"<root/>"); |
| | |
| | | //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") { |
| | |
| | | |
| | | 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); |
| | |
| | | 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); |
| | |
| | | |
| | | //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(); |
| | | } |
| | | |
| | |
| | | } |
| | | int ItemOutput() |
| | | { |
| | | xstring d = xaserver::GetCurrentDate(); |
| | | xstring d = publiccode::GetCurrentDate(); |
| | | d = d.left(10) + L""; |
| | | dw_list.SaveAs(d); |
| | | return 1; |
| | |
| | | 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); |
| | | } |
| | |
| | | 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(); |
| | |
| | | { |
| | | 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()); |
| | |
| | | { |
| | | 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; |
| | | |
| | |
| | | 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; |
| | |
| | | trace(tpl); |
| | | |
| | | } |
| | | return 1; |
| | | } |
| | | int onload() |
| | | { |
| | |
| | | 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); |