PropertyList.cpp 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662
  1. // PropertyList.cpp : implementation file
  2. //
  3. #include "stdafx.h"
  4. #include "PropertyList.h"
  5. #include "PathDialog.h"
  6. #include "../cmCacheManager.h"
  7. #define IDC_PROPCMBBOX 712
  8. #define IDC_PROPEDITBOX 713
  9. #define IDC_PROPBTNCTRL 714
  10. #define IDC_PROPCHECKBOXCTRL 715
  11. /////////////////////////////////////////////////////////////////////////////
  12. // CPropertyList
  13. CPropertyList::CPropertyList()
  14. {
  15. m_Dirty = false;
  16. m_curSel = -1;
  17. }
  18. CPropertyList::~CPropertyList()
  19. {
  20. for(std::set<CPropertyItem*>::iterator i = m_PropertyItems.begin();
  21. i != m_PropertyItems.end(); ++i)
  22. {
  23. delete *i;
  24. }
  25. }
  26. BEGIN_MESSAGE_MAP(CPropertyList, CListBox)
  27. //{{AFX_MSG_MAP(CPropertyList)
  28. ON_WM_CREATE()
  29. ON_CONTROL_REFLECT(LBN_SELCHANGE, OnSelchange)
  30. ON_WM_LBUTTONUP()
  31. ON_WM_KILLFOCUS()
  32. ON_WM_LBUTTONDOWN()
  33. ON_WM_RBUTTONUP()
  34. ON_WM_MOUSEMOVE()
  35. //}}AFX_MSG_MAP
  36. ON_CBN_KILLFOCUS(IDC_PROPCMBBOX, OnKillfocusCmbBox)
  37. ON_CBN_SELCHANGE(IDC_PROPCMBBOX, OnSelchangeCmbBox)
  38. ON_EN_KILLFOCUS(IDC_PROPEDITBOX, OnKillfocusEditBox)
  39. ON_EN_CHANGE(IDC_PROPEDITBOX, OnChangeEditBox)
  40. ON_BN_CLICKED(IDC_PROPBTNCTRL, OnButton)
  41. ON_BN_CLICKED(IDC_PROPCHECKBOXCTRL, OnCheckBox)
  42. ON_COMMAND(42, OnDelete)
  43. ON_COMMAND(43, OnHelp)
  44. END_MESSAGE_MAP()
  45. /////////////////////////////////////////////////////////////////////////////
  46. // CPropertyList message handlers
  47. BOOL CPropertyList::PreCreateWindow(CREATESTRUCT& cs)
  48. {
  49. if (!CListBox::PreCreateWindow(cs))
  50. return FALSE;
  51. cs.style &= ~(LBS_OWNERDRAWVARIABLE | LBS_SORT);
  52. cs.style |= LBS_OWNERDRAWFIXED;
  53. m_bTracking = FALSE;
  54. m_nDivider = 0;
  55. m_bDivIsSet = FALSE;
  56. return TRUE;
  57. }
  58. void CPropertyList::MeasureItem(LPMEASUREITEMSTRUCT lpMeasureItemStruct)
  59. {
  60. lpMeasureItemStruct->itemHeight = 20; //pixels
  61. }
  62. void CPropertyList::DrawItem(LPDRAWITEMSTRUCT lpDIS)
  63. {
  64. CDC dc;
  65. dc.Attach(lpDIS->hDC);
  66. CRect rectFull = lpDIS->rcItem;
  67. CRect rect = rectFull;
  68. if (m_nDivider==0)
  69. m_nDivider = rect.Width() / 2;
  70. rect.left = m_nDivider;
  71. CRect rect2 = rectFull;
  72. rect2.right = rect.left - 1;
  73. UINT nIndex = lpDIS->itemID;
  74. if (nIndex != (UINT) -1)
  75. {
  76. //draw two rectangles, one for each row column
  77. dc.FillSolidRect(rect2,RGB(192,192,192));
  78. dc.DrawEdge(rect2,EDGE_SUNKEN,BF_BOTTOMRIGHT);
  79. dc.DrawEdge(rect,EDGE_SUNKEN,BF_BOTTOM);
  80. //get the CPropertyItem for the current row
  81. CPropertyItem* pItem = (CPropertyItem*) GetItemDataPtr(nIndex);
  82. //write the property name in the first rectangle
  83. dc.SetBkMode(TRANSPARENT);
  84. dc.DrawText(pItem->m_propName,CRect(rect2.left+3,rect2.top+3,
  85. rect2.right-3,rect2.bottom+3),
  86. DT_LEFT | DT_SINGLELINE);
  87. //write the initial property value in the second rectangle
  88. dc.DrawText(pItem->m_curValue,CRect(rect.left+3,rect.top+3,
  89. rect.right+3,rect.bottom+3),
  90. DT_LEFT | DT_SINGLELINE);
  91. }
  92. dc.Detach();
  93. }
  94. int CPropertyList::AddItem(CString txt)
  95. {
  96. int nIndex = AddString(txt);
  97. return nIndex;
  98. }
  99. int CPropertyList::AddPropItem(CPropertyItem* pItem)
  100. {
  101. int nIndex = AddString(_T(""));
  102. SetItemDataPtr(nIndex,pItem);
  103. m_PropertyItems.insert(pItem);
  104. return nIndex;
  105. }
  106. int CPropertyList::AddProperty(const char* name,
  107. const char* value,
  108. const char* helpString,
  109. int type,
  110. const char* comboItems)
  111. {
  112. CPropertyItem* pItem = 0;
  113. for(int i =0; i < this->GetCount(); ++i)
  114. {
  115. CPropertyItem* item = this->GetItem(i);
  116. if(item->m_propName == name)
  117. {
  118. pItem = item;
  119. if(pItem->m_curValue != value)
  120. {
  121. pItem->m_curValue = value;
  122. pItem->m_HelpString = helpString;
  123. m_Dirty = true;
  124. Invalidate();
  125. }
  126. return i;
  127. }
  128. }
  129. // if it is not found, then create a new one
  130. if(!pItem)
  131. {
  132. pItem = new CPropertyItem(name, value, helpString, type, comboItems);
  133. }
  134. return this->AddPropItem(pItem);
  135. }
  136. int CPropertyList::OnCreate(LPCREATESTRUCT lpCreateStruct)
  137. {
  138. if (CListBox::OnCreate(lpCreateStruct) == -1)
  139. return -1;
  140. m_bDivIsSet = FALSE;
  141. m_nDivider = 0;
  142. m_bTracking = FALSE;
  143. m_hCursorSize = AfxGetApp()->LoadStandardCursor(IDC_SIZEWE);
  144. m_hCursorArrow = AfxGetApp()->LoadStandardCursor(IDC_ARROW);
  145. m_SSerif8Font.CreatePointFont(80,_T("MS Sans Serif"));
  146. return 0;
  147. }
  148. void CPropertyList::OnSelchange()
  149. {
  150. CRect rect;
  151. CString lBoxSelText;
  152. GetItemRect(m_curSel,rect);
  153. rect.left = m_nDivider;
  154. CPropertyItem* pItem = (CPropertyItem*) GetItemDataPtr(m_curSel);
  155. if (m_btnCtrl)
  156. m_btnCtrl.ShowWindow(SW_HIDE);
  157. if (m_CheckBoxControl)
  158. m_CheckBoxControl.ShowWindow(SW_HIDE);
  159. if (pItem->m_nItemType==CPropertyList::COMBO)
  160. {
  161. //display the combo box. If the combo box has already been
  162. //created then simply move it to the new location, else create it
  163. m_nLastBox = 0;
  164. if (m_cmbBox)
  165. m_cmbBox.MoveWindow(rect);
  166. else
  167. {
  168. rect.bottom += 100;
  169. m_cmbBox.Create(CBS_DROPDOWNLIST
  170. | CBS_NOINTEGRALHEIGHT | WS_VISIBLE
  171. | WS_CHILD | WS_BORDER,
  172. rect,this,IDC_PROPCMBBOX);
  173. m_cmbBox.SetFont(&m_SSerif8Font);
  174. }
  175. //add the choices for this particular property
  176. CString cmbItems = pItem->m_cmbItems;
  177. lBoxSelText = pItem->m_curValue;
  178. m_cmbBox.ResetContent();
  179. int i,i2;
  180. i=0;
  181. while ((i2=cmbItems.Find('|',i)) != -1)
  182. {
  183. m_cmbBox.AddString(cmbItems.Mid(i,i2-i));
  184. i=i2+1;
  185. }
  186. if(i != 0)
  187. m_cmbBox.AddString(cmbItems.Mid(i));
  188. m_cmbBox.ShowWindow(SW_SHOW);
  189. m_cmbBox.SetFocus();
  190. //jump to the property's current value in the combo box
  191. int j = m_cmbBox.FindStringExact(0,lBoxSelText);
  192. if (j != CB_ERR)
  193. m_cmbBox.SetCurSel(j);
  194. else
  195. m_cmbBox.SetCurSel(0);
  196. }
  197. else if (pItem->m_nItemType==CPropertyList::EDIT)
  198. {
  199. //display edit box
  200. m_nLastBox = 1;
  201. m_prevSel = m_curSel;
  202. rect.bottom -= 3;
  203. if (m_editBox)
  204. m_editBox.MoveWindow(rect);
  205. else
  206. {
  207. m_editBox.Create(ES_LEFT | ES_AUTOHSCROLL | WS_VISIBLE
  208. | WS_CHILD | WS_BORDER,
  209. rect,this,IDC_PROPEDITBOX);
  210. m_editBox.SetFont(&m_SSerif8Font);
  211. }
  212. lBoxSelText = pItem->m_curValue;
  213. m_editBox.ShowWindow(SW_SHOW);
  214. m_editBox.SetFocus();
  215. //set the text in the edit box to the property's current value
  216. m_editBox.SetWindowText(lBoxSelText);
  217. }
  218. else if (pItem->m_nItemType == CPropertyList::CHECKBOX)
  219. {
  220. rect.bottom -= 3;
  221. if (m_CheckBoxControl)
  222. m_CheckBoxControl.MoveWindow(rect);
  223. else
  224. {
  225. m_CheckBoxControl.Create("check",BS_CHECKBOX
  226. | BM_SETCHECK |BS_LEFTTEXT
  227. | WS_VISIBLE | WS_CHILD,
  228. rect,this,IDC_PROPCHECKBOXCTRL);
  229. m_CheckBoxControl.SetFont(&m_SSerif8Font);
  230. }
  231. lBoxSelText = pItem->m_curValue;
  232. m_CheckBoxControl.ShowWindow(SW_SHOW);
  233. m_CheckBoxControl.SetFocus();
  234. //set the text in the edit box to the property's current value
  235. if(lBoxSelText == "ON")
  236. {
  237. m_CheckBoxControl.SetCheck(1);
  238. }
  239. else
  240. {
  241. m_CheckBoxControl.SetCheck(0);
  242. }
  243. }
  244. else
  245. DisplayButton(rect);
  246. }
  247. void CPropertyList::DisplayButton(CRect region)
  248. {
  249. //displays a button if the property is a file/color/font chooser
  250. m_nLastBox = 2;
  251. m_prevSel = m_curSel;
  252. if (region.Width() > 25)
  253. region.left = region.right - 25;
  254. region.bottom -= 3;
  255. if (m_btnCtrl)
  256. m_btnCtrl.MoveWindow(region);
  257. else
  258. {
  259. m_btnCtrl.Create("...",BS_PUSHBUTTON | WS_VISIBLE | WS_CHILD,
  260. region,this,IDC_PROPBTNCTRL);
  261. m_btnCtrl.SetFont(&m_SSerif8Font);
  262. }
  263. m_btnCtrl.ShowWindow(SW_SHOW);
  264. m_btnCtrl.SetFocus();
  265. }
  266. void CPropertyList::OnKillFocus(CWnd* pNewWnd)
  267. {
  268. //m_btnCtrl.ShowWindow(SW_HIDE);
  269. CListBox::OnKillFocus(pNewWnd);
  270. }
  271. void CPropertyList::OnKillfocusCmbBox()
  272. {
  273. m_cmbBox.ShowWindow(SW_HIDE);
  274. Invalidate();
  275. }
  276. void CPropertyList::OnKillfocusEditBox()
  277. {
  278. CString newStr;
  279. m_editBox.ShowWindow(SW_HIDE);
  280. Invalidate();
  281. }
  282. void CPropertyList::OnSelchangeCmbBox()
  283. {
  284. CString selStr;
  285. if (m_cmbBox)
  286. {
  287. m_cmbBox.GetLBText(m_cmbBox.GetCurSel(),selStr);
  288. CPropertyItem* pItem = (CPropertyItem*) GetItemDataPtr(m_curSel);
  289. pItem->m_curValue = selStr;
  290. m_Dirty = true;
  291. }
  292. }
  293. void CPropertyList::OnChangeEditBox()
  294. {
  295. CString newStr;
  296. m_editBox.GetWindowText(newStr);
  297. CPropertyItem* pItem = (CPropertyItem*) GetItemDataPtr(m_curSel);
  298. pItem->m_curValue = newStr;
  299. m_Dirty = true;
  300. }
  301. void CPropertyList::OnCheckBox()
  302. {
  303. CPropertyItem* pItem = (CPropertyItem*) GetItemDataPtr(m_curSel);
  304. if(m_CheckBoxControl.GetCheck())
  305. {
  306. pItem->m_curValue = "ON";
  307. }
  308. else
  309. {
  310. pItem->m_curValue = "OFF";
  311. }
  312. m_Dirty = true;
  313. }
  314. void CPropertyList::OnButton()
  315. {
  316. CPropertyItem* pItem = (CPropertyItem*) GetItemDataPtr(m_curSel);
  317. //display the appropriate common dialog depending on what type
  318. //of chooser is associated with the property
  319. if (pItem->m_nItemType == CPropertyList::COLOR)
  320. {
  321. COLORREF initClr;
  322. CString currClr = pItem->m_curValue;
  323. //parse the property's current color value
  324. if (currClr.Find("RGB") > -1)
  325. {
  326. int j = currClr.Find(',',3);
  327. CString bufr = currClr.Mid(4,j-4);
  328. int RVal = atoi(bufr);
  329. int j2 = currClr.Find(',',j+1);
  330. bufr = currClr.Mid(j+1,j2-(j+1));
  331. int GVal = atoi(bufr);
  332. int j3 = currClr.Find(')',j2+1);
  333. bufr = currClr.Mid(j2+1,j3-(j2+1));
  334. int BVal = atoi(bufr);
  335. initClr = RGB(RVal,GVal,BVal);
  336. }
  337. else
  338. initClr = 0;
  339. CColorDialog ClrDlg(initClr);
  340. if (IDOK == ClrDlg.DoModal())
  341. {
  342. COLORREF selClr = ClrDlg.GetColor();
  343. CString clrStr;
  344. clrStr.Format("RGB(%d,%d,%d)",GetRValue(selClr),
  345. GetGValue(selClr),GetBValue(selClr));
  346. m_btnCtrl.ShowWindow(SW_HIDE);
  347. pItem->m_curValue = clrStr;
  348. m_Dirty = true;
  349. Invalidate();
  350. }
  351. }
  352. else if (pItem->m_nItemType == CPropertyList::FILE)
  353. {
  354. CString SelectedFile;
  355. CString Filter("All Files (*.*)||");
  356. CFileDialog FileDlg(TRUE, NULL, NULL, NULL,
  357. Filter);
  358. CString initialDir;
  359. CString currPath = pItem->m_curValue;
  360. if (currPath.GetLength() > 0)
  361. {
  362. int endSlash = currPath.ReverseFind('\\');
  363. if(endSlash == -1)
  364. {
  365. endSlash = currPath.ReverseFind('/');
  366. }
  367. initialDir = currPath.Left(endSlash);
  368. }
  369. initialDir.Replace("/", "\\");
  370. FileDlg.m_ofn.lpstrTitle = "Select file";
  371. if (currPath.GetLength() > 0)
  372. FileDlg.m_ofn.lpstrInitialDir = initialDir;
  373. if(IDOK == FileDlg.DoModal())
  374. {
  375. SelectedFile = FileDlg.GetPathName();
  376. m_btnCtrl.ShowWindow(SW_HIDE);
  377. pItem->m_curValue = SelectedFile;
  378. m_Dirty = true;
  379. Invalidate();
  380. }
  381. }
  382. else if (pItem->m_nItemType == CPropertyList::PATH)
  383. {
  384. CString initialDir;
  385. CString currPath = pItem->m_curValue;
  386. if (currPath.GetLength() > 0)
  387. {
  388. int endSlash = currPath.ReverseFind('\\');
  389. if(endSlash == -1)
  390. {
  391. endSlash = currPath.ReverseFind('/');
  392. }
  393. initialDir = currPath.Left(endSlash);
  394. }
  395. initialDir.Replace("/", "\\");
  396. CString title = "Setting Cache Value: ";
  397. title += pItem->m_propName;
  398. CPathDialog dlg("Select Path", title, initialDir);
  399. if(dlg.DoModal()==IDOK)
  400. {
  401. CString SelectedFile = dlg.GetPathName();
  402. m_btnCtrl.ShowWindow(SW_HIDE);
  403. pItem->m_curValue = SelectedFile;
  404. m_Dirty = true;
  405. Invalidate();
  406. }
  407. }
  408. else if (pItem->m_nItemType == CPropertyList::FONT)
  409. {
  410. CFontDialog FontDlg(NULL,CF_EFFECTS | CF_SCREENFONTS,NULL,this);
  411. if(IDOK == FontDlg.DoModal())
  412. {
  413. CString faceName = FontDlg.GetFaceName();
  414. m_btnCtrl.ShowWindow(SW_HIDE);
  415. pItem->m_curValue = faceName;
  416. m_Dirty = true;
  417. Invalidate();
  418. }
  419. }
  420. }
  421. void CPropertyList::OnLButtonUp(UINT nFlags, CPoint point)
  422. {
  423. if (m_bTracking)
  424. {
  425. //if columns were being resized then this indicates
  426. //that mouse is up so resizing is done. Need to redraw
  427. //columns to reflect their new widths.
  428. m_bTracking = FALSE;
  429. //if mouse was captured then release it
  430. if (GetCapture()==this)
  431. ::ReleaseCapture();
  432. ::ClipCursor(NULL);
  433. CClientDC dc(this);
  434. InvertLine(&dc,CPoint(point.x,m_nDivTop),CPoint(point.x,m_nDivBtm));
  435. //set the divider position to the new value
  436. m_nDivider = point.x;
  437. //redraw
  438. Invalidate();
  439. }
  440. else
  441. {
  442. BOOL loc;
  443. int i = ItemFromPoint(point,loc);
  444. m_curSel = i;
  445. CListBox::OnLButtonUp(nFlags, point);
  446. }
  447. }
  448. void CPropertyList::OnLButtonDown(UINT nFlags, CPoint point)
  449. {
  450. if ((point.x>=m_nDivider-5) && (point.x<=m_nDivider+5))
  451. {
  452. //if mouse clicked on divider line, then start resizing
  453. ::SetCursor(m_hCursorSize);
  454. CRect windowRect;
  455. GetWindowRect(windowRect);
  456. windowRect.left += 10; windowRect.right -= 10;
  457. //do not let mouse leave the list box boundary
  458. ::ClipCursor(windowRect);
  459. if (m_cmbBox)
  460. m_cmbBox.ShowWindow(SW_HIDE);
  461. if (m_editBox)
  462. m_editBox.ShowWindow(SW_HIDE);
  463. CRect clientRect;
  464. GetClientRect(clientRect);
  465. m_bTracking = TRUE;
  466. m_nDivTop = clientRect.top;
  467. m_nDivBtm = clientRect.bottom;
  468. m_nOldDivX = point.x;
  469. CClientDC dc(this);
  470. InvertLine(&dc,CPoint(m_nOldDivX,m_nDivTop),CPoint(m_nOldDivX,m_nDivBtm));
  471. //capture the mouse
  472. SetCapture();
  473. }
  474. else
  475. {
  476. m_bTracking = FALSE;
  477. CListBox::OnLButtonDown(nFlags, point);
  478. }
  479. }
  480. void CPropertyList::OnMouseMove(UINT nFlags, CPoint point)
  481. {
  482. if (m_bTracking)
  483. {
  484. //move divider line to the mouse pos. if columns are
  485. //currently being resized
  486. CClientDC dc(this);
  487. //remove old divider line
  488. InvertLine(&dc,CPoint(m_nOldDivX,m_nDivTop),CPoint(m_nOldDivX,m_nDivBtm));
  489. //draw new divider line
  490. InvertLine(&dc,CPoint(point.x,m_nDivTop),CPoint(point.x,m_nDivBtm));
  491. m_nOldDivX = point.x;
  492. }
  493. else if ((point.x >= m_nDivider-5) && (point.x <= m_nDivider+5))
  494. //set the cursor to a sizing cursor if the cursor is over the row divider
  495. ::SetCursor(m_hCursorSize);
  496. else
  497. CListBox::OnMouseMove(nFlags, point);
  498. }
  499. void CPropertyList::InvertLine(CDC* pDC,CPoint ptFrom,CPoint ptTo)
  500. {
  501. int nOldMode = pDC->SetROP2(R2_NOT);
  502. pDC->MoveTo(ptFrom);
  503. pDC->LineTo(ptTo);
  504. pDC->SetROP2(nOldMode);
  505. }
  506. void CPropertyList::PreSubclassWindow()
  507. {
  508. m_bDivIsSet = FALSE;
  509. m_nDivider = 0;
  510. m_bTracking = FALSE;
  511. m_curSel = 1;
  512. m_hCursorSize = AfxGetApp()->LoadStandardCursor(IDC_SIZEWE);
  513. m_hCursorArrow = AfxGetApp()->LoadStandardCursor(IDC_ARROW);
  514. m_SSerif8Font.CreatePointFont(80,_T("MS Sans Serif"));
  515. }
  516. CPropertyItem* CPropertyList::GetItem(int index)
  517. {
  518. return (CPropertyItem*)GetItemDataPtr(index);
  519. }
  520. void CPropertyList::OnRButtonUp( UINT nFlags, CPoint point )
  521. {
  522. CMenu menu;
  523. CRect rect;
  524. this->GetWindowRect(&rect);
  525. BOOL loc;
  526. m_curSel = ItemFromPoint(point,loc);
  527. menu.CreatePopupMenu();
  528. menu.AppendMenu(MF_STRING | MF_ENABLED, 42, "Delete Cache Entry");
  529. menu.AppendMenu(MF_STRING | MF_ENABLED, 43, "Help For Cache Entry");
  530. menu.TrackPopupMenu(TPM_LEFTALIGN | TPM_RIGHTBUTTON,
  531. rect.TopLeft().x + point.x,
  532. rect.TopLeft().y + point.y, this, NULL);
  533. }
  534. void CPropertyList::OnDelete()
  535. {
  536. if(m_curSel == -1 || this->GetCount() <= 0)
  537. {
  538. return;
  539. }
  540. CPropertyItem* pItem = (CPropertyItem*) GetItemDataPtr(m_curSel);
  541. cmCacheManager::GetInstance()->RemoveCacheEntry(pItem->m_propName);
  542. m_PropertyItems.erase(pItem);
  543. delete pItem;
  544. this->DeleteString(m_curSel);
  545. Invalidate();
  546. }
  547. void CPropertyList::OnHelp()
  548. {
  549. if(m_curSel == -1 || this->GetCount() <= 0)
  550. {
  551. return;
  552. }
  553. CPropertyItem* pItem = (CPropertyItem*) GetItemDataPtr(m_curSel);
  554. MessageBox(pItem->m_HelpString, pItem->m_propName, MB_OK|MB_ICONINFORMATION);
  555. }
  556. void CPropertyList::RemoveAll()
  557. {
  558. int c = this->GetCount();
  559. for(int i =0; i < c; ++i)
  560. {
  561. CPropertyItem* pItem = (CPropertyItem*) GetItemDataPtr(0);
  562. cmCacheManager::GetInstance()->RemoveCacheEntry(pItem->m_propName);
  563. m_PropertyItems.erase(pItem);
  564. delete pItem;
  565. this->DeleteString(0);
  566. }
  567. Invalidate();
  568. }