From: Vincent COUVERT Date: Thu, 20 Sep 2012 10:16:51 +0000 (+0200) Subject: Fix pushbutton uicontrols. X-Git-Tag: 5.4.0~93 X-Git-Url: http://gitweb.scilab.org/?p=scilab.git;a=commitdiff_plain;h=1c2654bb06cbc4b419caa1eeddfde33c39c11cea Fix pushbutton uicontrols. To test: test_run("gui", "pushbutton") Change-Id: I849a3f8c6e3be53aa614fd93b0c5364cf30d7d82 --- diff --git a/scilab/modules/gui/sci_gateway/c/sci_uicontrol.c b/scilab/modules/gui/sci_gateway/c/sci_uicontrol.c index 4bb5ec3..f0176d2 100644 --- a/scilab/modules/gui/sci_gateway/c/sci_uicontrol.c +++ b/scilab/modules/gui/sci_gateway/c/sci_uicontrol.c @@ -92,6 +92,7 @@ int sci_uicontrol(char *fname, unsigned long fname_len) pstCurrentFigure = createNewFigureWithAxes(); } setGraphicObjectRelationship(pstCurrentFigure, (char*)getObjectFromHandle(GraphicHandle)); + pUicontrol = (char*)getObjectFromHandle(GraphicHandle); } else if (Rhs == 1) { @@ -149,6 +150,7 @@ int sci_uicontrol(char *fname, unsigned long fname_len) "Uimenu"); return FALSE; } + pUicontrol = (char*)getObjectFromHandle(GraphicHandle); } } else @@ -421,14 +423,14 @@ int sci_uicontrol(char *fname, unsigned long fname_len) } } - if (propertiesValuesIndices[24] == NOT_FOUND) /* Visible property not set */ + if ((Rhs < 2) || (propertiesValuesIndices[24] == NOT_FOUND)) /* Visible property not set */ { /* Force the uicontrol to be visible because is invisible by default in the model (See bug #10346) */ int b = (int)TRUE; setGraphicObjectProperty(pUicontrol, __GO_VISIBLE__, &b, jni_bool, 1); } - if (propertiesValuesIndices[14] == NOT_FOUND) /* SliderStep property not set */ + if ((Rhs < 2) || (propertiesValuesIndices[14] == NOT_FOUND)) /* SliderStep property not set */ { /* Set SliderStep property to [1/100*(Max-Min) 1/10*(Max-Min)] */ double maxValue = 0;