GuiFolder.cpp
上传用户:wlkj888
上传日期:2022-08-01
资源大小:806k
文件大小:16k
源码类别:

对话框与窗口

开发平台:

Visual C++

  1. /****************************************************************************
  2.  * *  
  3.  * GuiToolKit   *
  4.  *  (MFC extension) *  
  5.  * Created by Francisco Campos G. www.beyondata.com fcampos@beyondata.com *
  6.  *--------------------------------------------------------------------------*    
  7.  * *
  8.  * This program is free software;so you are free to use it any of your *
  9.  * applications (Freeware, Shareware, Commercial),but leave this header *
  10.  * intact. *
  11.  * *
  12.  * These files are provided "as is" without warranty of any kind. *
  13.  * *
  14.  *        GuiToolKit is forever FREE CODE !!!!! *
  15.  * *
  16.  *--------------------------------------------------------------------------*
  17.  * Created by: Francisco Campos G. *
  18.  * Bug Fixes and improvements : (Add your name) *
  19.  * -Francisco Campos *
  20.  * -Ernesto Garcia *
  21.  * -Serge Koroleuve *
  22.  * -MarkDoubson *
  23.  * *
  24.  ****************************************************************************/
  25. #include "stdafx.h"
  26. #include "GuiFolder.h"
  27. #include "GuiDrawLayer.h"
  28. #include "Guifolder.h"
  29. #ifdef _DEBUG
  30. #define new DEBUG_NEW
  31. #undef THIS_FILE
  32. static char THIS_FILE[] = __FILE__;
  33. #endif
  34. /////////////////////////////////////////////////////////////////////////////
  35. // CGuiFolder
  36. IMPLEMENT_DYNAMIC(CGuiFolder,CWnd)
  37. CFolderBar::CFolderBar(CWnd* m_wnd,LPCSTR lp_msg,UINT uImg)
  38. {
  39. m_Cwnd=m_wnd;
  40. m_lpMsg=lp_msg;
  41. m_img=uImg;
  42. m_rect=CRect(0,0,0,0);
  43. m_posUp=TRUE;
  44. }
  45. CGuiFolder::CGuiFolder()
  46. {
  47. m_ArrayFolder.RemoveAll();
  48. m_NumFolders=0;
  49. m_numFolderDown=0;
  50. m_numFolderUp=0;
  51. m_iSelected=0;
  52. m_ultimoFolderResal =-1;
  53. m_itemp=0;
  54. m_typel=mOutlook;//by default
  55. m_iWhatFolderIsDrawNow=0;
  56. m_StyleDisplay=GUISTYLE_2003;
  57. }
  58. CGuiFolder::~CGuiFolder()
  59. {
  60. }
  61. BEGIN_MESSAGE_MAP(CGuiFolder, CWnd)
  62. //{{AFX_MSG_MAP(CGuiFolder)
  63. ON_WM_MOUSEMOVE()
  64. ON_WM_PAINT()
  65. ON_WM_SIZE()
  66. ON_WM_TIMER()
  67. ON_WM_ERASEBKGND()
  68. ON_WM_LBUTTONDOWN()
  69. ON_WM_LBUTTONUP()
  70. //}}AFX_MSG_MAP
  71. ON_WM_DESTROY()
  72. END_MESSAGE_MAP()
  73. /////////////////////////////////////////////////////////////////////////////
  74. // CGuiFolder message handlers
  75. BOOL CGuiFolder::Create(DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID) 
  76. {
  77. // TODO: Add your specialized code here and/or call the base class
  78. return CWnd::Create(NULL,_T(""), dwStyle|WS_CHILD, rect, pParentWnd, nID);
  79. }
  80. void CGuiFolder::OnLButtonDown(UINT nFlags, CPoint point) 
  81. {
  82. // TODO: Add your message handler code here and/or call default
  83. int m_iNumBotton=m_ArrayFolder.GetSize();
  84. for( int iCont=0; iCont< m_iNumBotton;iCont++)
  85. {
  86. CFolderBar* cit=(CFolderBar*)m_ArrayFolder[iCont];
  87. if (cit->m_rect.PtInRect(point))
  88. {
  89. DrawFolder(cit,mPush);
  90. }
  91. }
  92. CWnd::OnLButtonDown(nFlags, point);
  93. }
  94. void CGuiFolder::PreSubclassWindow() 
  95. {
  96. ModifyStyle(0,BS_OWNERDRAW);
  97. CWnd::PreSubclassWindow();
  98. }
  99. void CGuiFolder::OnLButtonUp(UINT nFlags, CPoint point) 
  100. {
  101. // TODO: Add your message handler code here and/or call default
  102. int m_iNumBotton=m_ArrayFolder.GetSize();
  103. for( int iCont=0; iCont< m_iNumBotton;iCont++)
  104. {
  105. CFolderBar* cit=(CFolderBar*)m_ArrayFolder[iCont];
  106. if (cit->m_rect.PtInRect(point))
  107. {
  108. DrawFolder(cit,mFlat);
  109. m_itemp=m_iSelected;
  110. m_iSelected=iCont;
  111. EfectoScroll();
  112. }
  113. }
  114. CWnd::OnLButtonUp(nFlags, point);
  115. }
  116. void CGuiFolder::TypeLook(TypeFolder tol)
  117. {
  118. m_typel=tol;
  119. }
  120. void CGuiFolder::EfectoScroll()
  121. {
  122. int m_iNumBotton=m_ArrayFolder.GetSize();
  123. int m_iSentidoScroll=0; //1=hacia abajo, 2=hacia arriba
  124. if (m_iNumBotton > 0) //si existe un solo folder no haga nada
  125. {
  126. // si es el ultimo folder y no esta abajo no haga nada
  127. if (m_iSelected == m_NumFolders-1 &&
  128. ((CFolderBar*)m_ArrayFolder[m_iSelected])->m_posUp ==TRUE)
  129. {
  130. m_iSelected=m_itemp;
  131. return;
  132. }
  133. else if (((CFolderBar*)m_ArrayFolder[m_iSelected])->m_posUp ==TRUE )
  134. {
  135. if (((CFolderBar*)m_ArrayFolder[m_iSelected+1])->m_posUp ==FALSE)
  136. return;
  137. m_iSentidoScroll =1;
  138. //de esta posici髇 todos los folders hacia abajo 
  139. for (int iCont=m_iSelected+1;iCont < m_iNumBotton; iCont++)
  140. ((CFolderBar*)m_ArrayFolder[iCont])->m_posUp =FALSE;
  141. }
  142. else if (((CFolderBar*)m_ArrayFolder[m_iSelected])->m_posUp ==FALSE)
  143. {
  144. m_iSentidoScroll =2;
  145. //de esta posici髇 todos los folders van arriba
  146. for (int iCont=m_iSelected;iCont >0; iCont--)
  147. ((CFolderBar*)m_ArrayFolder[iCont])->m_posUp =TRUE;
  148. }
  149. }
  150. CRect m_rect=((CFolderBar*)m_ArrayFolder[m_iSelected])->m_rect;
  151. CClientDC dc(this);
  152. if (m_iSentidoScroll >0)
  153. {
  154. CWnd* pParent=((CFolderBar*)m_ArrayFolder[m_itemp])->m_Cwnd;
  155. ASSERT_VALID(pParent);
  156. CWnd* pParentn=((CFolderBar*)m_ArrayFolder[m_iSelected])->m_Cwnd;
  157. ASSERT_VALID(pParentn);
  158. pParent->ShowWindow(SW_HIDE);
  159. pParentn->ShowWindow(SW_SHOW);
  160. m_AntFolder=m_iSelected;
  161. }
  162. if (m_iSentidoScroll ==1)
  163. {
  164. /*CGuiFolderBar* cb=(CGuiFolderBar*)m_ArrayFolder[m_iSelected];
  165. CWnd* m_cwnd=((CGuiFolderBar*)m_ArrayFolder[m_iSelected])->m_Cwnd;
  166. CRect rctemp=cb->m_rect;
  167. while (m_rect.bottom < m_iPosDown)
  168. {
  169. m_cwnd->SetWindowPos(NULL,m_rect.left,cb->m_rect.bottom,m_rect.Width(),m_rect.bottom,
  170. SWP_NOACTIVATE|SWP_NOZORDER);
  171. m_rect.bottom+=10;
  172. //DrawFolder(cb,mFlat);
  173. //m_cwnd->Invalidate();
  174. //m_cwnd->SendMessage(WM_PAINT,0,0);
  175. }*/
  176. RecalLayout();
  177. }
  178. else if (m_iSentidoScroll ==2)
  179. {
  180. /*CWnd* m_cwnd=((CGuiFolderBar*)m_ArrayFolder[m_iSelected])->m_Cwnd;
  181. CGuiFolderBar* cb=(CGuiFolderBar*)m_ArrayFolder[m_iSelected];
  182. while (m_rect.top > m_iposUp)
  183. {
  184. m_cwnd->SetWindowPos(NULL,m_rect.left,m_iposUp-1,m_rect.Width(),m_iPosDown-m_iposUp,
  185. SWP_NOACTIVATE|SWP_NOZORDER);
  186. cb->m_rect.top-=10;
  187. cb->m_rect.bottom-=10;
  188. Sleep(50);
  189. DrawFolder(cb,mFlat);
  190. }
  191. */
  192. RecalLayout();
  193. }
  194. else
  195. m_iSelected=m_itemp;
  196. }
  197. void CGuiFolder::OnMouseMove(UINT nFlags, CPoint point) 
  198. {
  199. int m_iNumBotton= m_ArrayFolder.GetSize();
  200. static int m_AntTecla=-1;
  201. for( int iCont=0; iCont< m_iNumBotton;iCont++)
  202. {
  203. CFolderBar* cit=(CFolderBar*)m_ArrayFolder[iCont];
  204. m_iWhatFolderIsDrawNow=iCont;
  205. if (cit->m_rect.PtInRect(point))
  206. {
  207. if (m_ultimoFolderResal==m_AntTecla &&
  208. (m_ultimoFolderResal!=-1 && m_AntTecla !=-1)) return;
  209. else
  210. {
  211.   if (m_ultimoFolderResal != -1)
  212.   {
  213. CFolderBar* cit1=(CFolderBar*)m_ArrayFolder[m_ultimoFolderResal];
  214. DrawFolder(cit1,mFlat);
  215.   }
  216. }
  217. DrawFolder(cit,mNormal);
  218. m_AntTecla=m_ultimoFolderResal;
  219. m_ultimoFolderResal=iCont;
  220. SetTimer(1,100,NULL);
  221. return;
  222. }
  223. }
  224. if (m_ultimoFolderResal != -1)
  225.  {
  226. CFolderBar* cit1=(CFolderBar*)m_ArrayFolder[m_ultimoFolderResal];
  227. DrawFolder(cit1,mFlat);
  228. m_ultimoFolderResal=-1;
  229.  }
  230. m_AntTecla=-1;
  231. CWnd::OnMouseMove(nFlags, point);
  232. }
  233. void CGuiFolder::DrawFolder(CFolderBar* cfb,Style m_Style)
  234. {
  235. CRect rc=cfb->m_rect;
  236. CBrush cb;
  237. CClientDC pDC(this);
  238. cb.CreateSolidBrush(GuiDrawLayer::GetRGBColorFace());
  239. rc.top+=1;
  240. rc.right-=1;
  241. if (m_StyleDisplay == GUISTYLE_2003)
  242. {
  243. CGradient M(CSize(rc.Width(),rc.Height()));
  244. if(m_Style != mOutlook)
  245. {
  246. if (GuiDrawLayer::m_Theme)
  247. M.PrepareVertical(&pDC,m_StyleDisplay);
  248. else
  249. M.PrepareVertical(&pDC);
  250. }
  251. else
  252. {
  253. M.PrepareCaption(&pDC,m_StyleDisplay);
  254. }
  255. M.Draw(&pDC,rc.left-1,rc.top-1,0,0,rc.Width(),rc.Height(),SRCCOPY);
  256. CRect rcWin=rc;
  257. //rcWin.left= gripper.left;
  258. rcWin.top+=5;
  259. rcWin.left=rcWin.right-5;
  260. rcWin.right=rcWin.left+2;
  261. rcWin.bottom-=4;
  262. CRect rcBlack;
  263. for (int i=0; i < rcWin.Height()-1; i+=4)
  264. {
  265. CRect rcWindow;
  266. CBrush cb;
  267. cb.CreateSolidBrush(::GetSysColor(COLOR_BTNHIGHLIGHT));
  268. rcWindow=rcWin;
  269. rcWindow.top=rcWin.top+i;
  270. rcWindow.bottom=rcWindow.top+2;
  271. pDC.FillRect(rcWindow,&cb);
  272. rcBlack=rcWindow;
  273. rcBlack.left-=1;
  274. rcBlack.top=(rcWin.top+i)-1;
  275. rcBlack.bottom=rcBlack.top+2;
  276. rcBlack.right=rcBlack.left+2;
  277. cb.DeleteObject();
  278. cb.CreateSolidBrush(::GetSysColor(COLOR_BTNSHADOW));
  279. pDC.FillRect(rcBlack,&cb);
  280. }
  281. pDC.Draw3dRect(rc, m_Style != mOutlook? GuiDrawLayer::GetRGBColorBTNHigh():GuiDrawLayer::GetRGBPressBXP(),GuiDrawLayer::GetRGBColorShadow(GuiDrawLayer::m_Style));
  282. }
  283. if (m_StyleDisplay == GUISTYLE_XP)
  284. {
  285. pDC.FillRect(&rc,&cb);
  286. if (m_typel!=mOutlook)
  287. {
  288. rc.right-=30;
  289. }
  290. if (m_Style == mNormal)
  291. {
  292. pDC.Draw3dRect(rc, GuiDrawLayer::GetRGBColorBTNHigh(),GuiDrawLayer::GetRGBColorShadow(m_StyleDisplay));
  293. rc.DeflateRect(1,1);
  294. pDC.Draw3dRect(rc, GuiDrawLayer::GetRGBColorFace(GuiDrawLayer::m_Style),GuiDrawLayer::GetRGBColorShadow(m_StyleDisplay));
  295. }
  296. else if (m_Style == mFlat)
  297. pDC.Draw3dRect(rc, GuiDrawLayer::GetRGBColorBTNHigh(),GuiDrawLayer::GetRGBColorShadow(m_StyleDisplay));
  298. else if (m_Style == mPush)
  299. pDC.Draw3dRect(rc, GuiDrawLayer::GetRGBColorShadow(m_StyleDisplay),GuiDrawLayer::GetRGBColorBTNHigh());
  300. }
  301. int OldMode=pDC.SetBkMode(TRANSPARENT);
  302. cfont = pDC.SelectObject(CFont::FromHandle((HFONT)GetStockObject(DEFAULT_GUI_FONT)));
  303. CString m_cadBreak=cfb->m_lpMsg;
  304. int cont=m_cadBreak.GetLength();
  305. CSize coor=pDC.GetTextExtent(m_cadBreak,m_cadBreak.GetLength());
  306. if ( coor.cx > rc.Width()-20)
  307. {
  308. rc.left+=1;
  309. while(cont > 1 )
  310. {
  311. CString m_scadtemp=m_cadBreak+"...";
  312. CSize coor=pDC.GetTextExtent(m_scadtemp,m_scadtemp.GetLength());
  313. if(coor.cx > rc.Width())
  314. m_cadBreak=m_cadBreak.Left(m_cadBreak.GetLength()-1);
  315. else
  316. break;
  317. cont--;
  318. }
  319. m_cadBreak+=_T("...");
  320. rc.right+=3;
  321. pDC.DrawText(m_cadBreak,rc,DT_SINGLELINE|DT_LEFT|DT_VCENTER);
  322. }
  323. else
  324. {
  325.   if (m_typel!=mOutlook)
  326. pDC.DrawText(cfb->m_lpMsg,rc,DT_SINGLELINE|DT_LEFT|DT_VCENTER);
  327.   else
  328. pDC.DrawText(cfb->m_lpMsg,rc,DT_WORDBREAK|DT_SINGLELINE|DT_CENTER|DT_VCENTER);
  329. }
  330.     pDC.SetBkColor(OldMode);
  331. }
  332. void CGuiFolder::OnPaint() 
  333. {
  334. CPaintDC dc(this); // device context for painting
  335. CRect mrect;
  336. int m_iNumFolder=m_ArrayFolder.GetSize();
  337. //mrect.InflateRect(1,1);
  338. //GetClientRect(mrect);
  339. //dc.Draw3dRect(mrect, ::GetSysColor(COLOR_BTNSHADOW),::GetSysColor(COLOR_BTNHIGHLIGHT));
  340. for ( int iCont=0; iCont< m_iNumFolder; iCont++)
  341. {
  342. m_iWhatFolderIsDrawNow=iCont;
  343. if (m_iSelected== iCont)
  344. DrawFolder((CFolderBar*) m_ArrayFolder[iCont],mFlat);
  345. else
  346. DrawFolder((CFolderBar*) m_ArrayFolder[iCont],mFlat);
  347. }
  348. }
  349. void CGuiFolder::OnSize(UINT nType, int cx, int cy) 
  350. {
  351. CWnd::OnSize(nType, cx, cy);
  352. if (m_NumFolders > 0)
  353. RecalLayout();
  354. // TODO: Add your message handler code here
  355. }
  356. void CGuiFolder::OnTimer(UINT nIDEvent) 
  357. {
  358. // TODO: Add your message handler code here and/or call default
  359. if (nIDEvent == 1)
  360. {
  361. CRect rc;
  362. CPoint pt(GetMessagePos());
  363. ScreenToClient (&pt);
  364. GetClientRect(&rc);
  365. if (m_ultimoFolderResal != -1)
  366. {
  367. CFolderBar* cfd=(CFolderBar*) m_ArrayFolder[m_ultimoFolderResal];
  368. rc=cfd->m_rect;
  369. }
  370. if (!rc.PtInRect(pt))
  371. {
  372. if (m_ultimoFolderResal != -1)
  373. {
  374. CFolderBar* cfd=(CFolderBar*) m_ArrayFolder[m_ultimoFolderResal];
  375. CClientDC dc(this);
  376. DrawFolder(cfd,mFlat);
  377. m_ultimoFolderResal=-1;
  378. }
  379. KillTimer(1);
  380. }
  381. }
  382. CWnd::OnTimer(nIDEvent);
  383. }
  384. int CGuiFolder::PointInFolder(CPoint pt)
  385. {
  386. for (int i=0; i < m_ArrayFolder.GetSize(); i++)
  387. {
  388. if ( ((CFolderBar*) m_ArrayFolder[i])->m_rect.PtInRect(pt) )
  389. return i;
  390. }
  391. return -1;
  392. }
  393. BOOL CGuiFolder::PreTranslateMessage(MSG* pMsg) 
  394. {
  395. // TODO: Add your specialized code here and/or call the base class
  396. return CWnd::PreTranslateMessage(pMsg);
  397. }
  398. void CGuiFolder::RecalLayout()
  399. {
  400. CRect m_rect;
  401. CRect m_rectFolder;
  402. m_iPosDown=0; //a partir de donde se ubica el anterior folder
  403. m_iposUp=0;   //a partir de donde se ubica el siguiente folder
  404. int m_iNumFolder=m_ArrayFolder.GetSize();
  405. GetClientRect(&m_rect);
  406. m_rectFolder=m_rect;
  407. m_iPosDown=m_rect.bottom;
  408. for ( int iCont=0; iCont< m_iNumFolder; iCont++)
  409. {
  410. CFolderBar* cfd=(CFolderBar*) m_ArrayFolder[iCont];
  411. if (iCont==0) //inevitablemente arriba
  412. {
  413. m_rectFolder.bottom=m_rect.top+23;
  414. m_iposUp+=m_rectFolder.Height()-1;
  415. cfd->m_rect=m_rectFolder;
  416. }
  417. else
  418. {
  419. if (cfd->m_posUp)
  420. {
  421. m_rectFolder.top=m_iposUp;
  422. m_rectFolder.bottom=m_rectFolder.top+23;
  423. m_iposUp+=m_rectFolder.Height();
  424. cfd->m_rect=m_rectFolder;
  425. }
  426. else
  427. {
  428. for(int iRev=m_iNumFolder-1; iRev>=iCont; iRev--)
  429. {
  430. CFolderBar* cfd=(CFolderBar*) m_ArrayFolder[iRev];
  431. m_rectFolder.bottom=m_iPosDown;
  432. m_rectFolder.top=m_rectFolder.bottom-21;
  433. m_iPosDown-=m_rectFolder.Height();
  434. cfd->m_rect=m_rectFolder;
  435. }
  436. break;
  437. }
  438. }
  439. }
  440. CFolderBar* cfd=(CFolderBar*) m_ArrayFolder[m_iSelected];
  441. CWnd* m_cwnd=cfd->m_Cwnd;
  442. int nAddPos;
  443. if (m_iSelected == 0)
  444. nAddPos=1;
  445. else
  446. nAddPos=0;
  447. m_cwnd->SetWindowPos(NULL,m_rect.left,m_iposUp+nAddPos,m_rectFolder.Width(),(m_iPosDown-m_iposUp),
  448. SWP_NOACTIVATE|SWP_NOZORDER |SWP_NOREDRAW);
  449. // Invalidate();
  450. // UpdateWindow();
  451. }
  452. void CGuiFolder::AddFolder(CWnd* pParent,LPCSTR lpMsg, UINT uIMg)
  453. {
  454. m_ArrayFolder.SetAtGrow(m_NumFolders, new CFolderBar(pParent,lpMsg,uIMg));
  455. if (m_NumFolders == 0)
  456.   m_numFolderUp=1;
  457. if (m_NumFolders > 0)
  458. {
  459. for( int iCont=0; iCont< m_NumFolders;iCont++)
  460. {
  461. CFolderBar* cit=(CFolderBar*)m_ArrayFolder[iCont];
  462. cit->m_Cwnd->ShowWindow(SW_HIDE);
  463. }
  464. }
  465. pParent->ShowWindow(SW_SHOW);
  466. m_iSelected=m_NumFolders;
  467. m_AntFolder=m_iSelected;
  468. m_NumFolders++;
  469. RecalLayout();
  470. }
  471. BOOL CGuiFolder::OnEraseBkgnd(CDC* pDC) 
  472. {
  473. CBrush cbr;
  474. cbr.CreateSolidBrush(GuiDrawLayer::GetRGBColorFace());
  475. CRect m_rect;
  476. GetClientRect(m_rect);
  477. if (m_NumFolders<= 0)
  478. pDC->FillRect(m_rect,&cbr);
  479. else
  480. {
  481. for (int i=0;i<2; i++)
  482. {
  483. pDC->Draw3dRect(m_rect,GuiDrawLayer::GetRGBColorFace(),GuiDrawLayer::GetRGBColorFace());
  484. m_rect.DeflateRect(1,1);
  485. }
  486. }
  487. return TRUE;
  488. }
  489. void CGuiFolder::DeleteFolder(int m_iNumFolder, BOOL bUpdate)
  490. {
  491. if (m_iNumFolder < m_NumFolders)
  492. {
  493. if (bUpdate && m_iNumFolder == m_NumFolders -1)
  494. SelectFolder(0);
  495. if (m_iNumFolder == m_iSelected && m_iNumFolder != 0)
  496. {
  497. SelectFolder(1);
  498. m_iSelected = 1;
  499. }
  500. CFolderBar* pBar = (CFolderBar*)m_ArrayFolder.GetAt(m_iNumFolder); 
  501. m_ArrayFolder.RemoveAt(m_iNumFolder,1);
  502. delete pBar;
  503. m_NumFolders--;
  504. if (m_iNumFolder == m_NumFolders)
  505. m_iSelected = m_iNumFolder - 1;
  506. if (m_iNumFolder == 0)
  507. m_iSelected = m_NumFolders - 1;
  508. else if(m_iNumFolder > 0)
  509. m_iSelected = m_iNumFolder - 1;
  510. if (bUpdate) 
  511. {
  512. int OldSel = m_iSelected;
  513. RecalLayout();
  514. SelectFolder(0);
  515. SelectFolder(m_NumFolders - 1);
  516. SelectFolder(OldSel);
  517. }
  518. }
  519. }
  520. void CGuiFolder::SelectFolder(int m_iNumFolder)
  521. {
  522. CFolderBar* cf = (CFolderBar*) m_ArrayFolder[m_iNumFolder];
  523. if (cf)
  524. {
  525. DrawFolder(cf,mFlat);
  526. m_itemp = m_iSelected;
  527. m_iSelected = m_iNumFolder;
  528. EfectoScroll();
  529. }
  530. }
  531. void CGuiFolder::RemoveAllFolder()
  532. {
  533. m_ArrayFolder.RemoveAll();
  534. Invalidate();
  535. m_NumFolders=-1;
  536. m_iSelected=-1;
  537. }
  538. //thanks to  Ernesto Garcia
  539. void CGuiFolder::OnDestroy()
  540. {
  541. for( int i=0; i<m_NumFolders; i++ )
  542.     {
  543.     CFolderBar *pArr = (CFolderBar*)m_ArrayFolder.GetAt(i);
  544.     if( pArr )
  545.         delete pArr;
  546.     }
  547. CWnd::OnDestroy();
  548. // TODO: Add your message handler code here
  549. }