PropertyList.cpp 16 KB

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