From f22bb7edb66856f3d1b6e44d6f6b170848a48dd7 Mon Sep 17 00:00:00 2001 From: xj qian <qianxj15@sina.com> Date: 星期二, 16 七月 2024 08:37:26 +0800 Subject: [PATCH] updte --- jrj/project/vindexmenu.cpp | 19 ++++++++++--------- 1 files changed, 10 insertions(+), 9 deletions(-) diff --git a/jrj/project/vindexmenu.cpp b/jrj/project/vindexmenu.cpp index 6e711c9..612ff34 100644 --- a/jrj/project/vindexmenu.cpp +++ b/jrj/project/vindexmenu.cpp @@ -35,8 +35,7 @@ public: static vindexmenu* CreateInstance(void* implPtr, void* hWnd) { - vindexmenu* pWin = new vindexmenu(implPtr, (HWND)hWnd); - return pWin; + return new vindexmenu(implPtr, (HWND)hWnd); } int OnHideWin() @@ -188,10 +187,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) @@ -320,9 +319,9 @@ str += (xstring)L"<vbox><xtree imagelist='0' name='panelTree"+xstring(no)+ L"'/></vbox>"; //AttachEvent("panelTree"+no.toString(),"TVN_SELCHANGED",OnTreeSelChanged); xstring panelTree = L"panelTree"+xstring(no); - AttachEvent(nstring::clone(panelTree.c_str()),L"TVN_ITEMEXPANDING", (FEvent)&vindexmenu::OnTreeExpanding); - AttachEvent(nstring::clone(panelTree.c_str()),L"TVN_RCLICK", (FEvent)&vindexmenu::OnRClicked); - AttachEvent(nstring::clone(panelTree.c_str()),L"NM_DBLCLK", (FEvent)&vindexmenu::OnDbClick); + AttachEvent(panelTree.c_str(true),L"TVN_ITEMEXPANDING", (FEvent)&vindexmenu::OnTreeExpanding); + AttachEvent(panelTree.c_str(true),L"TVN_RCLICK", (FEvent)&vindexmenu::OnRClicked); + AttachEvent(panelTree.c_str(true),L"NM_DBLCLK", (FEvent)&vindexmenu::OnDbClick); } toolStr += str; } @@ -458,9 +457,9 @@ int OnInitial() { - if(GetParam()) + if(GetWinParam()) { - xaserverarg& arg = *(xaserverarg*)GetParam(); + xaserverarg arg = GetArg(); m_nHwnd = (HWND)arg.GetParam(L"hwnd"); cbx_menu = (void*)arg.GetParam(L"memuId"); cbx_tab = (void*)arg.GetParam(L"tabNo"); @@ -475,6 +474,8 @@ int onload() { + SetArg(); + m_bCanDestroy = 1; tv_menu1 = GetControl(L"menu1"); -- Gitblit v1.9.3