| | |
| | | #include <xcontrol/xdwgrid.hpp> |
| | | #include <wobject/xdouble.hpp> |
| | | #include <xcontrol/xlayersheet.hpp> |
| | | #include <wobject/xpage.hpp> |
| | | |
| | | #include "vbusiness/vframe/listwin.vframe.vbusiness.hpp" |
| | | #include "viewobject/view.base.hpp" |
| | | |
| | | using xml = KXMLDOMDocument; |
| | | class __declspec(dllexport) QuickCode : public xwin |
| | | class __declspec(dllexport) QuickCode : public xframe |
| | | { |
| | | public: |
| | | xdwgrid dw_list; |
| | |
| | | KXMLDOMDocument m_configDoc; |
| | | xnode m_agentNode; |
| | | public: |
| | | QuickCode(void* implPtr, HWND hWnd) :xwin(implPtr, hWnd) {} |
| | | QuickCode(void* implPtr, HWND hWnd) :xframe(implPtr, hWnd) {} |
| | | public: |
| | | static QuickCode* CreateInstance(void* implPtr, void* hWnd) |
| | | { |
| | | QuickCode* pWin = new QuickCode(implPtr, (HWND)hWnd); |
| | | return pWin; |
| | | } |
| | | int alert(xstring str) |
| | | { |
| | | //win::MessageBox(GetHWND(),str,L"提示:",0); |
| | | TApp::alert(this, str); |
| | | return 0; |
| | | } |
| | | |
| | | int SetAgent() |
| | | { |
| | | xstring xfNodeAgentArea = L"agentarea"; |
| | |
| | | { |
| | | xstring CategoryID = arg.GetArgString(L"CategoryID"); |
| | | xstring CName = arg.GetArgString(L"CName"); |
| | | dw_list.SetItemDisplayString(row, colname, CName); |
| | | dw_list.SetItemString(row, colname, CategoryID); |
| | | dw_list.SetItemDisplayString(row, colname.c_str(), CName); |
| | | dw_list.SetItemString(row, colname.c_str(), CategoryID); |
| | | dw_list.Redraw(); |
| | | } |
| | | } |
| | |
| | | { |
| | | xstring OrgName = arg.GetArgString(L"OrgName"); |
| | | xstring OrgId = arg.GetArgString(L"OrgId"); |
| | | dw_list.SetItemDisplayString(row, colname, OrgName); |
| | | dw_list.SetItemString(row, colname, OrgId); |
| | | dw_list.SetItemDisplayString(row, colname.c_str(), OrgName); |
| | | dw_list.SetItemString(row, colname.c_str(), OrgId); |
| | | dw_list.Redraw(); |
| | | } |
| | | } |
| | |
| | | xstring sPersonID = arg.GetArgString(L"sPersonID"); |
| | | trace(sPersonID); |
| | | xstring sPersonName = arg.GetArgString(L"sPersonName"); |
| | | dw_list.SetItemDisplayString(row, colname, sPersonName); |
| | | dw_list.SetItemString(row, colname, sPersonID); |
| | | dw_list.SetItemDisplayString(row, colname.c_str(), sPersonName); |
| | | dw_list.SetItemString(row, colname.c_str(), sPersonID); |
| | | dw_list.Redraw(); |
| | | } |
| | | } |
| | |
| | | |
| | | //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 = p.mid(p.find(L"&", 0) + 1, p.length()); |
| | | } |
| | | } |
| | | return ""; |
| | | return L""; |
| | | } |
| | | int getURLParam() |
| | | { |
| | | if (GetWinParam()) |
| | | { |
| | | xpage xp = new xpage; |
| | | xp.setNativePointer(GetXPage()); |
| | | xpage xp = 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"']"); |
| | | xstring vface = m_configDoc.selectSingleNode(L"//vface[1]").text(); |
| | | xstring dwname = L"";//e.selectsingleNode(L"@name").text(); |
| | | xstring tpl = L"";//e.selectsingleNode(L"@url").text(); |
| | |
| | | } |
| | | else |
| | | { |
| | | var m = ee.selectSingleNode(L"//list"); |
| | | auto m = ee.selectSingleNode(L"//list"); |
| | | KXMLDOMElement e1 = m; |
| | | //trace(e.xml()); |
| | | if (e1.selectSingleNode(L"@name")) dwname = e1.selectSingleNode(L"@name").text(); |
| | |
| | | dw_list.setNativePointer(GetControl(dwname)); |
| | | dw_list.openUrl(vface + L"/" + tpl); |
| | | //dw_list.SetSelectionMode(4); |
| | | |
| | | return 1; |
| | | } |
| | | int Onital() |
| | | { |
| | |
| | | return -1; |
| | | } |
| | | |
| | | var list = x1.selectNodes(L"root/item"); |
| | | auto list = x1.selectNodes(L"root/item"); |
| | | int i; |
| | | int s = list.length; |
| | | int s = list.length(); |
| | | if (s > 0) |
| | | { |
| | | xstring str = L"<cellprop celltype='' cellformatex='' cellformat='' cellprotectex='' cellprotect='保护' cellvisibleex='' cellvisible='' cellvalid='' cellinitial=''><edit edittype='ddlb' ddlbxml='<data>"; |
| | |
| | | return -1; |
| | | } |
| | | |
| | | var list1 = x2.selectNodes(L"root/item"); |
| | | auto list1 = x2.selectNodes(L"root/item"); |
| | | int j; |
| | | int s1 = list1.length; |
| | | int s1 = list1.length(); |
| | | if (s1 > 0) |
| | | { |
| | | xstring str1 = L"<cellprop celltype='' cellformatex='' cellformat='' cellprotectex='' cellprotect='保护' cellvisibleex='' cellvisible='' cellvalid='' cellinitial=''><edit edittype='ddlb' ddlbxml='<data>"; |
| | |
| | | return -1; |
| | | } |
| | | |
| | | var list2 = x3.selectNodes(L"root/item"); |
| | | auto list2 = x3.selectNodes(L"root/item"); |
| | | int k; |
| | | int s2 = list2.length; |
| | | int s2 = list2.length(); |
| | | if (s2 > 0) |
| | | { |
| | | xstring str2 = L"<cellprop celltype='' cellformatex='' cellformat='' cellprotectex='' cellprotect='保护' cellvisibleex='' cellvisible='' cellvalid='' cellinitial=''><edit edittype='ddlb' ddlbxml='<data>"; |