NGenericPopup.cpp
上传用户:whjcdz88
上传日期:2007-01-02
资源大小:350k
文件大小:15k
源码类别:

工具条

开发平台:

Visual C++

  1. // NGenericPopup.cpp : implementation file
  2. //
  3. /*
  4. Copyright (C) 1998 Tony Hoyle (tmh@netfusion.co.uk)
  5. This program is free software; you can redistribute it and/or modify it under the terms
  6. of the GNU General Public License as published by the Free Software Foundation; either
  7. version 2 of the License, or (at your option) any later version.
  8. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
  9. without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  10. See the GNU General Public License for more details.
  11. You should have received a copy of the GNU General Public License along with this program;
  12. if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  13. */
  14. #include "stdafx.h"
  15. #include "NGenericPopup.h"
  16. #include "NGenericToolBar.h"
  17. #include "NGenericMenu.h"
  18. #ifdef _DEBUG
  19. #define new DEBUG_NEW
  20. #undef THIS_FILE
  21. static char THIS_FILE[] = __FILE__;
  22. #endif
  23. #define OBM_CHECK           32760 // From <Winuser.h>
  24. #define OBM_RGARROW         32751
  25. #define OBM_RGARROWI        32735
  26. /////////////////////////////////////////////////////////////////////////////
  27. // CNGenericPopup
  28. CNGenericPopup::CNGenericPopup()
  29. {
  30. // m_sztick=GetMenuCheckMarkDimensions();
  31. m_sztick.cx=18;
  32. m_sztick.cy=18;
  33. m_tick.Attach((HBITMAP)LoadImage(NULL,MAKEINTRESOURCE(OBM_CHECK),IMAGE_BITMAP,0,0,LR_LOADMAP3DCOLORS|LR_SHARED));
  34. m_arrow1.Attach((HBITMAP)LoadImage(NULL,MAKEINTRESOURCE(OBM_RGARROW),IMAGE_BITMAP,0,0,LR_LOADMAP3DCOLORS|LR_SHARED));
  35. m_arrow2.Attach((HBITMAP)LoadImage(NULL,MAKEINTRESOURCE(OBM_RGARROWI),IMAGE_BITMAP,0,0,LR_LOADMAP3DCOLORS|LR_SHARED));
  36. m_pMenu=new CMenu;
  37. m_pSubMenu=NULL;
  38. m_pIconMap=NULL;
  39. m_nIconMapSize=NULL;
  40. }
  41. CNGenericPopup::~CNGenericPopup()
  42. {
  43. if(m_pSubMenu) { m_pSubMenu->DestroyWindow(); delete m_pSubMenu; }
  44. m_pMenu->m_hMenu=NULL;
  45. delete m_pMenu;
  46. }
  47. IMPLEMENT_DYNAMIC(CNGenericPopup, CWnd)
  48. BEGIN_MESSAGE_MAP(CNGenericPopup, CWnd)
  49. //{{AFX_MSG_MAP(CNGenericPopup)
  50. ON_WM_PAINT()
  51. ON_WM_DESTROY()
  52. ON_WM_MOUSEMOVE()
  53. ON_WM_LBUTTONDOWN()
  54. ON_WM_LBUTTONUP()
  55. ON_WM_CAPTURECHANGED()
  56. ON_WM_KEYDOWN()
  57. //}}AFX_MSG_MAP
  58. ON_MESSAGE(WM_INITMENUPOPUP,OnInitMenuPopup)
  59. ON_MESSAGE(WM_MENUSELECT,OnMenuSelect)
  60. END_MESSAGE_MAP()
  61. /////////////////////////////////////////////////////////////////////////////
  62. // CNGenericPopup message handlers
  63. BOOL CNGenericPopup::ShowMenu(int nOrient, BOOL bFromKey, CNGenericToolBar* pToolbar, int x, int y, CWnd* pParent, HMENU hMenu)
  64. {
  65. ASSERT(hMenu);
  66. HideMenu();
  67. m_pToolbar=pToolbar;
  68. m_pMenu->m_hMenu=hMenu;
  69. m_pParent=pParent;
  70. m_nSelectedItem=-1;
  71. m_bMouseInMenu=FALSE;
  72. m_nOrient=nOrient;
  73. if(!CreateEx(0,AfxRegisterWndClass(CS_SAVEBITS,LoadCursor(NULL,IDC_ARROW),(HBRUSH)CBrush(GetSysColor(COLOR_BTNFACE))),NULL,WS_POPUP,x,y,100,100,*pParent,0)) 
  74. return FALSE;
  75. m_pParent->SendMessage(WM_ENTERMENULOOP,FALSE);
  76. SetCapture();
  77. int cx=0,cy=0,n;
  78. CSize siz;
  79. CRect rect;
  80. CDC& dc=*GetDC();
  81. // Revised by Zhenxin Li.
  82. // Change the font to the default menu's font.
  83. // dc.SelectObject((HFONT)GetStockObject(DEFAULT_GUI_FONT));
  84. dc.SelectObject(m_pToolbar->GetFont());
  85. GetClientRect(rect);
  86. CString tmp;
  87. LPCTSTR q;
  88. cy=4;
  89. m_rectItem.SetSize(0);
  90. m_accelList.SetSize(0);
  91. for(n=0; n<(int)m_pMenu->GetMenuItemCount(); n++)
  92. {
  93. m_pMenu->GetMenuString(n,tmp,MF_BYPOSITION);
  94. for(q=tmp; *q; q++)
  95. {
  96. if(*q=='&')
  97. {
  98. int s=m_accelList.GetSize();
  99. m_accelList.SetSize(s+1);
  100. m_accelList[s].nKey=toupper(*(q+1));
  101. m_accelList[s].nId=m_pMenu->GetMenuItemID(n);
  102. break;
  103. }
  104. }
  105. siz=DrawMenuItem(n,dc,rect,FALSE,FALSE);
  106. m_rectItem.Add(CRect(4,cy,0,cy+siz.cy-1));
  107. if(siz.cx>cx) cx=siz.cx;
  108. cy+=siz.cy;
  109. }
  110. cy+=4;
  111. cx+=8;
  112. ReleaseDC(&dc);
  113. for(n=0; n<m_rectItem.GetSize(); n++)
  114. m_rectItem[n].right=cx-4;
  115. if(m_nOrient==POP_MENU_RIGHT) x-=cx;
  116. else if(m_nOrient==POP_MENU_BOTTOM) y-=cy;
  117. MoveWindow(x,y,cx,cy);
  118. ShowWindow(SW_SHOWNA);
  119. SetFocus(); // Must have focus to get keyboard events
  120. if(bFromKey) m_nSelectedItem=0;
  121. return TRUE;
  122. }
  123. BOOL CNGenericPopup::HideMenu()
  124. {
  125. if(IsWindow(*this)) DestroyWindow();
  126. return TRUE;
  127. }
  128. void CNGenericPopup::OnPaint() 
  129. {
  130. int n;
  131. CSize siz;
  132. CPaintDC dc(this); // device context for painting
  133. CRect rect;
  134. GetClientRect(rect);
  135. dc.FillSolidRect(rect,GetSysColor(COLOR_BTNFACE));
  136. dc.Draw3dRect(rect,GetSysColor(COLOR_3DHILIGHT),GetSysColor(COLOR_WINDOWTEXT));
  137. // dc.SelectObject((HFONT)GetStockObject(DEFAULT_GUI_FONT));
  138. dc.SelectObject(m_pToolbar->GetFont());
  139. for(n=0; n<(int)m_pMenu->GetMenuItemCount(); n++)
  140. DrawMenuItem(n,dc,m_rectItem[n],FALSE,TRUE);
  141. if(m_nSelectedItem!=-1)
  142. DrawMenuItem(m_nSelectedItem,dc,m_rectItem[m_nSelectedItem],TRUE,TRUE);
  143. }
  144. void CNGenericPopup::SelectItem(int nItem)
  145. {
  146. if(m_nSelectedItem==nItem) return;
  147. CRect rect;
  148. CDC& dc=*GetDC();
  149. // dc.SelectObject((HFONT)GetStockObject(DEFAULT_GUI_FONT));
  150. dc.SelectObject(m_pToolbar->GetFont());
  151. if(m_nSelectedItem!=-1)
  152. {
  153. if(m_pSubMenu)
  154. {
  155. m_pSubMenu->DestroyWindow();
  156. delete m_pSubMenu;
  157. m_pSubMenu=NULL;
  158. }
  159. rect=m_rectItem[m_nSelectedItem];
  160. DrawMenuItem(m_nSelectedItem,dc,rect,FALSE,TRUE);
  161. }
  162. if(nItem!=-1)
  163. {
  164. rect=m_rectItem[nItem];
  165. DrawMenuItem(nItem,dc,rect,TRUE,TRUE);
  166. if((m_pMenu->GetMenuState(nItem,MF_BYPOSITION|MF_POPUP|MF_GRAYED)&(MF_POPUP|MF_GRAYED))==MF_POPUP)
  167. {
  168. m_pSubMenu=new CNGenericPopup;
  169. ClientToScreen(&rect);
  170. m_pParent->SendMessage(WM_INITMENUPOPUP,(WPARAM)(HMENU)*m_pMenu->GetSubMenu(nItem),nItem);
  171. m_pSubMenu->ShowMenu(POP_MENU_LEFT,FALSE,m_pToolbar,rect.right,rect.top-4,this,(HMENU)*m_pMenu->GetSubMenu(nItem));
  172. }
  173. }
  174. m_nSelectedItem=nItem;
  175. ReleaseDC(&dc);
  176. }
  177. CSize CNGenericPopup::DrawMenuItem(int nItem, CDC& dc, const CRect& rect, BOOL bHighlight, BOOL bReallyDraw)
  178. {
  179. CString tmp,tmp1,tmp2;
  180. char* p,*q;
  181. CSize siz;
  182. UINT nState;
  183. int nId,n,nIcon;
  184. CRect rect2;
  185. nState=m_pMenu->GetMenuState(nItem,MF_BYPOSITION|MF_DISABLED|MF_CHECKED|MF_GRAYED|MF_SEPARATOR|MF_POPUP);
  186. nId=m_pMenu->GetMenuItemID(nItem);
  187. nIcon=0;
  188. for(n=0; m_pIconMap && n<m_nIconMapSize; n++)
  189. {
  190. if(m_pIconMap[n].nID==nId)
  191. {
  192. nIcon=m_pIconMap[n].nIcon;
  193. break;
  194. }
  195. }
  196. if(nState&MF_SEPARATOR)
  197. {
  198. if(bReallyDraw)
  199. {
  200. rect2=rect;
  201. rect2.top=rect.top+4;
  202. rect2.bottom=rect2.top+2;
  203. dc.Draw3dRect(rect2,GetSysColor(COLOR_3DSHADOW),GetSysColor(COLOR_3DHILIGHT));
  204. }
  205. siz.cx=0;
  206. siz.cy=10;
  207. }
  208. else
  209. {
  210. m_pMenu->GetMenuString(nItem,tmp,MF_BYPOSITION);
  211. siz=dc.GetTextExtent(tmp);
  212. p=(char*)(LPCTSTR)tmp;
  213. q=(char*)tmp1.GetBufferSetLength(1024);
  214. while(*p && *p!='t') *(q++)=*(p++);
  215. if(*p) { p++; siz.cx+=16; }
  216. *q='';
  217. q=(char*)tmp2.GetBufferSetLength(1024);
  218. while(*p) *(q++)=*(p++);
  219. *q='';
  220. tmp1.ReleaseBuffer();
  221. tmp2.ReleaseBuffer();
  222. if(bReallyDraw)
  223. {
  224. rect2=rect;
  225. if(nIcon)
  226. {
  227. rect2.left+=m_sztick.cx;
  228. }
  229. rect2.top-=2;
  230. rect2.bottom+=2;
  231. if(bHighlight)
  232. {
  233. dc.SetBkColor(GetSysColor(COLOR_HIGHLIGHT));
  234. dc.SetTextColor(GetSysColor(COLOR_HIGHLIGHTTEXT));
  235. dc.FillSolidRect(rect2,GetSysColor(COLOR_HIGHLIGHT));
  236. if(nIcon)
  237. {
  238. rect2.left=rect.left-1;
  239. rect2.right=rect.left+m_sztick.cx;
  240. rect2.top--;
  241. dc.Draw3dRect(rect2,GetSysColor(COLOR_3DHIGHLIGHT),GetSysColor(COLOR_3DSHADOW));
  242. }
  243. dc.SetBkColor(GetSysColor(COLOR_HIGHLIGHT));
  244. }
  245. else
  246. {
  247. dc.SetBkColor(GetSysColor(COLOR_BTNFACE));
  248. dc.SetTextColor(GetSysColor(COLOR_WINDOWTEXT));
  249. dc.FillSolidRect(rect2,GetSysColor(COLOR_BTNFACE));
  250. if(nIcon)
  251. {
  252. rect2.left=rect.left-1;
  253. rect2.right=rect.left+m_sztick.cx;
  254. rect2.top--;
  255. dc.Draw3dRect(rect2,GetSysColor(COLOR_BTNFACE),GetSysColor(COLOR_BTNFACE));
  256. }
  257. dc.SetBkColor(GetSysColor(COLOR_BTNFACE));
  258. }
  259. rect2=rect;
  260. rect2.left+=m_sztick.cx+2;
  261. rect2.right-=m_sztick.cx+2;
  262. if(nState&MF_CHECKED && !nIcon)
  263. {
  264. CDC pMemDC;
  265. pMemDC.CreateCompatibleDC(&dc);
  266. pMemDC.SelectObject(m_tick);
  267. dc.BitBlt(rect.left+5,rect.top+2,m_sztick.cx,m_sztick.cy,&pMemDC,0,0,SRCCOPY);
  268. }
  269. if(nState&MF_POPUP && !bHighlight)
  270. {
  271. CDC pMemDC;
  272. pMemDC.CreateCompatibleDC(&dc);
  273. pMemDC.SelectObject(nState&MF_GRAYED?m_arrow2:m_arrow1);
  274. dc.BitBlt(rect.right-14,rect.top+2,12,12,&pMemDC,2,2,SRCCOPY);
  275. }
  276. if(nIcon)
  277. {
  278. HICON hIcon=(HICON)LoadImage(AfxFindResourceHandle(RT_ICON,MAKEINTRESOURCE(nIcon)),MAKEINTRESOURCE(nIcon),IMAGE_ICON,0,0,LR_LOADMAP3DCOLORS);
  279. if(hIcon)
  280. {
  281. ::DrawIconEx(dc,rect.left,rect.top,hIcon,0,0,0,NULL,DI_NORMAL);
  282. DeleteObject(hIcon);
  283. }
  284. }
  285. if(nState&MF_GRAYED)
  286. {
  287. if(!bHighlight)
  288. {
  289. dc.SetTextColor(GetSysColor(COLOR_3DHIGHLIGHT));
  290. dc.DrawText(tmp1,rect2,DT_LEFT|DT_SINGLELINE);
  291. dc.DrawText(tmp2,rect2,DT_RIGHT|DT_SINGLELINE);
  292. dc.SetBkMode(TRANSPARENT);
  293. rect2.OffsetRect(-1,-1);
  294. dc.SetTextColor(GetSysColor(COLOR_3DSHADOW));
  295. dc.DrawText(tmp1,rect2,DT_LEFT|DT_SINGLELINE);
  296. dc.DrawText(tmp2,rect2,DT_RIGHT|DT_SINGLELINE);
  297. dc.SetBkMode(OPAQUE);
  298. }
  299. else
  300. {
  301. dc.SetTextColor(GetSysColor(COLOR_BTNFACE));
  302. dc.DrawText(tmp1,rect2,DT_LEFT|DT_SINGLELINE);
  303. dc.DrawText(tmp2,rect2,DT_RIGHT|DT_SINGLELINE);
  304. }
  305. }
  306. else
  307. {
  308. dc.DrawText(tmp1,rect2,DT_LEFT|DT_SINGLELINE);
  309. dc.DrawText(tmp2,rect2,DT_RIGHT|DT_SINGLELINE);
  310. }
  311. }
  312. siz.cx+=(m_sztick.cx+2)*2;
  313. siz.cy+=4;
  314. }
  315. return siz;
  316. }
  317. void CNGenericPopup::OnDestroy() 
  318. {
  319. m_pParent->SendMessage(WM_EXITMENULOOP,FALSE);
  320. ReleaseCapture();
  321. if(::IsWindow(m_pParent->GetSafeHwnd()) && m_pParent->IsKindOf(RUNTIME_CLASS(CNGenericPopup))) m_pParent->SetCapture();
  322. CWnd::OnDestroy();
  323. }
  324. void CNGenericPopup::OnMouseMove(UINT nFlags, CPoint point) 
  325. {
  326. CWnd* pWnd;
  327. CRect rect;
  328. CPoint pt(point);
  329. m_pParent->SendMessage(WM_ENTERIDLE,MSGF_MENU,(LPARAM)m_hWnd);
  330. GetClientRect(rect);
  331. rect.InflateRect(-4,-4);
  332. ClientToScreen(&rect);
  333. ClientToScreen(&pt);
  334. pWnd=WindowFromPoint(pt);
  335. if(!pWnd) return;
  336. if(rect.PtInRect(pt))
  337. {
  338. ScreenToClient(&pt);
  339. for(int n=0; n<m_rectItem.GetSize(); n++)
  340. {
  341. if(m_rectItem[n].PtInRect(pt))
  342. {
  343. if(m_nSelectedItem!=n)
  344. {
  345. m_pParent->SendMessage(WM_MENUSELECT,m_pMenu->GetMenuItemID(n),MAKELPARAM(m_pMenu->GetMenuState(n,MF_BITMAP|MF_POPUP|MF_BYPOSITION|MF_DISABLED|MF_CHECKED|MF_GRAYED)|MF_MOUSESELECT|MF_HILITE,m_pMenu->m_hMenu));
  346. SelectItem(n);
  347. m_bMouseInMenu=TRUE;
  348. }
  349. return;
  350. }
  351. }
  352. }
  353. if(!m_bMouseInMenu && pWnd!=this && pWnd->IsKindOf(RUNTIME_CLASS(CNGenericPopup)))
  354. {
  355. CPoint p(point);
  356. ClientToScreen(&p);
  357. pWnd->ScreenToClient(&p);
  358. ((CNGenericPopup*)pWnd)->OnMouseMove(nFlags,p);
  359. pWnd->SetCapture();
  360. }
  361. if(m_bMouseInMenu && !pWnd->IsKindOf(RUNTIME_CLASS(CNGenericPopup))) SelectItem(-1);
  362. m_bMouseInMenu=FALSE;
  363. if(pWnd==m_pToolbar) 
  364. {
  365. pWnd->ScreenToClient(&pt);
  366. pWnd->PostMessage(WM_MOUSEMOVE,nFlags,MAKELONG(pt.x,pt.y));
  367. return;
  368. }
  369. }
  370. void CNGenericPopup::OnLButtonDown(UINT nFlags, CPoint point) 
  371. {
  372. CRect rect;
  373. GetClientRect(rect);
  374. if(!rect.PtInRect(point))
  375. {
  376. m_pToolbar->SendMessage(WM_MENU_DISMISS);
  377. DestroyRootMenu();
  378. }
  379. }
  380. void CNGenericPopup::OnLButtonUp(UINT nFlags, CPoint point) 
  381. {
  382. CRect rect;
  383. UINT nID;
  384. GetClientRect(rect);
  385. if(rect.PtInRect(point))
  386. {
  387. for(int n=0; n<m_rectItem.GetSize(); n++)
  388. {
  389. if(m_rectItem[n].PtInRect(point))
  390. {
  391. if(m_pMenu->GetMenuState(n,MF_BYPOSITION|MF_DISABLED|MF_GRAYED)&(MF_DISABLED|MF_GRAYED))
  392. break;
  393. m_pToolbar->SendMessage(WM_MENU_DISMISS);
  394. if((nID=m_pMenu->GetMenuItemID(n))!=0)
  395. {
  396. m_pParent->PostMessage(WM_COMMAND,nID,NULL);
  397. TRACE("Command Message %dn",nID);
  398. }
  399. DestroyRootMenu();
  400. break;
  401. }
  402. }
  403. }
  404. }
  405. void CNGenericPopup::OnCaptureChanged(CWnd *pWnd) 
  406. {
  407. if(!pWnd || !pWnd->IsKindOf(RUNTIME_CLASS(CNGenericPopup))) SetCapture();
  408. }
  409. BOOL CNGenericPopup::KeyboardFilter(UINT nChar, UINT nRepCnt, UINT nFlags) 
  410. {
  411. int nItem;
  412. if(nChar==VK_ESCAPE)
  413. {
  414. m_pToolbar->SendMessage(WM_MENU_DISMISS);
  415. DestroyRootMenu();
  416. return TRUE;
  417. }
  418. if(m_nSelectedItem!=-1 || nChar==VK_DOWN /* Cheat */)
  419. {
  420. if(nChar==VK_DOWN && m_nSelectedItem<m_rectItem.GetSize()-1)
  421. {
  422. nItem=m_nSelectedItem+1;
  423. while(nItem<m_rectItem.GetSize())
  424. {
  425. if(!(m_pMenu->GetMenuState(nItem,MF_BYPOSITION|MF_DISABLED|MF_CHECKED|MF_GRAYED|MF_SEPARATOR)&MF_SEPARATOR)) 
  426. {
  427. SelectItem(nItem);
  428. break;
  429. }
  430. nItem++;
  431. }
  432. return TRUE;
  433. }
  434. if(nChar==VK_UP && m_nSelectedItem)
  435. {
  436. nItem=m_nSelectedItem-1;
  437. while(nItem>=0)
  438. {
  439. if(!(m_pMenu->GetMenuState(nItem,MF_BYPOSITION|MF_DISABLED|MF_CHECKED|MF_GRAYED|MF_SEPARATOR)&MF_SEPARATOR)) 
  440. {
  441. SelectItem(nItem);
  442. break;
  443. }
  444. nItem--;
  445. }
  446. return TRUE;
  447. }
  448. if(nChar==VK_RETURN)
  449. {
  450. UINT nID;
  451. if(!(m_pMenu->GetMenuState(m_nSelectedItem,MF_BYPOSITION|MF_DISABLED|MF_CHECKED|MF_GRAYED|MF_SEPARATOR)&(MF_DISABLED|MF_GRAYED))) 
  452. {
  453. if((nID=m_pMenu->GetMenuItemID(m_nSelectedItem))!=0)
  454. {
  455. m_pToolbar->SendMessage(WM_MENU_DISMISS);
  456. m_pParent->PostMessage(WM_COMMAND,nID,NULL);
  457. DestroyRootMenu();
  458. }
  459. }
  460. return TRUE;
  461. }
  462. if(TranslateMenuChar(nChar)) return TRUE;
  463. }
  464. return FALSE;
  465. }
  466. BOOL CNGenericPopup::TranslateMenuChar(UINT nChar)
  467. {
  468. for(int n=0; n<m_accelList.GetSize(); n++)
  469. {
  470. if(m_accelList[n].nKey==(UINT)toupper(nChar))
  471. {
  472. m_pToolbar->SendMessage(WM_MENU_DISMISS);
  473. m_pParent->PostMessage(WM_COMMAND,m_accelList[n].nId);
  474. DestroyRootMenu();
  475. return TRUE;
  476. }
  477. }
  478. return FALSE;
  479. }
  480. void CNGenericPopup::OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags) 
  481. {
  482. if(KeyboardFilter(nChar,nRepCnt,nFlags)) return;
  483. if(m_pToolbar->KeyboardFilter(nChar,nRepCnt,nFlags)) return;
  484. CWnd::OnKeyDown(nChar, nRepCnt, nFlags);
  485. }
  486. void CNGenericPopup::DestroyRootMenu()
  487. {
  488. if(m_pParent->IsKindOf(RUNTIME_CLASS(CNGenericPopup)))
  489. ((CNGenericPopup*)m_pParent)->DestroyRootMenu();
  490. else
  491. {
  492. DestroyWindow();
  493. m_pToolbar->GetParentFrame()->SetFocus();
  494. }
  495. }
  496. LRESULT CNGenericPopup::OnInitMenuPopup(WPARAM wParam, LPARAM lParam)
  497. {
  498. return m_pParent->SendMessage(WM_INITMENUPOPUP,wParam,lParam);
  499. }
  500. LRESULT CNGenericPopup::OnMenuSelect(WPARAM wParam, LPARAM lParam)
  501. {
  502. return m_pParent->SendMessage(WM_MENUSELECT,wParam,lParam);
  503. }
  504. BOOL CNGenericPopup::SetIconMap(int nIconMapSize, IconMap* pIconMap)
  505. {
  506. m_nIconMapSize=nIconMapSize;
  507. m_pIconMap=pIconMap;
  508. return TRUE;
  509. }