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); }
static void iMatrixDrawDropdownButton(Ihandle* ih, int x2, int y1, int y2, int lin, int col, int marked, int active) { int x1; /* feedback area */ iupMatrixDrawSetDropFeedbackArea(&x1, &y1, &x2, &y2); iMatrixDrawFeedbackImage(ih, x1, x2, y1, y2, lin, col, active, marked, iupAttribGet(ih, "DROPIMAGE"), imatrix_dropdown_alpha); }
static int iMatrixDrawSortSign(Ihandle* ih, int x2, int y1, int y2, int col, int active) { int x1; char* sort = iupAttribGetId(ih, "SORTSIGN", col); if (!sort || iupStrEqualNoCase(sort, "NO")) return 0; /* feedback area */ iupMatrixDrawSetDropFeedbackArea(&x1, &y1, &x2, &y2); if (iupStrEqualNoCase(sort, "DOWN")) iMatrixDrawFeedbackImage(ih, x1, x2, y1, y2, 0, col, active, 0, iupAttribGet(ih, "SORTIMAGEDOWN"), imatrix_sortdown_alpha); else iMatrixDrawFeedbackImage(ih, x1, x2, y1, y2, 0, col, active, 0, iupAttribGet(ih, "SORTIMAGEUP"), imatrix_sortup_alpha); return 1; }