Fix uicontrol position. 44/11144/2
Vincent COUVERT [Thu, 28 Mar 2013 14:44:36 +0000 (15:44 +0100)]
To test: uicontrol();
// Check that the pushbutton is in the lower left angle (x=20 y=40).

Change-Id: I4dc3c8c2cca060452e43ef3e43937d9e5e8e408d

scilab/modules/gui/sci_gateway/c/sci_uicontrol.c

index f0176d2..b95d8eb 100644 (file)
@@ -448,6 +448,14 @@ int sci_uicontrol(char *fname, unsigned long fname_len)
         setGraphicObjectProperty(pUicontrol, __GO_UI_SLIDERSTEP__, pdblStep, jni_double_vector, 2);
     }
 
+    if ((Rhs < 2) || (propertiesValuesIndices[10] == NOT_FOUND))    /* Position property not set */
+    {
+        double* pdblPosition = NULL;
+
+        getGraphicObjectProperty(pUicontrol, __GO_POSITION__, jni_double_vector, (void**) &pdblPosition);
+        setGraphicObjectProperty(pUicontrol, __GO_POSITION__, pdblPosition, jni_double_vector, 4);
+    }
+
     FREE(propertiesValuesIndices);
 
     /* Create return variable */