示例#1
0
static void iMatrixDrawDropFeedback(Ihandle* ih, int x2, int y1, int y2, int active, long framecolor)
{
  int xh2, yh2, x1;

  /* feedback area */
  iupMatrixDrawSetDropFeedbackArea(&x1, &y1, &x2, &y2);

  /* feedback background */
  iMatrixDrawSetBgColor(ih, 0, 0, 0, active);
  iupMATRIX_BOX(ih, x1, x2, y1, y2);

  /* feedback frame */
  cdCanvasForeground(ih->data->cd_canvas, framecolor);
  iupMATRIX_RECT(ih, x1, x2, y1, y2);

  /* feedback arrow */
  xh2 = x2 - IMAT_DROPBOX_W/2;
  yh2 = y2 - (y2 - y1)/2;

  cdCanvasBegin(ih->data->cd_canvas, CD_FILL);
  iupMATRIX_VERTEX(ih, xh2, yh2 + 3);
  iupMATRIX_VERTEX(ih, xh2 + 4, yh2 - 1);
  iupMATRIX_VERTEX(ih, xh2 - 4, yh2 - 1);
  cdCanvasEnd(ih->data->cd_canvas);
}
示例#2
0
static void iMatrixDrawComboFeedback(Ihandle* ih, int x2, int y1, int y2, int active, long framecolor)
{
    int xh2, yh2, x1;

    /* feedback area */
    x2 -= IMAT_PADDING_W/2 + IMAT_FRAME_W/2;
    x1  = x2 - IMAT_COMBOBOX_W;
    y1 += IMAT_PADDING_H/2 + IMAT_FRAME_H/2;
    y2 -= IMAT_PADDING_H/2 + IMAT_FRAME_H/2;

    /* feedback background */
    iMatrixDrawSetBgColor(ih, 0, 0, 0, active);
    iupMATRIX_BOX(ih, x1, x2, y1, y2);

    /* feedback frame */
    cdCanvasForeground(ih->data->cddbuffer, framecolor);
    iupMATRIX_RECT(ih, x1, x2, y1, y2);

    /* feedback arrow */
    xh2 = x2 - IMAT_COMBOBOX_W / 2;
    yh2 = y2 - (y2 - y1) / 2;

    cdCanvasBegin(ih->data->cddbuffer, CD_FILL);
    iupMATRIX_VERTEX(ih, xh2, yh2 + 3);
    iupMATRIX_VERTEX(ih, xh2 + 4, yh2 - 1);
    iupMATRIX_VERTEX(ih, xh2 - 4, yh2 - 1);
    cdCanvasEnd(ih->data->cddbuffer);
}
示例#3
0
static int iMatrixDrawSortSign(Ihandle* ih, int x2, int y1, int y2, int col, int active)
{
  int yc;
  char* sort = iupAttribGetId(ih, "SORTSIGN", col);
  if (!sort || iupStrEqualNoCase(sort, "NO"))
    return 0;

  /* Remove the space between text and cell frame */
  x2 -= IMAT_PADDING_W/2 + IMAT_FRAME_W/2;

  /* Set the color used to draw the text */
  iMatrixDrawSetFgColor(ih, 0, col, 0, active);

  yc = (int)( (y1 + y2 ) / 2.0 - .5);

  cdCanvasBegin(ih->data->cd_canvas, CD_FILL);

  if (iupStrEqualNoCase(sort, "DOWN"))
  {
    iupMATRIX_VERTEX(ih, x2 - 5, yc + 2);
    iupMATRIX_VERTEX(ih, x2 - 1, yc - 2);
    iupMATRIX_VERTEX(ih, x2 - 9, yc - 2);
  }
  else  /* UP */
  {
    iupMATRIX_VERTEX(ih, x2 - 1, yc + 2);
    iupMATRIX_VERTEX(ih, x2 - 9, yc + 2);
    iupMATRIX_VERTEX(ih, x2 - 5, yc - 2);
  }

  cdCanvasEnd(ih->data->cd_canvas);
  return 1;
}
示例#4
0
static int iMatrixDrawSortSign(Ihandle* ih, int x2, int y1, int y2, int col, int active, char* str)
{
    int yc;
    char* sort;

    sprintf(str, "SORTSIGN%d", col);
    sort = iupAttribGet(ih, str);
    if (!sort || iupStrEqualNoCase(sort, "NO"))
        return 0;

    /* Remove the space between text and cell frame */
    x2 -= IMAT_PADDING_W/2 + IMAT_FRAME_W/2;

    /* Set the color used to draw the text */
    if (active)
        cdCanvasForeground(ih->data->cddbuffer, IMAT_CD_INACTIVE_FGCOLOR);
    else
        iMatrixDrawSetFgColor(ih, 0, col, 0);

    yc = (int)( (y1 + y2 ) / 2.0 - .5);

    cdCanvasBegin(ih->data->cddbuffer, CD_FILL);

    if (iupStrEqualNoCase(sort, "DOWN"))
    {
        iupMATRIX_VERTEX(ih, x2 - 5, yc + 2);
        iupMATRIX_VERTEX(ih, x2 - 1, yc - 2);
        iupMATRIX_VERTEX(ih, x2 - 9, yc - 2);
    }
    else
    {
        iupMATRIX_VERTEX(ih, x2 - 1, yc + 2);
        iupMATRIX_VERTEX(ih, x2 - 9, yc + 2);
        iupMATRIX_VERTEX(ih, x2 - 5, yc - 2);
    }

    cdCanvasEnd(ih->data->cddbuffer);
    return 1;
}