Example #1
0
static void update_viewport(Ihandle* ih, cdCanvas *canvas, float posx, float posy)
{
  int view_x, view_y, view_w, view_h;

  /* The CD viewport is the same area represented by the virtual space of the scrollbar,
     but not using the same coordinates. */

  /* posy is top-bottom, CD is bottom-top.
     invert posy reference (YMAX-DY - POSY) */
  posy = IupGetFloat(ih, "YMAX")-IupGetFloat(ih, "DY") - posy;
  if (posy < 0) posy = 0;

  if (scale > 0)
  {
    view_w = WORLD_W*scale;
    view_h = WORLD_H*scale;
    view_x = (int)(posx*scale);
    view_y = (int)(posy*scale);
  }
  else
  {
    view_w = WORLD_W/abs(scale);
    view_h = WORLD_H/abs(scale);
    view_x = (int)(posx/abs(scale));
    view_y = (int)(posy/abs(scale));
  }

  wdCanvasViewport(canvas, -view_x, view_w-1 - view_x, -view_y, view_h-1 - view_y);
}
Example #2
0
int iupTreeKeyNodeCalcPos(Ihandle* ih, int* x, int* y, int* text_x)
{
  ItreeNodePtr node  = (ItreeNodePtr)ih->data->root;
  float posy = IupGetFloat(ih, "POSY");
  float dy   = IupGetFloat(ih, "DY");
  float posx = IupGetFloat(ih, "POSX");
  float dx   = IupGetFloat(ih, "DX");

  cdCanvasActivate(ih->data->cddbuffer);

  *y = (int)((1.0 + posy/dy)*(ih->data->YmaxC-ITREE_TREE_TOP_MARGIN));

  while(node != ih->data->selected)
  {
    if(node->visible == YES)
      *y -= ITREE_NODE_Y;

    node = node->next;
    if(node == NULL)
      return 0;
  }

  *y -= ITREE_NODE_Y;
  *x = (int)(ITREE_TREE_LEFT_MARGIN - (ih->data->XmaxC - ITREE_NODE_X) * posx / dx) + ITREE_NODE_X * node->depth;

  /* if node has a text associated to it... */
  *text_x = 0;
  if(node->name)
  {
    /* Calculates its dimensions */
    *text_x = iupdrvFontGetStringWidth(ih, node->name);
  }

  return 1;
}
Example #3
0
/* This callback is called when some action is performed on the
   scrollbar.
   -> action : type of action that call the event.
   -> x,y    : scrollbar thumb positions, value between 0 and 1
*/
int iupMatrixScrollCB(Ihandle* ih, int action, float x, float y)
{
  int err;

  x = IupGetFloat(ih, "POSX");
  y = IupGetFloat(ih, "POSY");

  IsCanvasSet(ih, err);
  if(err == CD_OK)
  {
    switch(action)
    {
      case IUP_SBUP      : ScrollUp(ih);       break;
      case IUP_SBDN      : ScrollDown(ih);     break;
      case IUP_SBPGUP    : ScrollPgUp(ih);     break;
      case IUP_SBPGDN    : ScrollPgDown(ih);   break;
      case IUP_SBRIGHT   : ScrollRight(ih);    break;
      case IUP_SBLEFT    : ScrollLeft(ih);     break;
      case IUP_SBPGRIGHT : ScrollPgRight(ih);  break;
      case IUP_SBPGLEFT  : ScrollPgLeft(ih);   break;
      case IUP_SBPOSV    : ScrollPosVer(ih,y); break;
      case IUP_SBPOSH    : ScrollPosHor(ih,x); break;
      case IUP_SBDRAGV   : ScrollPosVer(ih,y); break;
      case IUP_SBDRAGH   : ScrollPosHor(ih,x); break;
    }
  }

  {
    cdCanvasFlush(ih->data->cddbuffer);
    ih->data->redraw = 0;
  } /* always update */

  return IUP_DEFAULT;
}
Example #4
0
static void iScrollBoxLayoutUpdate(Ihandle* ih)
{
  int dx = ih->currentwidth, 
      dy = ih->currentheight;

  /* already updated the canvas layout, 
     so just have to update the scrollbars and child. */

  /* if child is greater than scrollbox, has scrollbars
     but this affects the oposite direction */

  if (ih->firstchild->currentwidth > ih->currentwidth)
    dy -= iupdrvGetScrollbarSize();

  if (ih->firstchild->currentheight > ih->currentheight)
    dx -= iupdrvGetScrollbarSize();

  IupSetfAttribute(ih, "DX", "%d", dx);
  IupSetfAttribute(ih, "DY", "%d", dy);

  if (ih->firstchild)
  {
    iScrollBoxUpdatePosition(ih, IupGetFloat(ih, "POSX"), IupGetFloat(ih, "POSY"));
    iupLayoutUpdate(ih->firstchild);
  }
}
Example #5
0
// naive fixed number of (short) * 0.01
int uiSyncFixed(Ihandle *ih) {
    short *fixedPointer = (short*)IupGetAttribute(ih, SYNCED_VALUE);
    const float maxFixedValue = IupGetFloat(ih, FIXED_MAX);
    const float minFixedValue = IupGetFloat(ih, FIXED_MIN);
    float value = IupGetFloat(ih, "VALUE");
    float newValue = value;
    short fixValue;
    char valueBuf[8];
    if (newValue > maxFixedValue) {
        newValue = maxFixedValue;
    } else if (newValue < minFixedValue) {
        newValue = minFixedValue;
    }

    if (newValue != value && value != 0) {
        sprintf(valueBuf, "%.2f", newValue);
        IupStoreAttribute(ih, "VALUE", valueBuf);
        // put caret at end to enable editing while normalizing
        IupStoreAttribute(ih, "CARET", "10");
    }
    // sync back
    fixValue = newValue / FIXED_EPSILON;
    InterlockedExchange16(fixedPointer, fixValue);
    return IUP_DEFAULT;
}
Example #6
0
static int wheel_cb(Ihandle *ih,float delta,int x,int y,char* status)
{
  int canvas_w, canvas_h;
  cdCanvas *canvas = (cdCanvas*)IupGetAttribute(ih, "_CD_CANVAS");
  (void)x;
  (void)y;
  (void)status;

  if (scale+delta==0) /* skip 0 */
  {
    if (scale > 0) 
      scale = -1;
    else 
      scale = 1;
  }
  else
    scale += (int)delta;

  cdCanvasActivate(canvas);
  cdCanvasGetSize(canvas, &canvas_w, &canvas_h, NULL, NULL);
  update_scrollbar(ih, canvas_w, canvas_h);
  update_viewport(ih, canvas, IupGetFloat(ih, "POSX"), IupGetFloat(ih, "POSY"));
  IupRedraw(ih, 0);
  return IUP_DEFAULT;
}
Example #7
0
int canvas_action_cb(Ihandle* canvas)
{
  int x, y, canvas_width, canvas_height;
  unsigned int ri, gi, bi;
  imImage* image;
  cdCanvas* cd_canvas = (cdCanvas*)IupGetAttribute(canvas, "cdCanvas");
  Ihandle* config = (Ihandle*)IupGetAttribute(canvas, "CONFIG");
  const char* background = IupConfigGetVariableStrDef(config, "MainWindow", "Background", "255 255 255");

  IupGetIntInt(canvas, "DRAWSIZE", &canvas_width, &canvas_height);

  cdCanvasActivate(cd_canvas);

  /* draw the background */
  sscanf(background, "%u %u %u", &ri, &gi, &bi);
  cdCanvasBackground(cd_canvas, cdEncodeColor((unsigned char)ri, (unsigned char)gi, (unsigned char)bi));
  cdCanvasClear(cd_canvas);

  /* draw the image at the center of the canvas */
  image = (imImage*)IupGetAttribute(canvas, "IMAGE");
  if (image)
  {
    int view_width, view_height;
    Ihandle* zoom_val = IupGetDialogChild(canvas, "ZOOMVAL");
    double zoom_index = IupGetDouble(zoom_val, "VALUE");
    double zoom_factor = pow(2, zoom_index);

    float posy = IupGetFloat(canvas, "POSY");
    float posx = IupGetFloat(canvas, "POSX");

    view_width = (int)(zoom_factor * image->width);
    view_height = (int)(zoom_factor * image->height);

    if (canvas_width < view_width)
      x = (int)floor(-posx*view_width);
    else
      x = (canvas_width - view_width) / 2;

    if (canvas_height < view_height)
    {
      /* posy is top-bottom, CD is bottom-top.
         invert posy reference (YMAX-DY - POSY) */
      float dy = IupGetFloat(canvas, "DY");
      posy = 1.0f - dy - posy;
      y = (int)floor(-posy*view_height);
    }
    else
      y = (canvas_height - view_height) / 2;

    /* black line around the image */
    cdCanvasForeground(cd_canvas, CD_BLACK);
    cdCanvasRect(cd_canvas, x - 1, x + view_width, y - 1, y + view_height);

    imcdCanvasPutImage(cd_canvas, image, x, y, view_width, view_height, 0, 0, 0, 0);
  }

  cdCanvasFlush(cd_canvas);
  return IUP_DEFAULT;
}
Example #8
0
static int resize_cb(Ihandle *ih, int canvas_w, int canvas_h)
{
  cdCanvas *canvas = (cdCanvas*)IupGetAttribute(ih, "_CD_CANVAS");

  /* update CD canvas */
  cdCanvasActivate(canvas);
 
  update_scrollbar(ih, canvas_w, canvas_h);
  update_viewport(ih, canvas, IupGetFloat(ih, "POSX"), IupGetFloat(ih, "POSY"));
  return IUP_DEFAULT;
}
Example #9
0
static void iScrollBoxSetChildrenPositionMethod(Ihandle* ih, int x, int y)
{
  if (ih->firstchild)
  {
    iScrollBoxUpdatePosition(ih, IupGetFloat(ih, "POSX"), IupGetFloat(ih, "POSY"));

    /* because ScrollBox is a native container, 
       child position is restarted at (0,0) */
    (void)x;
    (void)y;
  }
}
Example #10
0
// Button save
static int _location_save(/*@unused@*/ Ihandle *ih) {
    float lat,lon;
    if( (edt_lat==NULL) || (edt_lon==NULL) ) {
        LOG(LOGERR,_("Edt controls not accessible!"));
        return IUP_CLOSE;
    }
    lat = IupGetFloat(edt_lat,"VALUE");
    lon = IupGetFloat(edt_lon,"VALUE");
    (void)opt_set_location(lat,lon);
    opt_write_config();
    return IUP_CLOSE;
}
Example #11
0
int time_cb(void)
{
  float value = IupGetFloat(progressbar1, "VALUE");
  value += increment;
  if (value > 1) value = 0; /* start over */
  IupSetfAttribute(progressbar1, "VALUE", "%g", (double)value);

  value = IupGetFloat(progressbar2, "VALUE");
  value += increment*50;
  if (value > 50) value = 0; /* start over */
  IupSetfAttribute(progressbar2, "VALUE", "%g", (double)value);
  return IUP_DEFAULT;
}
Example #12
0
static void iScrollBoxLayoutUpdate(Ihandle* ih)
{
  int w, h;
  IupGetIntInt(ih, "DRAWSIZE", &w, &h);
  IupSetfAttribute(ih, "DX", "%d", w);
  IupSetfAttribute(ih, "DY", "%d", h);

  if (ih->firstchild)
  {
    iScrollBoxUpdatePosition(ih, IupGetFloat(ih, "POSX"), IupGetFloat(ih, "POSY"));
    iupLayoutUpdate(ih->firstchild);
  }
}
Example #13
0
/* This function is called when a drag is performed in the scrollbar.
   -> x    : scrollbar thumb position, value between 0 and 1
   -> mode : DO NOT USED
   -> m    : define the mode of operation: lines or columns [IMAT_MAT_LIN|IMAT_MAT_COL]
*/
void iupMatrixScrollPos(Ihandle* ih, int mode, float x, int m)
{
  int   pos;
  float dx;
  ImatLinColData* p;
  (void)mode;

  if(m == IMAT_MAT_LIN)
  {
    p = &(ih->data->lin);
    dx = IupGetFloat(ih, "DY");
  }
  else
  {
    p = &(ih->data->col);
    dx = IupGetFloat(ih, "DX");
  }

  pos = (int)(x * p->totalwh + 0.5);

  iupMatrixFocusHideFocus(ih);
  iMatrixScrollGetFirstLineColumn(ih, pos, m);
  iupMatrixAuxGetLastWidth(ih, m);

  /* The count executed by iMatrixScrollGetFirstLineColumn function finds the column
     with the position most closely of the scrollbar. But, when the scrollbar is
     nearly in the end of rigth side, this count can not solve the problem,
     because the last column will not be fully visible...
     So, the following code identifies that the scrollbar is nearly in the
     right side, plus its position with its size, and compare with 1.0
     (tolerance of 0.0005).
  */
  if((x + dx >= 0.9995) && (p->last   != (p->num-1) ||
                            p->lastwh != p->wh[p->num-1]))
  {
    /* Increment the first col until that the last is fully visible */
    do
    {
      p->first++;
      iupMatrixAuxGetLastWidth(ih, m);
    } while(p->lastwh != p->wh[p->num-1] ||
            p->last   != (p->num-1));

    iupMatrixAuxGetPos(ih, m);
  }

  iupMatrixSetSb(ih, m);
  iupMatrixDrawMatrix(ih, m);
  iupMatrixFocusSetShowFocus(ih, ih->data->lin.active, ih->data->col.active);
}
Example #14
0
static int iScrollBoxButton_CB(Ihandle *ih, int but, int pressed, int x, int y, char* status)
{
  if (but==IUP_BUTTON1 && pressed)
  {
    iupAttribSetInt(ih, "_IUP_START_X", x);
    iupAttribSetInt(ih, "_IUP_START_Y", y);
    iupAttribSetInt(ih, "_IUP_START_POSX", (int)IupGetFloat(ih, "POSX"));
    iupAttribSetInt(ih, "_IUP_START_POSY", (int)IupGetFloat(ih, "POSY"));
    iupAttribSetStr(ih, "_IUP_DRAG_SB", "1");
  }
  if (but==IUP_BUTTON1 && !pressed)
    iupAttribSetStr(ih, "_IUP_DRAG_SB", NULL);
  (void)status;
  return IUP_DEFAULT;
}
Example #15
0
File: gauge.c Project: defdef/iup
int idle_cb(void)
{
  char newvalue[40];
  double value = (double)IupGetFloat(gauge, "VALUE");
  
  value += speed;
  
  if(value > IupGetFloat(gauge, "MAX")) value = IupGetFloat(gauge, "MIN");
  
  sprintf(newvalue, "%.7f",value);
  
  IupSetAttribute(gauge, "VALUE", newvalue);

  return IUP_DEFAULT;
}
Example #16
0
static int val_action_cb(Ihandle *ih)
{
  Ihandle* pbar = (Ihandle*)IupGetAttribute(ih, "PROGRESSBAR");
  IupSetStrAttribute(pbar, "VALUE", IupGetAttribute(ih, "VALUE"));
  printf("ACTION_CB(%s, value=%0.1f) NAME=%s\n", IupGetClassName(ih), IupGetFloat(ih, "VALUE"), IupGetAttribute(ih, "NAME"));
  return IUP_DEFAULT;
}
Example #17
0
static int time_cb(void)
{
  float value = IupGetFloat(gauge, "VALUE");
  value += increment;
  if (value > 1) value = 0; /* start over */
  IupSetfAttribute(gauge, "VALUE", "%f", (double)value);
  return IUP_DEFAULT;
}
Example #18
0
static int iScrollBoxMotion_CB(Ihandle *ih, int x, int y, char* status)
{
  if (iup_isbutton1(status) &&
      iupAttribGet(ih, "_IUP_DRAG_SB"))
  {
    int start_x = iupAttribGetInt(ih, "_IUP_START_X");
    int start_y = iupAttribGetInt(ih, "_IUP_START_Y");
    int dx = x - start_x;
    int dy = y - start_y;
    int posx = iupAttribGetInt(ih, "_IUP_START_POSX");
    int posy = iupAttribGetInt(ih, "_IUP_START_POSY");
    IupSetInt(ih, "POSX", posx-dx);  /* drag direction is oposite to scrollbar */
    IupSetInt(ih, "POSY", posy-dy);
    iScrollBoxScroll_CB(ih, 0, IupGetFloat(ih, "POSX"), IupGetFloat(ih, "POSY"));
  }
  return IUP_DEFAULT;
}
Example #19
0
static int resize_cb(Ihandle *ih, int canvas_w, int canvas_h)
{
  cdCanvas *canvas = (cdCanvas*)IupGetAttribute(ih, "_CD_CANVAS");

printf("RESIZE_CB(%d, %d) RASTERSIZE=%s DRAWSIZE=%s \n", canvas_w, canvas_h, IupGetAttribute(ih, "RASTERSIZE"), IupGetAttribute(ih, "DRAWSIZE"));
  /* When *AUTOHIDE=Yes, this can hide a scrollbar and so change the canvas drawsize */
  update_scrollbar(ih, canvas_w, canvas_h);  
printf("                                DRAWSIZE=%s \n", IupGetAttribute(ih, "DRAWSIZE"));
  /* update the canvas size */
  IupGetIntInt(ih, "DRAWSIZE", &canvas_w, &canvas_h);

  /* update the application */
  cdCanvasActivate(canvas);
  update_scrollbar(ih, canvas_w, canvas_h);  
  update_viewport(ih, canvas, IupGetFloat(ih, "POSX"), IupGetFloat(ih, "POSY"));

  return IUP_DEFAULT;
}
Example #20
0
int canvas_wheel_cb(Ihandle* canvas, float delta)
{
  if (IupGetInt(NULL, "CONTROLKEY"))
  {
    if (delta < 0)
      zoomout_action_cb(canvas);
    else
      zoomin_action_cb(canvas);
  }
  else
  {
    float posy = IupGetFloat(canvas, "POSY");
    posy -= delta * IupGetFloat(canvas, "DY") / 10.0f;
    IupSetFloat(canvas, "POSY", posy);
    IupUpdate(canvas);
  }
  return IUP_DEFAULT;
}
Example #21
0
int dial2_btnup_cb(Ihandle *self, double angle)
{
  int ii = tabs_get_index();
  double x1, x2, xm;

  x1 = IupGetFloat(plot[ii], "OLD_XMIN");
  x2 = IupGetFloat(plot[ii], "OLD_XMAX");

  xm = (x1 + x2) / 2.0;

  x1 = xm - (xm - x1)*(1.0-angle*1.0/3.141592); // one circle will zoom 2 times
  x2 = xm + (x2 - xm)*(1.0-angle*1.0/3.141592);

  IupSetfAttribute(plot[ii], "AXS_XMIN", "%g", x1);
  IupSetfAttribute(plot[ii], "AXS_XMAX", "%g", x2);

  IupSetAttribute(plot[ii], "REDRAW", NULL);

  return IUP_DEFAULT;
}
Example #22
0
/* idle callback */
int idle_cb(void)
{
  char newvalue[40];
  double value = IupGetFloat(gauge, "VALUE") ;
  value+=velocidade ;
  if(value < 0.0) value = 0.0 ;
  if(value > 1.0) value = 1.0 ;
  sprintf(newvalue, "%.7f",value) ;
  IupSetAttribute(gauge, "VALUE", newvalue) ;

  return IUP_DEFAULT ;
}
Example #23
0
void scroll_center(Ihandle* canvas, float old_center_x, float old_center_y)
{
  /* always update the scroll position
     keeping it proportional to the old position
     relative to the center of the canvas. */

  float dx = IupGetFloat(canvas, "DX");
  float dy = IupGetFloat(canvas, "DY");

  float posx = old_center_x - dx / 2.0f;
  float posy = old_center_y - dy / 2.0f;

  if (posx < 0) posx = 0;
  if (posx > 1 - dx) posx = 1 - dx;

  if (posy < 0) posy = 0;
  if (posy > 1 - dy) posy = 1 - dy;

  IupSetFloat(canvas, "POSX", posx);
  IupSetFloat(canvas, "POSY", posy);
}
Example #24
0
static char* get_posy(Ihandle *n)
{
   Widget sb;

   if (type(n) != CANVAS_) return NULL;

   sb = XtNameToWidget( XtParent((Widget)handle(n)), "vertical" );

   if (sb) 
   {
      char *strpos = getBuffer();
      float pos = 0;
      int v;
      float max = IupGetFloat(n, IUP_YMAX);
      float min = IupGetFloat(n, IUP_YMIN);
      XtVaGetValues( sb, XmNvalue, &v, NULL );
      pos = ((max-min)/(float)INT_MAX) * v + min;
      sprintf(strpos, "%.3f", (double)pos);
      return strpos;
   }
   return NULL;
}
Example #25
0
int dial1_btnup_cb(Ihandle *self, double angle)
{
  int ii = tabs_get_index();
  double x1, x2, xm;
  char *ss;

  x1 = IupGetFloat(plot[ii], "OLD_YMIN");
  x2 = IupGetFloat(plot[ii], "OLD_YMAX");

  ss = IupGetAttribute(plot[ii], "AXS_YMODE");
  if ( ss && ss[3]=='2' ) {
    // LOG2:  one circle will zoom 2 times
    xm = 4.0 * fabs(angle) / 3.141592;
    if (angle>0.0) { x2 /= xm; x1 *= xm; }
    else { x2 *= xm; x1 /= xm; }
  }
  if ( ss && ss[3]=='1' ) {
    // LOG10:  one circle will zoom 10 times
    xm = 10.0 * fabs(angle) / 3.141592;
    if (angle>0.0) { x2 /= xm; x1 *= xm; }
    else { x2 *= xm; x1 /= xm; }
  }
  else {
    // LIN: one circle will zoom 2 times
    xm = (x1 + x2) / 2.0;
    x1 = xm - (xm - x1)*(1.0-angle*1.0/3.141592);
    x2 = xm + (x2 - xm)*(1.0-angle*1.0/3.141592);
  }

  if (x1<x2)
  {
    IupSetfAttribute(plot[ii], "AXS_YMIN", "%g", x1);
    IupSetfAttribute(plot[ii], "AXS_YMAX", "%g", x2);
  }

  IupSetAttribute(plot[ii], "REDRAW", NULL);

  return IUP_DEFAULT;
}
Example #26
0
int treeNodeCalcPos(Ihandle* h, int *x, int *y, int *text_x)
{
  int err;
  TtreePtr tree=(TtreePtr)tree_data(h);
  Node node = (Node)tree_root(tree);
  float posy = IupGetFloat(h, IUP_POSY);     
  float dy = IupGetFloat(h, IUP_DY);
  float posx = IupGetFloat(h, IUP_POSX);
  float dx = IupGetFloat(h, IUP_DX);

  CdActivate(tree,err);

  *y = (int)((1.0 + posy/dy)*(YmaxCanvas(tree)-TREE_TOP_MARGIN));

  while(node != tree_selected(tree))
  {
    if( node_visible(node) == YES ) *y -= NODE_Y;

    node = node_next(node);
    if (node == NULL)
      return 0;
  }

  *y -= NODE_Y;
  *x = (int)(TREE_LEFT_MARGIN - (XmaxCanvas(tree)-NODE_X)*posx/dx) + NODE_X * node_depth(node);

  /* if node has a text associated to it... */
  *text_x = 0;
  if(node_name(node))
  {
    /* Calculates its dimensions */
    iupdrvStringSize(tree->self, node_name(node), text_x, NULL);
  }

  return 1;
}
Example #27
0
// shared callbacks
int uiSyncChance(Ihandle *ih) {
    char valueBuf[8];
    float value = IupGetFloat(ih, "VALUE"), newValue = value;
    short *chancePtr = (short*)IupGetAttribute(ih, SYNCED_VALUE);
    if (newValue > 100.0f) {
       newValue = 100.0f;
    } else if (newValue < 0) {
       newValue = 0.0f;
    }
    if (newValue != value) { // equality compare is fine since newValue is a copy of value
        sprintf(valueBuf, "%.1f", newValue);
        IupStoreAttribute(ih, "VALUE", valueBuf);
        // put caret at end to enable editing while normalizing
        IupStoreAttribute(ih, "CARET", "10");
    }
    // and sync chance value
    InterlockedExchange16(chancePtr, (short)(newValue * 100));
    return IUP_DEFAULT;
}
Example #28
0
float IupTreeGetFloat(Ihandle* ih, const char* a, int id)
{
  char* attr = iupStrGetMemory(50);
  sprintf(attr, "%s%d", a, id);
  return IupGetFloat(ih, attr);
}
static int iGLCanvasBoxSetRedrawAttrib(Ihandle* ih, const char* value)
{
  iGLCanvasBoxACTION(ih, IupGetFloat(ih, "POSX"), IupGetFloat(ih, "POSY"));
  (void)value;
  return 0;
}
Example #30
0
float IupMatGetFloat(Ihandle* ih, const char* a, int l, int c)
{
  char* attr = iupStrGetMemory(100);
  sprintf(attr, "%s%d:%d", a, l, c);
  return IupGetFloat(ih, attr);
}