diff Allan.c @ 134:bd28161e5ac2

Major code cleanup
author Daniele Nicolodi <daniele.nicolodi@obspm.fr>
date Wed, 22 Jan 2014 12:29:28 +0100
parents 0e9f95525a8f
children 77539f2597b1
line wrap: on
line diff
--- a/Allan.c	Wed Jan 22 12:10:17 2014 +0100
+++ b/Allan.c	Wed Jan 22 12:29:28 2014 +0100
@@ -10,7 +10,7 @@
 
 // ******************* Member functions : constructor and destructor *************************
 
-int Allan_InitPanel(Allan_Data * Instance, char * title, double Normalizer, void (*OnCloseFunc)(int)) {
+int Allan_InitPanel(Allan_Data * Instance, const char * title, double Normalizer, int parent, int control) {
 	
 	int i ;
 	
@@ -18,7 +18,9 @@
 	return -1;
 	SetPanelAttribute(Instance->AllanPanel, ATTR_TITLE, title) ; 
 	SetPanelAttribute (Instance->AllanPanel, ATTR_CALLBACK_DATA, (void *)Instance); // the panel callback therefore knows which data structure it is associated to
-	Instance->OnClosePanel = OnCloseFunc ;
+	Instance->active = TRUE;
+	Instance->parent = parent;
+	Instance->control = control;
 	for (i=0 ; i<ALLAN_MAXPOINTSNUMBER ; i++) {
 		Instance->AllanVar[i] = 0 ;
 		Instance->LastMean[i] = 0 ; 
@@ -35,7 +37,8 @@
 
 
 int Allan_ClosePanel(Allan_Data * Instance) {
-	Instance->OnClosePanel(Instance->AllanPanel) ;
+	Instance->active = FALSE;
+	SetCtrlVal(Instance->parent, Instance->control, FALSE);
 	DiscardPanel (Instance->AllanPanel); 
 	return 0;
 	}