summaryrefslogtreecommitdiffstats
path: root/Source/FLTKDialog/FLTKPropertyItemRow.cxx
diff options
context:
space:
mode:
authorLuis Ibanez <luis.ibanez@kitware.com>2001-06-21 12:41:14 (GMT)
committerLuis Ibanez <luis.ibanez@kitware.com>2001-06-21 12:41:14 (GMT)
commit446ea3b97d2004f11d9002ec09872a796548e771 (patch)
treed7fff47eb567d6ab5774fa9858b9ad93122695c7 /Source/FLTKDialog/FLTKPropertyItemRow.cxx
parent8fe1e1fcc6be2de71ebe3ce2e252c2e8bd75931b (diff)
downloadCMake-446ea3b97d2004f11d9002ec09872a796548e771.zip
CMake-446ea3b97d2004f11d9002ec09872a796548e771.tar.gz
CMake-446ea3b97d2004f11d9002ec09872a796548e771.tar.bz2
ENH: PropertyRows have now a reference to CMakeSetupGUI and save the cache
at each callback action
Diffstat (limited to 'Source/FLTKDialog/FLTKPropertyItemRow.cxx')
-rw-r--r--Source/FLTKDialog/FLTKPropertyItemRow.cxx48
1 files changed, 43 insertions, 5 deletions
diff --git a/Source/FLTKDialog/FLTKPropertyItemRow.cxx b/Source/FLTKDialog/FLTKPropertyItemRow.cxx
index 2ce380a..078a7e5 100644
--- a/Source/FLTKDialog/FLTKPropertyItemRow.cxx
+++ b/Source/FLTKDialog/FLTKPropertyItemRow.cxx
@@ -10,17 +10,26 @@
#include <FL/Fl_Color_Chooser.H>
#include <FL/Fl_Menu_Button.H>
#include "../cmCacheManager.h"
+#include "FLTKPropertyList.h"
+#include "CMakeSetupGUIImplementation.h"
#include <cstdio>
+
namespace fltk {
-PropertyItemRow::PropertyItemRow( PropertyItem * pItem ):Fl_Tile(0,0,10,10,"")
+
+CMakeSetupGUIImplementation * PropertyItemRow::m_CMakeSetup = 0;
+
+
+
+
+PropertyItemRow
+::PropertyItemRow( PropertyItem * pItem ):Fl_Tile(0,0,10,10,"")
{
m_PropertyItem = pItem;
- m_ItemValue = new ItemValue;
-
+ m_ItemValue = new ItemValue;
const unsigned int fontsize = 11;
const unsigned int nameWidth = 200;
@@ -162,6 +171,12 @@ PropertyItemRow::~PropertyItemRow( )
+void PropertyItemRow
+::SetCMakeSetupGUI( CMakeSetupGUIImplementation * cmakeSetup )
+{
+ m_CMakeSetup = cmakeSetup;
+}
+
void
@@ -205,15 +220,18 @@ NameButtonCallback( Fl_Widget * widget, void * data)
// Remove the entry from the cache
cmCacheManager::GetInstance()->RemoveCacheEntry( propertyName );
// Get the parent: Fl_Tile that manages the whole row in the GUI
- Fl_Group * parentGroup = (Fl_Group *) (button->parent());
+ Fl_Group * parentGroup = dynamic_cast<Fl_Group *>(button->parent());
// Get the grandParent: Fl_Pack with the property list
- Fl_Group * grandParentGroup = (Fl_Group *) parentGroup->parent();
+ Fl_Group * grandParentGroup = dynamic_cast<Fl_Group *>( parentGroup->parent() );
// Remove the row from the list
grandParentGroup->remove( *parentGroup );
// Destroy the row
delete parentGroup; // Patricide... ?
// Redraw the list
grandParentGroup->redraw();
+
+ SaveCacheFromGUI();
+
return;
}
break;
@@ -225,6 +243,17 @@ NameButtonCallback( Fl_Widget * widget, void * data)
+void
+PropertyItemRow::
+SaveCacheFromGUI( void )
+{
+ if( m_CMakeSetup )
+ {
+ m_CMakeSetup->SaveCacheFromGUI();
+ }
+}
+
+
void
PropertyItemRow::
@@ -246,6 +275,9 @@ CheckButtonCallback( Fl_Widget * widget, void * data)
pItem->m_curValue = "OFF";
}
button->redraw();
+
+ SaveCacheFromGUI();
+
}
@@ -259,6 +291,8 @@ InputTextCallback( Fl_Widget * widget, void * data)
item->m_curValue = input->value();
+ SaveCacheFromGUI();
+
}
@@ -290,6 +324,8 @@ ColorSelectionCallback( Fl_Widget * widget, void * data)
colorButton->redraw();
+ SaveCacheFromGUI();
+
}
@@ -314,6 +350,8 @@ BrowsePathCallback( Fl_Widget * widget, void * data)
inputText->value( newpath );
}
+ SaveCacheFromGUI();
+
}