From f0484a922f622cd35d5c49e6e9e166e1bc6ba989 Mon Sep 17 00:00:00 2001 From: LiFan <2308045698@qq.com> Date: 星期二, 02 七月 2024 11:43:59 +0800 Subject: [PATCH] update --- jrj/project/vindexform.cpp | 113 ++++++++++++++++++++++++++++---------------------------- 1 files changed, 57 insertions(+), 56 deletions(-) diff --git a/jrj/project/vindexform.cpp b/jrj/project/vindexform.cpp index a229ce7..1d2dbfd 100644 --- a/jrj/project/vindexform.cpp +++ b/jrj/project/vindexform.cpp @@ -28,12 +28,12 @@ xcombobox panelNo; //椤电鏁扮粍 xcombobox panelName; //椤电椤哄簭鏁扮粍 - int m_npHwnd; //鑿滃崟鏍戠獥鍙e彞鏌� - int m_nHwnd; //鑿滃崟鏍戠獥鍙e彞鏌� + HWND m_npHwnd; //鑿滃崟鏍戠獥鍙e彞鏌� + HWND m_nHwnd; //鑿滃崟鏍戠獥鍙e彞鏌� int m_cursheet; //褰撳墠椤电 int menuShow; - int m_npHwnd2; //openwindow + HWND m_npHwnd2; //openwindow int m_startwin; public: @@ -148,17 +148,17 @@ } int OnMenuAgent(xstring f) { - int LayerFlow_None = 0x00000001; - int LayerFlow_UnLayer = 0x00000100; - int LayerFlow_NS = 0x00000004; - int LayerFlow_Control = 0x00000010; + //int LayerFlow_None = 0x00000001; + //int LayerFlow_UnLayer = 0x00000100; + //int LayerFlow_NS = 0x00000004; + //int LayerFlow_Control = 0x00000010; int GWL_STYLE = -16; int WS_POPUP = 0x80000000; int WS_CHILD = 0x40000000; int WS_MAXIMIZE = 0x00010000; int SW_MAXIMIZE = 3; - int HWND_TOPMOST = -1; - int HWND_NOTOPMOST = -2; + HWND HWND_TOPMOST = (HWND) - 1; + HWND HWND_NOTOPMOST = (HWND) - 2; int SWP_NOSIZE = 0x0001; int SWP_NOMOVE = 0x0002; int SWP_SHOWWINDOW = 0x0040; @@ -174,12 +174,12 @@ style = style - WS_POPUP; style = style + WS_CHILD; - xwin::SetWindowLong(m_nHwnd, GWL_STYLE, style); + SetWindowLong(m_nHwnd, GWL_STYLE, style); - m_npHwnd = xwin::GetParent(m_nHwnd); + m_npHwnd = GetParent(m_nHwnd); xcontrol xc = GetControl(L"menuAgent"); - xwin::SetParent(m_nHwnd, xc.GetId()); - xwin::ShowWindow(m_nHwnd, SW_MAXIMIZE); + SetParent(m_nHwnd, xc.GetHWND()); + ShowWindow(m_nHwnd, SW_MAXIMIZE); ///AttachEvent(L"WM_SIZE",OnMenuSizeChanged); //AttachEvent(L"WM_PAINT",OnMenuSizeChanged); @@ -192,14 +192,14 @@ style = style + WS_POPUP; style = style - WS_CHILD; - xwin::SetWindowLong(m_nHwnd, GWL_STYLE, style); - xwin::SetParent(m_nHwnd, m_npHwnd); - OnMenu(L""); + SetWindowLong(m_nHwnd, GWL_STYLE, style); + SetParent(m_nHwnd, m_npHwnd); + OnMenu(NULL); } menuShow = -1 - isshow; - xcombobox::SetCurSel(memuId.GetId(), menuShow); + xcombobox::SetCurSel(memuId.GetHWND(), menuShow); if (f != L"") - setHomeConfig(L"menuposition", menuShow.toString()); + setHomeConfig(L"menuposition", xstring(menuShow)); return 1; } @@ -212,14 +212,15 @@ xstring f = getHomeConfig(L"menuposition"); if (f == L"0") { - OnMenu(L""); + OnMenu(NULL); OnMenuAgent(L""); } xaserverarg arg; - int h = GetHWND(); - arg.AddArg(L"hwnd", xstring(h)); + HWND h = GetHWND(); + //arg.AddArg(L"hwnd", xstring(h)); + arg.SetParam(L"hwnd", h); OpenWindow(L"dev:xpage[vindexforold.vx]", arg); @@ -228,11 +229,11 @@ int ReSetInfo() { - - xcombobox::ResetContent(memuId.GetId()); - xcombobox::ResetContent(tabNo.GetId()); - xcombobox::ResetContent(panelNo.GetId()); - xcombobox::ResetContent(panelName.GetId()); + + memuId.ResetContent(); + tabNo.ResetContent(); + panelNo.ResetContent(); + panelName.ResetContent(); int hItem = mainsheet.GetSheetCount(); while (hItem > 1) @@ -264,10 +265,10 @@ if (m_Assignment == L"") alert(L"鑾峰彇鐢ㄦ埛鏁版嵁澶辫触锛岃閲嶆柊鐧诲綍!"); else - xaserver::SetUserId(m_Assignment); + xaserver::SetUID(m_Assignment); - xcombobox::AddItem(memuId.GetId(), L"寮�濮�"); - xcombobox::AddItem(tabNo.GetId(), L"-1"); + xcombobox::AddItem(memuId.GetHWND(), L"寮�濮�"); + xcombobox::AddItem(tabNo.GetHWND(), L"-1"); //OpenWindow(L"dev:xpage[vstart.vx]"); xcontrol xc = GetControl(L"statusbar0"); xc.SetText(L"姝e湪鍒濆鍖栫郴缁燂紝璇风◢鍊�...."); @@ -303,7 +304,7 @@ xstring sInfo = m_Assignment; if (s > 0) { - int m = xwin::CreatePopupMenu(); + HMENU m = xwin::CreatePopupMenu(); int MF_STRING = 0x00000000; int MF_DISABLED = 0x00000002; int TPM_RIGHTBUTTON = 0x0002; @@ -321,8 +322,8 @@ } xrect xr; xpoint pt; - xwin::GetCursorPos(pt); - int res = xwin::TrackPopupMenu(m, TPM_RIGHTBUTTON | TPM_RETURNCMD, pt.x, pt.y, 0, GetHWND(), xr); + GetCursorPos(pt); + int res = TrackPopupMenu(m, TPM_RIGHTBUTTON | TPM_RETURNCMD, pt.x, pt.y, 0, GetHWND(), xr); if (res == 0) return 0; KXMLDOMElement ele = li.item(res - 1); xstring sInfoEx = ele.selectSingleNode(L"AssignmentID").text(); @@ -360,8 +361,8 @@ } xrect xr; xpoint pt; - xwin::GetCursorPos(pt); - int res = xwin::TrackPopupMenu(m, TPM_RIGHTBUTTON | TPM_RETURNCMD, pt.x, pt.y, 0, this.GetHWND(), xr); + GetCursorPos(pt); + int res = xwin::TrackPopupMenu(m, TPM_RIGHTBUTTON | TPM_RETURNCMD, pt.x, pt.y, 0, GetHWND(), xr); if (res == 0) return 0; int nSheet = mainsheet.GetSheetIndex(); if (nSheet == (res - 1)) return 0; @@ -392,8 +393,8 @@ { int SW_MAXIMIZE = 3; xcontrol xc = GetControl(L"menuAgent"); - xwin::SetParent(m_nHwnd, xc.GetId()); - xwin::ShowWindow(m_nHwnd, SW_MAXIMIZE); + SetParent(m_nHwnd, xc.GetHWND()); + ShowWindow(m_nHwnd, SW_MAXIMIZE); } return 1; } @@ -431,15 +432,15 @@ int WS_POPUP = 0x80000000; int WS_CHILD = 0x40000000; int SW_MAXIMIZE = 3; - int style = xwin::GetWindowLong(m_npHwnd2, GWL_STYLE); + int style = GetWindowLong(m_npHwnd2, GWL_STYLE); style = style - WS_POPUP; style = style + WS_CHILD; - xwin::SetWindowLong(m_npHwnd2, GWL_STYLE, style); + SetWindowLong(m_npHwnd2, GWL_STYLE, style); xcontrol xc = GetControl(L"openforold"); - xwin::SetParent(m_npHwnd2, xc.GetId()); + SetParent(m_npHwnd2, xc.GetHWND()); - xwin::ShowWindow(m_npHwnd2, SW_MAXIMIZE); + ShowWindow(m_npHwnd2, SW_MAXIMIZE); return 1; } @@ -454,7 +455,7 @@ //else if (comdid.find(L"menuid:", 0) >= 0) // return OnMenu((HWND)comdid.mid(comdid.find(L":", 0) + 1, comdid.length()).toInt()); - if (comdid ==L "xmAssignment") OnChangeLogin(); + if (comdid ==L"xmAssignment") OnChangeLogin(); else if (comdid == L"xmAllCaption") OnAllCaption(); else if (comdid == L"xmMenu") OnMenu(L""); else if (comdid == L"xmHelp") return OnHelp(); @@ -486,31 +487,31 @@ } int OnSheetChanged(TEvent* evt, int p) { - ref LYSNMHDR nmtv = trust(evt.pnmh as ref LYSNMHDR); + LYSNMHDR& nmtv = *(LYSNMHDR*)evt->notify.pnmh; int sheet = nmtv.nSheet; int s = mainsheet.GetSheetCount(); //trace(s); - int cs = xcombobox::GetCount(memuId.GetId()); + int cs = xcombobox::GetCount(memuId.GetHWND()); int cursheet = m_cursheet; if (s > cs) { - xcombobox::AddItem(memuId.GetId(), L"鑷敱绐楀彛"); - xcombobox::AddItem(tabNo.GetId(), cursheet.toString()); + xcombobox::AddItem(memuId.GetHWND(), L"鑷敱绐楀彛"); + xcombobox::AddItem(tabNo.GetHWND(), xstring(cursheet)); } if (s < cs) { - xcombobox::DeleteItem(memuId.GetId(), cursheet); + xcombobox::DeleteItem(memuId.GetHWND(), cursheet); int i = 0; - xstring value = xcombobox::GetLBText(tabNo.GetId(), cursheet); + xstring value = xcombobox::GetLBText(tabNo.GetHWND(), cursheet); for (i = 0; i < cs; i++) { - xstring tabId = xcombobox::GetLBText(tabNo.GetId(), i); - if (tabId == cursheet.toString()) + xstring tabId = xcombobox::GetLBText(tabNo.GetHWND(), i); + if (tabId == xstring(cursheet)) { - xcombobox::DeleteItem(tabNo.GetId(), i); - xcombobox::InsertString(tabNo.GetId(), i, value); + xcombobox::DeleteItem(tabNo.GetHWND(), i); + xcombobox::InsertString(tabNo.GetHWND(), i, value); } } - xcombobox::DeleteItem(tabNo.GetId(), cursheet); + xcombobox::DeleteItem(tabNo.GetHWND(), cursheet); if (sheet != value.toInt()) mainsheet.SelectSheet(value.toInt()); } @@ -521,7 +522,7 @@ if (hPicture > 0) { int WM_CLOSE = 0x0010; - xwin::PostMessage(hPicture, WM_CLOSE, 0, 0); + PostMessage(hPicture, WM_CLOSE, 0, 0); } } @@ -531,7 +532,7 @@ int OnCloseSheet(TEvent* evt, int p) { - ref LYSNMHDR nmtv = trust(evt.pnmh as ref LYSNMHDR); + LYSNMHDR& nmtv = *(LYSNMHDR*)evt->notify.pnmh; int sheet = nmtv.nSheet; //alert(L"xxxx"); return 1; @@ -569,8 +570,8 @@ if (userno == L"admin" /*|| userno==L"00206" || userno==L"00206" || userno==L"00201" ||userno==L"00101" */) { xnode anode = GetAgentNode(L"dev"); - int LayerFlow_WE = 0x00000002; - int LayerFlow_Control = 0x00000010; + int LayerFlow_WE_ = 0x00000002; + int LayerFlow_Control_ = 0x00000010; anode.SetLayerFlow(LayerFlow_WE | LayerFlow_Control); } -- Gitblit v1.9.3