diff FXAnalyse.c @ 178:03dcca7e5ba4

Fix N estimate interface
author Daniele Nicolodi <daniele.nicolodi@obspm.fr>
date Fri, 21 Feb 2014 18:38:45 +0100
parents d96f0b04f7fe
children 75e37ba8c417
line wrap: on
line diff
--- a/FXAnalyse.c	Fri Feb 21 18:38:44 2014 +0100
+++ b/FXAnalyse.c	Fri Feb 21 18:38:45 2014 +0100
@@ -1883,9 +1883,6 @@
 	switch (event)
 	{
 		case EVENT_COMMIT:
-			GetPanelAttribute(EstimateNPanel, ATTR_VISIBLE , &visible);
-			if (! visible)
-				DisplayPanel(EstimateNPanel);
 			// reset N estimate
 			SetCtrlVal(EstimateNPanel, ESTIMATEN_N, 0.0);
 			// set current frep
@@ -1893,15 +1890,18 @@
 			switch (control) {
 				case PANEL_ESTIMATE_N2:
 					SetCtrlVal(EstimateNPanel, ESTIMATEN_WAVELENGTH, HG_WAVELENGTH);
-					SetPanelAttribute(panel, ATTR_TITLE, "Estimate N_Hg");
-					SetPanelAttribute(panel, ATTR_CALLBACK_DATA, HG);
+					SetPanelAttribute(EstimateNPanel, ATTR_TITLE, "Estimate N_Hg");
+					SetPanelAttribute(EstimateNPanel, ATTR_CALLBACK_DATA, HG);
 					break;
 				case PANEL_ESTIMATE_N3:
 					SetCtrlVal(EstimateNPanel, ESTIMATEN_WAVELENGTH, SR_WAVELENGTH);
-					SetPanelAttribute(panel, ATTR_TITLE, "Estimate N_Sr");
-					SetPanelAttribute(panel, ATTR_CALLBACK_DATA, SR);
+					SetPanelAttribute(EstimateNPanel, ATTR_TITLE, "Estimate N_Sr");
+					SetPanelAttribute(EstimateNPanel, ATTR_CALLBACK_DATA, SR);
 					break;
 			}
+			GetPanelAttribute(EstimateNPanel, ATTR_VISIBLE , &visible);
+			if (! visible)
+				DisplayPanel(EstimateNPanel);
 			break;
 	}
 	return 0;