diff options
author | Luis Ibanez <luis.ibanez@kitware.com> | 2001-06-13 04:16:35 (GMT) |
---|---|---|
committer | Luis Ibanez <luis.ibanez@kitware.com> | 2001-06-13 04:16:35 (GMT) |
commit | 72377752f8910405237922d8f9956d62cc7078de (patch) | |
tree | c7b2da01d590b75fb4ceac5420b538feb62927c5 /Source/FLTKDialog/FLTKPropertyList.cxx | |
parent | 8ef02a496a16e2d05f464909d97ec70242329def (diff) | |
download | CMake-72377752f8910405237922d8f9956d62cc7078de.zip CMake-72377752f8910405237922d8f9956d62cc7078de.tar.gz CMake-72377752f8910405237922d8f9956d62cc7078de.tar.bz2 |
ENH: Added popup menu for removing a property. Some style changes
Diffstat (limited to 'Source/FLTKDialog/FLTKPropertyList.cxx')
-rw-r--r-- | Source/FLTKDialog/FLTKPropertyList.cxx | 75 |
1 files changed, 3 insertions, 72 deletions
diff --git a/Source/FLTKDialog/FLTKPropertyList.cxx b/Source/FLTKDialog/FLTKPropertyList.cxx index 7efbf24..e1651e1 100644 --- a/Source/FLTKDialog/FLTKPropertyList.cxx +++ b/Source/FLTKDialog/FLTKPropertyList.cxx @@ -18,10 +18,10 @@ namespace fltk { PropertyList::PropertyList() { - m_Dirty = false; - m_curSel = -1; } + + PropertyList::~PropertyList() { for(std::set<PropertyItem*>::iterator i = m_PropertyItems.begin(); @@ -34,7 +34,7 @@ PropertyList::~PropertyList() -int PropertyList::AddItem(string txt) +int PropertyList::AddItem( std::string txt) { int nIndex =0;// = AddString(txt); return nIndex; @@ -71,7 +71,6 @@ int PropertyList::AddProperty(const char* name, { pItem->m_curValue = value; pItem->m_HelpString = helpString; - m_Dirty = true; Invalidate(); } return i; @@ -88,74 +87,6 @@ int PropertyList::AddProperty(const char* name, -void PropertyList::OnButton() -{ - PropertyItem* pItem = (PropertyItem*) GetItemDataPtr(m_curSel); - - //display the appropriate common dialog depending on what type - //of chooser is associated with the property - if (pItem->m_nItemType == PropertyList::COLOR) - { - unsigned char red = 0; - unsigned char blue = 0; - unsigned char green = 0; - fl_color_chooser("Please pick a color",red,green,blue); - char buffer[300]; - sprintf(buffer,"RGB(%d,%d,%d)",red,green,blue); - pItem->m_curValue = buffer; - m_Dirty = true; - Invalidate(); - } - else if (pItem->m_nItemType == PropertyList::FILE) - { - string currPath = pItem->m_curValue; - - const char * SelectedFile - = fl_file_chooser("Choose a file", - "*",currPath.c_str() ); - - if( SelectedFile ) - { - pItem->m_curValue = SelectedFile; - m_Dirty = true; - Invalidate(); - } - } - else if (pItem->m_nItemType == PropertyList::PATH) - { - string currPath = pItem->m_curValue; - string initialDir = currPath; - - const char * SelectedFile - = fl_file_chooser("Choose a directory", - "*/",initialDir.c_str() ); - - if( SelectedFile && filename_isdir( SelectedFile ) ) - { - pItem->m_curValue = SelectedFile; - m_Dirty = true; - Invalidate(); - } - } - else if (pItem->m_nItemType == PropertyList::FONT) - { - } -} - - - - -void PropertyList::OnHelp() -{ - if(m_curSel == -1 || this->GetCount() <= 0) - { - return; - } - PropertyItem* pItem = (PropertyItem*) GetItemDataPtr(m_curSel); - fl_message(pItem->m_HelpString.c_str()); -} - - void PropertyList::RemoveAll() { int c = this->GetCount(); |