/*------------------------------------------------------------------------*/
int set_current_axes_property(char* pobjUID, size_t stackPointer, int valueType, int nbRow, int nbCol )
{
    char * curAxesUID   = NULL;
    char * parentFigureUID = NULL;
    char * type;

    if (pobjUID != NULL)
    {
        /* This property should not be called on a handle */
        Scierror(999, _("'%s' property does not exist for this handle.\n"), "current_axes");
        return SET_PROPERTY_ERROR;
    }

    if ( !isParameterHandle( valueType ) )
    {
        Scierror(999, _("Wrong type for '%s' property: Handle expected.\n"), "current_axes");
        return SET_PROPERTY_ERROR;
    }

    curAxesUID = getObjectFromHandle( getHandleFromStack( stackPointer ) );

    if ( curAxesUID == NULL)
    {
        Scierror(999, _("Wrong value for '%s' property: Must be a valid handle.\n"), "current_entity");
        return SET_PROPERTY_ERROR;
    }

    getGraphicObjectProperty(curAxesUID, __GO_TYPE__, jni_string, &type);

    if (strcmp(type, __GO_AXES__) != 0)
    {
        Scierror(999, _("Wrong value for '%s' property: Must be a handle on a axes.\n"), "current_axes");
        return SET_PROPERTY_ERROR;
    }

    /* The current Axes' parent Figure's selected child property must be updated */
    getGraphicObjectProperty(curAxesUID, __GO_PARENT__, jni_string, &parentFigureUID);
    setGraphicObjectProperty(parentFigureUID, __GO_SELECTED_CHILD__, curAxesUID, jni_string, 1);

    setCurrentSubWin(curAxesUID);

    /* F.Leray 11.02.05 : if the new selected subwin is not inside the current figure, */
    /* we must also set the current figure to the subwin's parent */
    if (!isCurrentFigure(parentFigureUID))
    {
        setCurrentFigure(parentFigureUID);
    }

    return SET_PROPERTY_SUCCEED;
}
/*------------------------------------------------------------------------*/
int set_current_axes_property(void* _pvCtx, int iObjUID, void* _pvData, int valueType, int nbRow, int nbCol)
{
    int iCurAxesUID = 0;
    int iCurChildUID = 0;
    int iParentFigureUID = -1;
    int* piParentFigureUID = &iParentFigureUID;
    int type = -1;
    int *piType = &type;

    if (iObjUID != 0)
    {
        /* This property should not be called on a handle */
        Scierror(999, _("'%s' property does not exist for this handle.\n"), "current_axes");
        return SET_PROPERTY_ERROR;
    }

    if (valueType != sci_handles)
    {
        Scierror(999, _("Wrong type for '%s' property: Handle expected.\n"), "current_axes");
        return SET_PROPERTY_ERROR;
    }

    iCurAxesUID = getObjectFromHandle((long)((long long*)_pvData)[0]);

    if (iCurAxesUID == 0)
    {
        Scierror(999, _("Wrong value for '%s' property: Must be a valid handle.\n"), "current_entity");
        return SET_PROPERTY_ERROR;
    }

    getGraphicObjectProperty(iCurAxesUID, __GO_TYPE__, jni_int, (void **)&piType);

    if (type != __GO_AXES__)
    {
        Scierror(999, _("Wrong value for '%s' property: Must be a handle on axes.\n"), "current_axes");
        return SET_PROPERTY_ERROR;
    }

    setCurrentSubWin(iCurAxesUID);


    // Look for top level figure
    type = -1;
    iCurChildUID = iCurAxesUID;
    do {
        iParentFigureUID = getParentObject(iCurChildUID);
        getGraphicObjectProperty(iParentFigureUID, __GO_TYPE__, jni_int, (void **)&piType);
        iCurChildUID = iParentFigureUID;
    } while (iParentFigureUID != -1 && type != __GO_FIGURE__);

    /* The current Axes' parent Figure's selected child property must be updated */
    setGraphicObjectProperty(iParentFigureUID, __GO_SELECTED_CHILD__, &iCurAxesUID, jni_int, 1);

    /* F.Leray 11.02.05 : if the new selected subwin is not inside the current figure, */
    /* we must also set the current figure to the subwin's parent */
    if (!isCurrentFigure(iParentFigureUID))
    {
        setCurrentFigure(iParentFigureUID);
    }

    return SET_PROPERTY_SUCCEED;
}