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

« back to all changes in this revision

Viewing changes to modules/graphics/src/c/getHandleProperty/set_grid_position_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:
30
30
/*------------------------------------------------------------------------*/
31
31
int set_grid_position_property(void* _pvCtx, char* pobjUID, size_t stackPointer, int valueType, int nbRow, int nbCol )
32
32
{
33
 
  BOOL status = FALSE;
34
 
  int position = 0;
35
 
 
36
 
  if ( !isParameterStringMatrix( valueType ) )
37
 
  {
38
 
    Scierror(999, _("Wrong type for '%s' property: String expected.\n"), "grid_position");
39
 
    return SET_PROPERTY_ERROR ;
40
 
  }
41
 
 
42
 
  if ( isStringParamEqual( stackPointer, "foreground" ) )
43
 
  {
44
 
    position = 1;
45
 
  }
46
 
  else if ( isStringParamEqual( stackPointer, "background" ) )
47
 
  {
48
 
    position = 0;
49
 
  }
50
 
  else
51
 
  {
52
 
    Scierror(999, _("Wrong value for '%s' property: %s or %s expected.\n"), "grid_position", "foreground", "background");
53
 
    return SET_PROPERTY_ERROR ;
54
 
  }
55
 
 
56
 
  status = setGraphicObjectProperty(pobjUID, __GO_GRID_POSITION__, &position, jni_int, 1);
57
 
 
58
 
  if (status == TRUE)
59
 
  {
60
 
    return SET_PROPERTY_SUCCEED;
61
 
  }
62
 
  else
63
 
  {
64
 
    Scierror(999, _("'%s' property does not exist for this handle.\n"),"grid_position") ;
65
 
    return SET_PROPERTY_ERROR;
66
 
  }
 
33
    BOOL status = FALSE;
 
34
    int position = 0;
 
35
 
 
36
    if ( !( valueType == sci_strings ) )
 
37
    {
 
38
        Scierror(999, _("Wrong type for '%s' property: String expected.\n"), "grid_position");
 
39
        return SET_PROPERTY_ERROR ;
 
40
    }
 
41
 
 
42
    if ( isStringParamEqual( stackPointer, "foreground" ) )
 
43
    {
 
44
        position = 1;
 
45
    }
 
46
    else if ( isStringParamEqual( stackPointer, "background" ) )
 
47
    {
 
48
        position = 0;
 
49
    }
 
50
    else
 
51
    {
 
52
        Scierror(999, _("Wrong value for '%s' property: %s or %s expected.\n"), "grid_position", "foreground", "background");
 
53
        return SET_PROPERTY_ERROR ;
 
54
    }
 
55
 
 
56
    status = setGraphicObjectProperty(pobjUID, __GO_GRID_POSITION__, &position, jni_int, 1);
 
57
 
 
58
    if (status == TRUE)
 
59
    {
 
60
        return SET_PROPERTY_SUCCEED;
 
61
    }
 
62
    else
 
63
    {
 
64
        Scierror(999, _("'%s' property does not exist for this handle.\n"), "grid_position") ;
 
65
        return SET_PROPERTY_ERROR;
 
66
    }
67
67
 
68
68
}
69
69
/*------------------------------------------------------------------------*/