xj qian
2024-07-22 4e06e34c0a39cf7e45caca4fbc282bcffd31f30a
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()
@@ -87,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;
   }      
@@ -188,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)
@@ -309,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();
@@ -320,9 +318,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;
         }
@@ -462,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);
      }