From abf4b5dc24ce08d0b96da1bef2b283a7987185eb Mon Sep 17 00:00:00 2001
From: xj qian <qianxj15@sina.com>
Date: 星期二, 23 七月 2024 11:19:26 +0800
Subject: [PATCH] update menu
---
jrj/project/vindexmenu.cpp | 21 ++++++++++-----------
1 files changed, 10 insertions(+), 11 deletions(-)
diff --git a/jrj/project/vindexmenu.cpp b/jrj/project/vindexmenu.cpp
index 0a54c11..6846501 100644
--- a/jrj/project/vindexmenu.cpp
+++ b/jrj/project/vindexmenu.cpp
@@ -29,7 +29,7 @@
int tabNo;
//int m_panelNo; // 褰撳墠鑿滃崟缁�
- string m_Assignment;
+ xstring m_Assignment;
public:
vindexmenu(void* implPtr, HWND hWnd) :xwin(implPtr, hWnd) {}
public:
@@ -56,7 +56,7 @@
int WA_ACTIVE = 1;
int WA_CLICKACTIVE = 2;
int SW_HIDE=0x1;
- WPARAM lw = evt->wParam & 0xffff;
+ WPARAM lw = evt->wParam;
int x = m_bCanDestroy;
if( lw ==WA_INACTIVE && x==1 )
{
@@ -86,9 +86,8 @@
for (i=0;i<s;i++)
{
KXMLDOMElement xitem= li.item(i);
- void * p = new KXMLDOMElement(xitem);
int k = cbx_panelName.AddItem(xstring(i).c_str());
- cbx_panelName.SetItemData(k, (LPARAM)p);
+ cbx_panelName.SetItemData(k, xitem);
}
return 1;
}
@@ -187,10 +186,10 @@
int TPM_RIGHTBUTTON = 0x0002;
int TPM_RETURNCMD = 0x0100;
AppendMenuW(m,MF_STRING, 1, str);
- xrect xr = { 0,0,0,0 };
+ RECT xr = { 0,0,0,0 };
xpoint pt;
GetCursorPos(pt);
- return TrackPopupMenu (m, TPM_RIGHTBUTTON | TPM_RETURNCMD, pt.x, pt.y, 0, this->GetHandle(), xr);
+ return TrackPopupMenu (m, TPM_RIGHTBUTTON | TPM_RETURNCMD, pt.x, pt.y, 0, this->GetHandle(), &xr);
}
int OnRClicked(TEvent* evt,int p)
@@ -308,7 +307,7 @@
{
LPARAM pa = cbx_panelName.GetItemData(i);
if (!pa)return 1;
- KXMLDOMElement& hData = *(KXMLDOMElement*)pa;
+ KXMLDOMElement hData = pa;
string Name= hData.selectSingleNode(L"name").text();
string Image = L"15";
if(hData.selectSingleNode(L"image")) Image=hData.selectSingleNode(L"image").text();
@@ -461,10 +460,10 @@
{
xaserverarg arg = GetArg();
m_nHwnd = (HWND)arg.GetParam(L"hwnd");
- cbx_menu = (void*)arg.GetParam(L"memuId");
- cbx_tab = (void*)arg.GetParam(L"tabNo");
- cbx_panelNo = (void*)arg.GetParam(L"panelNo");
- cbx_panelName = (void*)arg.GetParam(L"panelName");
+ cbx_menu = (void*)arg.GetParam(L"cbx_menu");
+ cbx_tab = (void*)arg.GetParam(L"cbx_tab");
+ cbx_panelNo = (void*)arg.GetParam(L"cbx_panelNo");
+ cbx_panelName = (void*)arg.GetParam(L"cbx_panelName");
xstring s = L"menuid:"+xstring((LPARAM)GetHWND());
SendMessage(m_nHwnd, 0x401, (LPARAM)s.c_str(), 0);
}
--
Gitblit v1.9.3