static int iGLProgressBarSetMaxAttrib(Ihandle* ih, const char* value)
{
  iGLProgressBar* pb = (iGLProgressBar*)iupAttribGet(ih, "_IUP_GLPROGRESSBAR");
  if (iupStrToDouble(value, &(pb->vmax)))
    iGLProgressBarCropValue(pb);
  return 0; /* do not store value in hash table */
}
Esempio n. 2
0
static int iGLValSetMaxAttrib(Ihandle* ih, const char* value)
{
  iGLVal* val = (iGLVal*)iupAttribGet(ih, "_IUP_GLVAL");
  if (iupStrToDouble(value, &(val->vmax)))
    iGLValCropValue(val);
  return 0; /* do not store value in hash table */
}
Esempio n. 3
0
static int iScintillaSetFontSizeFracStyleAttrib(Ihandle* ih, int style, const char* value)
{
  double size;

  if(style == IUP_INVALID_ID)
    style = 0;  /* Lexer style default */

  iupStrToDouble(value, &size);

  IupScintillaSendMessage(ih, SCI_STYLESETSIZEFRACTIONAL, style, (int)(size*SC_FONT_SIZE_MULTIPLIER));

  return 0;
}
Esempio n. 4
0
static int winValSetValueAttrib(Ihandle* ih, const char* value)
{
  if (iupStrToDouble(value, &(ih->data->val)))
  {
    int ival;

    iupValCropValue(ih);

    ival = (int)(((ih->data->val - ih->data->vmin) / (ih->data->vmax - ih->data->vmin))*SHRT_MAX);
    if (ih->data->inverted)
      ival = SHRT_MAX - ival;

    SendMessage(ih->handle, TBM_SETPOS, TRUE, ival);
  }
  return 0; /* do not store value in hash table */
}
static int gtkProgressBarSetValueAttrib(Ihandle* ih, const char* value)
{
  GtkProgressBar* pbar = (GtkProgressBar*)ih->handle;

  if (ih->data->marquee)
    return 0;

  if (!value)
    ih->data->value = 0;
  else
    iupStrToDouble(value, &(ih->data->value));

  iProgressBarCropValue(ih);

  gtk_progress_bar_set_fraction(pbar, (ih->data->value - ih->data->vmin) / (ih->data->vmax - ih->data->vmin));

  return 0;
}
Esempio n. 6
0
static int winProgressBarSetValueAttrib(Ihandle* ih, const char* value)
{
  if (!value)
    ih->data->value = 0;
  else
    iupStrToDouble(value, &(ih->data->value));

  iProgressBarCropValue(ih);

  /* Shows when the marquee style is not set */
  if (!ih->data->marquee)
  {
    double factor = (ih->data->value - ih->data->vmin) / (ih->data->vmax - ih->data->vmin);
    int val = (int)(IUP_PB_MAX * factor);
    SendMessage(ih->handle, PBM_SETPOS, (WPARAM)val, 0);
  }

  return 0;
}
Esempio n. 7
0
static int iValSetMinAttrib(Ihandle* ih, const char* value)
{
  if (iupStrToDouble(value, &(ih->data->vmin)))
    iupValCropValue(ih);
  return 0; /* do not store value in hash table */
}