2 * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
3 * Copyright (C) 2007 - INRIA - Vincent COUVERT
4 * Copyright (C) 2011 - DIGITEO - Vincent COUVERT
5 * Sets the slider step property of an uicontrol object
7 * This file must be used under the terms of the CeCILL.
8 * This source file is licensed as described in the file COPYING, which
9 * you should have received as part of this distribution. The terms
10 * are also available at
11 * http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
15 #include "SetUicontrolSliderStep.hxx"
18 int SetUicontrolSliderStep(void* _pvCtx, char* sciObjUID, size_t stackPointer, int valueType, int nbRow, int nbCol)
22 if (valueType != sci_matrix)
25 Scierror(999, const_cast<char*>(_("Wrong type for '%s' property: A 1 x %d real row vector expected.\n")), "SliderStep", 2);
26 return SET_PROPERTY_ERROR;
29 if ( nbRow == 1 && nbCol == 1)
32 double* pdblStackVal = stk(stackPointer);
34 pdblStep[0] = pdblStackVal[0];
35 pdblStep[1] = 0.1;// default big value : 10%
37 status = setGraphicObjectProperty(sciObjUID, __GO_UI_SLIDERSTEP__, pdblStep, jni_double_vector, 2);
39 else if (nbRow == 1 && nbCol == 2)
41 status = setGraphicObjectProperty(sciObjUID, __GO_UI_SLIDERSTEP__, stk(stackPointer), jni_double_vector, 2);
45 /* Wrong value size */
46 Scierror(999, const_cast<char*>(_("Wrong size for '%s' property: A 1 x %d real row vector expected.\n")), "SliderStep", 2);
47 return SET_PROPERTY_ERROR;
52 return SET_PROPERTY_SUCCEED;
56 Scierror(999, const_cast<char*>(_("'%s' property does not exist for this handle.\n")), "SliderStep");
57 return SET_PROPERTY_ERROR;