first step, string 'incompatible type...' factorised
[scilab.git] / scilab / modules / graphics / src / c / getHandleProperty / set_color_map_property.c
1 /*------------------------------------------------------------------------*/
2 /* file: set_color_map_property.c                                         */
3 /* Copyright INRIA 2006                                                   */
4 /* Authors : Fabrice Leray, Allan Cornet, Jean-Baptiste Silvy             */
5 /* desc : function to modify in Scilab the color_map field of             */
6 /*        a handle                                                        */
7 /*------------------------------------------------------------------------*/
8
9 #include "setHandleProperty.h"
10 #include "SetProperty.h"
11 #include "getPropertyAssignedValue.h"
12 #include "sciprint.h"
13 #include "SetPropertyStatus.h"
14
15 /*------------------------------------------------------------------------*/
16 int set_color_map_property( sciPointObj * pobj, int stackPointer, int valueType, int nbRow, int nbCol )
17 {
18   if ( !isParameterDoubleMatrix( valueType ) )
19   {
20     sciprint(_("Incompatible type for property %s.\n"),"color_map") ;
21     return SET_PROPERTY_ERROR ;
22   }
23
24   return sciSetColormap( pobj, getDoubleMatrixFromStack( stackPointer), nbRow, nbCol ) ;
25 }
26 /*------------------------------------------------------------------------*/