ENH: add help for cache entries

This commit is contained in:
Bill Hoffman
2001-04-26 14:53:44 -04:00
parent 6e5af0e6cc
commit 2c1fb789d7
14 changed files with 125 additions and 28 deletions
+12 -1
View File
@@ -44,6 +44,7 @@ BEGIN_MESSAGE_MAP(CPropertyList, CListBox)
ON_BN_CLICKED(IDC_PROPBTNCTRL, OnButton)
ON_BN_CLICKED(IDC_PROPCHECKBOXCTRL, OnCheckBox)
ON_COMMAND(42, OnDelete)
ON_COMMAND(43, OnHelp)
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
@@ -123,6 +124,7 @@ int CPropertyList::AddPropItem(CPropertyItem* pItem)
int CPropertyList::AddProperty(const char* name,
const char* value,
const char* helpString,
int type,
const char* comboItems)
{
@@ -136,6 +138,7 @@ int CPropertyList::AddProperty(const char* name,
if(pItem->m_curValue != value)
{
pItem->m_curValue = value;
pItem->m_HelpString = helpString;
m_Dirty = true;
Invalidate();
}
@@ -154,13 +157,14 @@ int CPropertyList::AddProperty(const char* name,
pItem = *p;
pItem->m_Removed = false;
pItem->m_curValue = value;
pItem->m_HelpString = helpString;
Invalidate();
}
}
// if it is not found, then create a new one
if(!pItem)
{
pItem = new CPropertyItem(name, value, type, comboItems);
pItem = new CPropertyItem(name, value, helpString, type, comboItems);
}
return this->AddPropItem(pItem);
@@ -615,6 +619,7 @@ void CPropertyList::OnRButtonUp( UINT nFlags, CPoint point )
m_curSel = ItemFromPoint(point,loc);
menu.CreatePopupMenu();
menu.AppendMenu(MF_STRING | MF_ENABLED, 42, "Delete Cache Entry");
menu.AppendMenu(MF_STRING | MF_ENABLED, 43, "Help For Cache Entry");
menu.TrackPopupMenu(TPM_LEFTALIGN | TPM_RIGHTBUTTON,
rect.TopLeft().x + point.x,
rect.TopLeft().y + point.y, this, NULL);
@@ -629,6 +634,12 @@ void CPropertyList::OnDelete()
Invalidate();
}
void CPropertyList::OnHelp()
{
CPropertyItem* pItem = (CPropertyItem*) GetItemDataPtr(m_curSel);
MessageBox(pItem->m_HelpString);
}
void CPropertyList::RemoveAll()
{
int c = this->GetCount();