summaryrefslogtreecommitdiffstats
path: root/Source/MFCDialog
diff options
context:
space:
mode:
authorBill Hoffman <bill.hoffman@kitware.com>2001-04-26 18:53:44 (GMT)
committerBill Hoffman <bill.hoffman@kitware.com>2001-04-26 18:53:44 (GMT)
commit2c1fb789d7a182ab0df53aad474a657d59d894b0 (patch)
tree3f4db8d752a6f3a218e92ad470efb97b5e7421c7 /Source/MFCDialog
parent6e5af0e6ccbb0f2c0a4aec00003ea0ce68ea2f95 (diff)
downloadCMake-2c1fb789d7a182ab0df53aad474a657d59d894b0.zip
CMake-2c1fb789d7a182ab0df53aad474a657d59d894b0.tar.gz
CMake-2c1fb789d7a182ab0df53aad474a657d59d894b0.tar.bz2
ENH: add help for cache entries
Diffstat (limited to 'Source/MFCDialog')
-rw-r--r--Source/MFCDialog/CMakeSetupDialog.cpp14
-rw-r--r--Source/MFCDialog/PropertyList.cpp13
-rw-r--r--Source/MFCDialog/PropertyList.h5
3 files changed, 28 insertions, 4 deletions
diff --git a/Source/MFCDialog/CMakeSetupDialog.cpp b/Source/MFCDialog/CMakeSetupDialog.cpp
index 43cc58d..a191a5e 100644
--- a/Source/MFCDialog/CMakeSetupDialog.cpp
+++ b/Source/MFCDialog/CMakeSetupDialog.cpp
@@ -388,25 +388,33 @@ void CMakeSetupDialog::FillCacheGUIFromCacheManager()
{
m_CacheEntriesList.AddProperty(key,
"ON",
+ value.m_HelpString.c_str(),
CPropertyList::CHECKBOX,"");
}
else
{
m_CacheEntriesList.AddProperty(key,
"OFF",
+ value.m_HelpString.c_str(),
CPropertyList::CHECKBOX,"");
}
break;
case cmCacheManager::PATH:
- m_CacheEntriesList.AddProperty(key, value.m_Value.c_str(),
+ m_CacheEntriesList.AddProperty(key,
+ value.m_Value.c_str(),
+ value.m_HelpString.c_str(),
CPropertyList::PATH,"");
break;
case cmCacheManager::FILEPATH:
- m_CacheEntriesList.AddProperty(key, value.m_Value.c_str(),
+ m_CacheEntriesList.AddProperty(key,
+ value.m_Value.c_str(),
+ value.m_HelpString.c_str(),
CPropertyList::FILE,"");
break;
case cmCacheManager::STRING:
- m_CacheEntriesList.AddProperty(key, value.m_Value.c_str(),
+ m_CacheEntriesList.AddProperty(key,
+ value.m_Value.c_str(),
+ value.m_HelpString.c_str(),
CPropertyList::EDIT,"");
break;
case cmCacheManager::INTERNAL:
diff --git a/Source/MFCDialog/PropertyList.cpp b/Source/MFCDialog/PropertyList.cpp
index 92f701e..1dda079 100644
--- a/Source/MFCDialog/PropertyList.cpp
+++ b/Source/MFCDialog/PropertyList.cpp
@@ -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();
diff --git a/Source/MFCDialog/PropertyList.h b/Source/MFCDialog/PropertyList.h
index 57d131e..d54861d 100644
--- a/Source/MFCDialog/PropertyList.h
+++ b/Source/MFCDialog/PropertyList.h
@@ -11,6 +11,7 @@ class CPropertyItem
{
// Attributes
public:
+ CString m_HelpString;
CString m_propName;
CString m_curValue;
int m_nItemType;
@@ -18,8 +19,10 @@ public:
bool m_Removed;
public:
CPropertyItem(CString propName, CString curValue,
+ CString helpString,
int nItemType, CString cmbItems)
{
+ m_HelpString = helpString;
m_Removed = false;
m_propName = propName;
m_curValue = curValue;
@@ -55,6 +58,7 @@ public:
int AddItem(CString txt);
int AddProperty(const char* name,
const char* value,
+ const char* helpString,
int type,
const char* comboItems);
std::set<CPropertyItem*> GetItems()
@@ -95,6 +99,7 @@ protected:
afx_msg void OnChangeEditBox();
afx_msg void OnButton();
afx_msg void OnDelete();
+ afx_msg void OnHelp();
afx_msg void OnCheckBox();
DECLARE_MESSAGE_MAP()