Ejemplo n.º 1
0
int GetUicontrolString(void* _pvCtx, int iObjUID)
{
    int iNbColStrings = 0;
    int *piNbColStrings = &iNbColStrings;
    int iNbStrings = 0;
    int *piNbStrings = &iNbStrings;
    char **pstString = NULL;

    getGraphicObjectProperty(iObjUID, __GO_UI_STRING_SIZE__, jni_int, (void **) &piNbStrings);
    getGraphicObjectProperty(iObjUID, __GO_UI_STRING_COLNB__, jni_int, (void **) &piNbColStrings);
    getGraphicObjectProperty(iObjUID, __GO_UI_STRING__, jni_string_vector, (void **) &pstString);
    if (pstString != NULL)
    {
        if (iNbStrings == 0 || iNbColStrings == 0)
        {
            return sciReturnEmptyMatrix(_pvCtx);
        }
        else if (iNbColStrings == 1)
        {
            return sciReturnStringMatrix(_pvCtx, pstString, 1, iNbStrings);
        }
        else
        {
            return sciReturnStringMatrix(_pvCtx, pstString, iNbStrings / iNbColStrings, iNbColStrings);
        }
    }
    else
    {
        Scierror(999, const_cast<char*>(_("No '%s' property for this object.\n")), "String");
        return FALSE;
    }
}
Ejemplo n.º 2
0
/*------------------------------------------------------------------------*/
int get_text_property(void* _pvCtx, int iObjUID)
{
    int* dimensions;
    char** textMatrix;

    getGraphicObjectProperty(iObjUID, __GO_TEXT_ARRAY_DIMENSIONS__, jni_int_vector, (void **) &dimensions);

    if (dimensions == NULL)
    {
        Scierror(999, _("'%s' property does not exist for this handle.\n"), "text");
        return -1;
    }

    getGraphicObjectProperty(iObjUID, __GO_TEXT_STRINGS__, jni_string_vector, (void **) &textMatrix);

    if (textMatrix == NULL)
    {
        Scierror(999, _("'%s' property does not exist for this handle.\n"), "text");
        return -1;
    }

    return sciReturnStringMatrix(_pvCtx, textMatrix, dimensions[0], dimensions[1]);
}
Ejemplo n.º 3
0
/*--------------------------------------------------------------------------*/
int sciReturnRowStringVector(void* _pvCtx, char * values[], int nbValues)
{
  return sciReturnStringMatrix(_pvCtx, values, 1, nbValues);
}