浏览代码

ENH: Clearing and redrawing the property list after a build to load the new cache.

Luis Ibanez 24 年之前
父节点
当前提交
cca4d06686
共有 2 个文件被更改,包括 14 次插入3 次删除
  1. 12 1
      Source/FLTKDialog/CMakeSetupGUIImplementation.cxx
  2. 2 2
      Source/FLTKDialog/FLTKPropertyItemRow.cxx

+ 12 - 1
Source/FLTKDialog/CMakeSetupGUIImplementation.cxx

@@ -352,8 +352,10 @@ CMakeSetupGUIImplementation
   // update the GUI with any new values in the caused by the
   // update the GUI with any new values in the caused by the
   // generation process
   // generation process
   this->LoadCacheFromDiskToGUI();
   this->LoadCacheFromDiskToGUI();
+
   // path is up-to-date now
   // path is up-to-date now
   m_BuildPathChanged = false;
   m_BuildPathChanged = false;
+
   // put the cursor back
   // put the cursor back
   fl_cursor(FL_CURSOR_DEFAULT,FL_BLACK,FL_WHITE);
   fl_cursor(FL_CURSOR_DEFAULT,FL_BLACK,FL_WHITE);
   fl_message("Done !");
   fl_message("Done !");
@@ -405,6 +407,8 @@ CMakeSetupGUIImplementation
 {
 {
 
 
   // Prepare to add rows to the scroll
   // Prepare to add rows to the scroll
+  m_CacheEntriesList.RemoveAll();
+  propertyListPack->clear();
   propertyListPack->begin();
   propertyListPack->begin();
 
 
   const cmCacheManager::CacheEntryMap &cache =
   const cmCacheManager::CacheEntryMap &cache =
@@ -415,7 +419,6 @@ CMakeSetupGUIImplementation
     const char* key = i->first.c_str();
     const char* key = i->first.c_str();
     const cmCacheManager::CacheEntry& value = i->second;
     const cmCacheManager::CacheEntry& value = i->second;
     
     
-
     switch(value.m_Type )
     switch(value.m_Type )
       {
       {
       case cmCacheManager::BOOL:
       case cmCacheManager::BOOL:
@@ -453,6 +456,10 @@ CMakeSetupGUIImplementation
                                        fltk::PropertyList::EDIT,"");
                                        fltk::PropertyList::EDIT,"");
         break;
         break;
       case cmCacheManager::INTERNAL:
       case cmCacheManager::INTERNAL:
+        m_CacheEntriesList.AddProperty(key,
+                                       value.m_Value.c_str(),
+                                       value.m_HelpString.c_str(),
+                                       fltk::PropertyList::EDIT,"");
         break;
         break;
       }
       }
 
 
@@ -462,6 +469,10 @@ CMakeSetupGUIImplementation
   propertyListPack->init_sizes();
   propertyListPack->init_sizes();
   cacheValuesScroll->position( 0, 0 );
   cacheValuesScroll->position( 0, 0 );
 
 
+  propertyListPack->redraw();
+
+  Fl::check();
+
   this->UpdateData(false);
   this->UpdateData(false);
 
 
 }
 }

+ 2 - 2
Source/FLTKDialog/FLTKPropertyItemRow.cxx

@@ -189,8 +189,8 @@ NameButtonCallback( Fl_Widget * widget, void * data)
   static Fl_Menu_Button * popupMenu = 0;
   static Fl_Menu_Button * popupMenu = 0;
   if( !popupMenu )
   if( !popupMenu )
   {
   {
-    int lastMousePositionX = Fl::event_x_root();
-    int lastMousePositionY = Fl::event_y_root();
+    int lastMousePositionX = Fl::event_x();
+    int lastMousePositionY = Fl::event_y();
     popupMenu = new Fl_Menu_Button(lastMousePositionX,
     popupMenu = new Fl_Menu_Button(lastMousePositionX,
                                    lastMousePositionY,100,200);
                                    lastMousePositionY,100,200);
   }
   }