~ubuntu-branches/ubuntu/raring/scilab/raring-proposed

« back to all changes in this revision

Viewing changes to modules/graphics/src/c/getHandleProperty/set_x_location_property.c

  • Committer: Package Import Robot
  • Author(s): Sylvestre Ledru
  • Date: 2012-08-30 14:42:38 UTC
  • mfrom: (1.4.7)
  • Revision ID: package-import@ubuntu.com-20120830144238-c1y2og7dbm7m9nig
Tags: 5.4.0-beta-3-1~exp1
* New upstream release
* Update the scirenderer dep
* Get ride of libjhdf5-java dependency

Show diffs side-by-side

added added

removed removed

Lines of Context:
33
33
/*------------------------------------------------------------------------*/
34
34
int set_x_location_property(void* _pvCtx, char* pobjUID, size_t stackPointer, int valueType, int nbRow, int nbCol )
35
35
{
36
 
  BOOL status = FALSE;
37
 
  int axisLocation = 0;
38
 
 
39
 
  if ( !isParameterStringMatrix( valueType ) )
40
 
  {
41
 
    Scierror(999, _("Wrong type for '%s' property: String expected.\n"), "x_location");
42
 
    return SET_PROPERTY_ERROR;
43
 
  }
44
 
 
45
 
  if ( isStringParamEqual( stackPointer, "bottom" ) )
46
 
  {
47
 
    axisLocation = 0;
48
 
  }
49
 
  else if ( isStringParamEqual( stackPointer, "top" ) )
50
 
  {
51
 
    axisLocation = 1;
52
 
  }
53
 
  else if ( isStringParamEqual( stackPointer, "middle" ) )
54
 
  {
55
 
    axisLocation = 2;
56
 
  }
57
 
  else if ( isStringParamEqual( stackPointer, "origin" ) )
58
 
  {
59
 
    axisLocation = 3;
60
 
  }
61
 
  else
62
 
  {
63
 
    Scierror(999, _("Wrong value for '%s' property: Must be in the set {%s}.\n"), "x_location", "bottom, top, middle, origin");
64
 
    return SET_PROPERTY_ERROR ;
65
 
  }
66
 
 
67
 
  status = setGraphicObjectProperty(pobjUID, __GO_X_AXIS_LOCATION__, &axisLocation, jni_int, 1);
68
 
 
69
 
  if (status == TRUE)
70
 
  {
71
 
    return SET_PROPERTY_SUCCEED ;
72
 
  }
73
 
  else
74
 
  {
75
 
    Scierror(999, _("'%s' property does not exist for this handle.\n"),"x_location");
76
 
    return SET_PROPERTY_ERROR;
77
 
  }
 
36
    BOOL status = FALSE;
 
37
    int axisLocation = 0;
 
38
 
 
39
    if ( !( valueType == sci_strings ) )
 
40
    {
 
41
        Scierror(999, _("Wrong type for '%s' property: String expected.\n"), "x_location");
 
42
        return SET_PROPERTY_ERROR;
 
43
    }
 
44
 
 
45
    if ( isStringParamEqual( stackPointer, "bottom" ) )
 
46
    {
 
47
        axisLocation = 0;
 
48
    }
 
49
    else if ( isStringParamEqual( stackPointer, "top" ) )
 
50
    {
 
51
        axisLocation = 1;
 
52
    }
 
53
    else if ( isStringParamEqual( stackPointer, "middle" ) )
 
54
    {
 
55
        axisLocation = 2;
 
56
    }
 
57
    else if ( isStringParamEqual( stackPointer, "origin" ) )
 
58
    {
 
59
        axisLocation = 3;
 
60
    }
 
61
    else
 
62
    {
 
63
        Scierror(999, _("Wrong value for '%s' property: Must be in the set {%s}.\n"), "x_location", "bottom, top, middle, origin");
 
64
        return SET_PROPERTY_ERROR ;
 
65
    }
 
66
 
 
67
    status = setGraphicObjectProperty(pobjUID, __GO_X_AXIS_LOCATION__, &axisLocation, jni_int, 1);
 
68
 
 
69
    if (status == TRUE)
 
70
    {
 
71
        return SET_PROPERTY_SUCCEED ;
 
72
    }
 
73
    else
 
74
    {
 
75
        Scierror(999, _("'%s' property does not exist for this handle.\n"), "x_location");
 
76
        return SET_PROPERTY_ERROR;
 
77
    }
78
78
}
79
79
/*------------------------------------------------------------------------*/