Crete new files for sci_set functions.
[scilab.git] / scilab / modules / graphics / src / c / getHandleProperty / set_tight_limits_property.c
1 /*------------------------------------------------------------------------*/
2 /* file: set_tight_limits_property.c                                      */
3 /* Copyright INRIA 2006                                                   */
4 /* Authors : Fabrice Leray, Allan Cornet, Jean-Baptiste Silvy             */
5 /* desc : function to modify in Scilab the tight_limits field of          */
6 /*        a handle                                                        */
7 /*------------------------------------------------------------------------*/
8
9 #include "setHandleProperty.h"
10 #include "SetProperty.h"
11 #include "getPropertyAssignedValue.h"
12 #include "SetPropertyStatus.h"
13 #include "GetProperty.h"
14 #include "sciprint.h"
15
16 /*------------------------------------------------------------------------*/
17 int set_tight_limits_property( sciPointObj * pobj, int stackPointer, int nbRow, int nbCol )
18 {
19   if ( sciGetEntityType(pobj) != SCI_SUBWIN )
20   {
21     sciprint("tight_limits property does not exists for this handle.\n") ;
22     return SET_PROPERTY_ERROR ;
23   }
24
25   if ( isStringParamEqual( stackPointer, "on" ) )
26   {
27     pSUBWIN_FEATURE (pobj)->tight_limits = FALSE;
28   }
29   else if ( isStringParamEqual( stackPointer, "off" ) )
30   {
31     pSUBWIN_FEATURE (pobj)->tight_limits = TRUE;
32   }
33   else
34   {
35     sciprint("Second argument must be 'on' or 'off'.\n") ;
36     return SET_PROPERTY_ERROR ;
37   }
38   return SET_PROPERTY_SUCCEED ;
39 }
40 /*------------------------------------------------------------------------*/