本文整理汇总了C++中cdCanvasForeground函数的典型用法代码示例。如果您正苦于以下问题:C++ cdCanvasForeground函数的具体用法?C++ cdCanvasForeground怎么用?C++ cdCanvasForeground使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了cdCanvasForeground函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: cdIupDrawHorizSunkenMark
void cdIupDrawHorizSunkenMark(cdCanvas *canvas, int x1, int x2, int y, long light_shadow, long dark_shadow)
{
cdCanvasForeground(canvas, dark_shadow);
cdCanvasLine(canvas, x1, y+1, x2, y+1);
cdCanvasForeground(canvas, light_shadow);
cdCanvasLine(canvas, x1, y, x2, y);
}
开发者ID:svn2github,项目名称:iup-iup,代码行数:7,代码来源:iup_cdutil.c
示例2: iDialDrawCircular
static void iDialDrawCircular(Ihandle* ih)
{
double delta = 2 * M_PI / ih->data->num_div, a = ih->data->angle;
int i, xc = ih->data->w / 2, yc = ih->data->h / 2, wide;
ih->data->radius = dialmin(ih->data->w, ih->data->h) / 2 - 2 * IDIAL_SPACE;
wide = (int)(2 * ih->data->radius);
cdCanvasForeground(ih->data->cd_canvas, ih->data->mid_shadow);
cdCanvasLineWidth(ih->data->cd_canvas, 2);
cdCanvasArc(ih->data->cd_canvas, xc, yc, wide-1, wide-1, -135, 45.0);
cdCanvasLineWidth(ih->data->cd_canvas, 1);
cdCanvasForeground(ih->data->cd_canvas, ih->data->bgcolor);
cdCanvasSector(ih->data->cd_canvas, xc, yc, wide-2, wide-2, 0.0, 360.0);
cdCanvasForeground(ih->data->cd_canvas, ih->data->light_shadow);
cdCanvasArc(ih->data->cd_canvas, xc, yc, wide, wide, 45, 225);
cdCanvasForeground(ih->data->cd_canvas, ih->data->dark_shadow);
cdCanvasArc(ih->data->cd_canvas, xc, yc, wide, wide, -135, 45);
for (i = 0; i < ih->data->num_div; ++i)
{
int x2 = (int)(xc + (ih->data->radius - 6) * cos(a));
int y2 = (int)(yc + (ih->data->radius - 6) * sin(a));
if (i == 0)
{
cdCanvasForeground(ih->data->cd_canvas, CD_BLACK);
cdCanvasLine(ih->data->cd_canvas, xc, yc, x2, y2);
}
iDialDrawCircularMark(ih, x2-2, y2-2);
a += delta;
}
iDialDrawCircularMark(ih, xc-2, yc-2);
}
开发者ID:Vulcanior,项目名称:IUP,代码行数:35,代码来源:iup_dial.c
示例3: iDialDrawVerticalBackground
static void iDialDrawVerticalBackground(Ihandle* ih, double amin, double amax, int *ymin, int *ymax)
{
double delta = (0.5 * M_PI - amin) / IDIAL_NCOLORS;
double a, yc = ih->data->h / 2.0;
*ymin = *ymax = ih->data->h / 2;
for (a = amin; a < 0.5 * M_PI; a += delta) /* shading */
{
int y0 = (int)(yc - ih->data->radius * cos(a));
int y1 = (int)(yc - ih->data->radius * cos(a+delta));
cdCanvasForeground(ih->data->cd_canvas, iDialGetFgColor(ih, a, amin));
cdCanvasBox(ih->data->cd_canvas, IDIAL_SPACE+1, ih->data->w-1-IDIAL_SPACE-2, y0, y1);
if (y0 < *ymin) *ymin = y0;
if (abs(y1-y0) < 2)
continue;
}
for (a = 0.5 * M_PI; a < amax; a += delta)
{
int y0 = (int)(yc + ih->data->radius * fabs(cos(a)));
int y1 = (int)(yc + ih->data->radius * fabs(cos(a+delta)));
cdCanvasForeground(ih->data->cd_canvas, iDialGetFgColor(ih, a, amin));
cdCanvasBox(ih->data->cd_canvas, IDIAL_SPACE+1, ih->data->w-1-IDIAL_SPACE-2, y0, y1);
if (y1 > *ymax) *ymax = y1;
if (abs(y1-y0) < 2)
continue;
}
}
开发者ID:Vulcanior,项目名称:IUP,代码行数:30,代码来源:iup_dial.c
示例4: iDialDrawHorizontalBackground
static void iDialDrawHorizontalBackground(Ihandle* ih,double amin,double amax, int *xmin, int *xmax)
{
double delta = (0.5 * M_PI - amin) / IDIAL_NCOLORS;
double a, xc = ih->data->w / 2.0;
*xmin = *xmax = ih->data->w / 2;
for (a = amin; a < 0.5 * M_PI; a += delta)
{
int x0=(int)(xc - ih->data->radius * cos(a));
int x1=(int)(xc - ih->data->radius * cos(a + delta));
cdCanvasForeground(ih->data->cd_canvas,iDialGetFgColor(ih, a, amin));
cdCanvasBox(ih->data->cd_canvas, x0, x1, IDIAL_SPACE+2, ih->data->h-1-IDIAL_SPACE-1);
if (x0 < *xmin) *xmin = x0;
if (abs(x1 - x0) < 2)
continue;
}
for (a = 0.5 * M_PI; a < amax; a += delta)
{
int x0 =(int)(xc + ih->data->radius * fabs(cos(a)));
int x1 =(int)(xc + ih->data->radius * fabs(cos(a + delta)));
cdCanvasForeground(ih->data->cd_canvas, iDialGetFgColor(ih, a, amin));
cdCanvasBox(ih->data->cd_canvas, x0, x1, IDIAL_SPACE+2, ih->data->h-1-IDIAL_SPACE-1);
if (x1 > *xmax) *xmax = x1;
if (abs(x1-x0) < 2)
continue;
}
}
开发者ID:Vulcanior,项目名称:IUP,代码行数:30,代码来源:iup_dial.c
示例5: draw_cb
static int draw_cb(Ihandle* h, int i, int j, int xmin, int xmax, int ymin, int ymax, cdCanvas* canvas)
{
int xm = (xmax + xmin) / 2;
int ym = (ymax + ymin) / 2;
static char buffer[64];
if (i == 1 && j == 2) return IUP_DEFAULT;
if (i == 2 && j == 1) return IUP_DEFAULT;
if (i == 2 && j == 2) return IUP_DEFAULT;
if (i == 5 && j == 6) return IUP_DEFAULT;
if (i == 6 && j == 5) return IUP_DEFAULT;
if (i == 6 && j == 6) return IUP_DEFAULT;
if (i == 1 && j == 1)
cdCanvasForeground(canvas, CD_WHITE);
else
cdCanvasForeground(canvas, cdEncodeColor(
(unsigned char)(i*20),
(unsigned char)(j*100),
(unsigned char)(i+100)));
cdCanvasBox(canvas, xmin, xmax, ymin, ymax);
cdCanvasTextAlignment(canvas, CD_CENTER);
cdCanvasForeground(canvas, CD_BLACK);
sprintf(buffer, "(%02d, %02d)", i, j);
cdCanvasText(canvas, xm, ym, buffer);
return IUP_DEFAULT;
}
开发者ID:sanikoyes,项目名称:iup,代码行数:28,代码来源:cells_degrade.c
示例6: cdIupDrawVertSunkenMark
void cdIupDrawVertSunkenMark(cdCanvas *canvas, int x, int y1, int y2, long light_shadow, long dark_shadow)
{
cdCanvasForeground(canvas, dark_shadow);
cdCanvasLine(canvas, x-1, y1, x-1, y2);
cdCanvasForeground(canvas, light_shadow);
cdCanvasLine(canvas, x, y1, x, y2);
}
开发者ID:svn2github,项目名称:iup-iup,代码行数:7,代码来源:iup_cdutil.c
示例7: draw_cb
static int draw_cb(Ihandle* h, int i, int j, int xmin, int xmax, int ymin, int ymax, cdCanvas* canvas)
{
if (((i%2) && (j%2)) || (((i+1)%2) && ((j+1)%2)))
cdCanvasForeground(canvas, CD_WHITE);
else
cdCanvasForeground(canvas, CD_BLACK);
cdCanvasBox(canvas, xmin, xmax, ymin, ymax);
return IUP_DEFAULT;
}
开发者ID:defdef,项目名称:iup,代码行数:10,代码来源:cells_checkboard.c
示例8: cdIupDrawFocusRect
void cdIupDrawFocusRect(cdCanvas *canvas, int x1, int y1, int x2, int y2)
{
int old_linestyle = cdCanvasLineStyle(canvas, CD_DOTTED);
int old_foreground = cdCanvasForeground(canvas, CD_WHITE);
int old_writemode = cdCanvasWriteMode(canvas, CD_XOR);
cdCanvasRect(canvas, x1, x2, y1, y2);
cdCanvasWriteMode(canvas, old_writemode);
cdCanvasForeground(canvas, old_foreground);
cdCanvasLineStyle(canvas, old_linestyle);
}
开发者ID:svn2github,项目名称:iup-iup,代码行数:12,代码来源:iup_cdutil.c
示例9: cdIupDrawRaiseRect
void cdIupDrawRaiseRect(cdCanvas *canvas, int x1, int y1, int x2, int y2, long light_shadow, long mid_shadow, long dark_shadow)
{
cdCanvasForeground(canvas, light_shadow);
cdCanvasLine(canvas, x1, y1+1, x1, y2);
cdCanvasLine(canvas, x1, y2, x2-1, y2);
cdCanvasForeground(canvas, dark_shadow);
cdCanvasLine(canvas, x1, y1, x2, y1);
cdCanvasLine(canvas, x2, y1, x2, y2);
cdCanvasForeground(canvas, mid_shadow);
cdCanvasLine(canvas, x1+1, y1+1, x2-1, y1+1);
cdCanvasLine(canvas, x2-1, y1+2, x2-1, y2-1);
}
开发者ID:svn2github,项目名称:iup-iup,代码行数:14,代码来源:iup_cdutil.c
示例10: iMatrixDrawComboFeedback
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);
}
开发者ID:xushiwei,项目名称:iup,代码行数:28,代码来源:iupmat_draw.c
示例11: mouse
/*
%F Muda a largura da coluna interativamente, so muda a linha na tela.
Qando o usuario termina o drag, a funcao iupmatColresFinish e chamada
para realmente mudar a largura da coluna.
%i h : handle da matriz,
x : coordenada x do mouse (coordenadas do canvas).
*/
void iupmatColresMove(Ihandle *h, int x)
{
Tmat *mat=(Tmat*)matrix_data(h);
int y1,y2, charwidth,charheight;
iupdrvGetCharSize(h,&charwidth,&charheight);
/* Se tamanho da coluna ficou muito pequeno, nao muda tamanho da coluna */
if (x < DragColStartPos+charwidth+DECOR_X)
return;
y1 = mat_ht(mat);
y2 = YmaxCanvas(mat);
cdCanvasWriteMode(mat->cdcanvas, CD_XOR);
cdCanvasForeground(mat->cdcanvas, RESIZE_COLOR);
/* Se nao e a primeira vez, retira linha antiga */
if (Lastxpos != -1)
cdCanvasLine(mat->cdcanvas,Lastxpos,INVY(y1),Lastxpos,INVY(y2));
cdCanvasLine(mat->cdcanvas,x,INVY(y1),x,INVY(y2));
Lastxpos = x;
cdCanvasWriteMode(mat->cdcanvas, CD_REPLACE);
}
开发者ID:svn2github,项目名称:iup-iup,代码行数:35,代码来源:imcolres.c
示例12: iupMatrixColResFinish
void iupMatrixColResFinish(Ihandle* ih, int x)
{
char str[100];
int width = x - ih->data->colres_drag_col_start_x;
if (width < 0)
width = 0;
/* delete feedback */
if (ih->data->colres_drag_col_last_x != -1)
{
int y1 = ih->data->lines.sizes[0]; /* from the bottom of the line of titles */
int y2 = ih->data->h-1; /* to the bottom of the matrix */
cdCanvasWriteMode(ih->data->cdcanvas, CD_XOR);
cdCanvasForeground(ih->data->cdcanvas, IMAT_RESIZE_COLOR);
cdCanvasLine(ih->data->cdcanvas, ih->data->colres_drag_col_last_x, iupMatrixInvertYAxis(ih, y1),
ih->data->colres_drag_col_last_x, iupMatrixInvertYAxis(ih, y2));
cdCanvasWriteMode(ih->data->cdcanvas, CD_REPLACE);
}
ih->data->colres_dragging = 0;
sprintf(str, "RASTERWIDTH%d", ih->data->colres_drag_col);
iupAttribSetInt(ih, str, width-IMAT_PADDING_W-IMAT_FRAME_W);
sprintf(str, "WIDTH%d", ih->data->colres_drag_col);
iupAttribSetStr(ih, str, NULL);
ih->data->need_calcsize = 1;
iupMatrixDraw(ih, 0);
}
开发者ID:Airr,项目名称:iup_mac,代码行数:30,代码来源:iupmat_colres.c
示例13: iupMatrixColResMove
/* Change the column width interactively, just change the line in the screen.
When the user finishes the drag, the iupMatrixColResFinish function is called
to truly change the column width. */
void iupMatrixColResMove(Ihandle* ih, int x)
{
int y1, y2;
int width = x - ih->data->colres_drag_col_start_x;
if (width < 0)
return;
y1 = ih->data->lines.sizes[0]; /* from the bottom of the line of titles */
y2 = ih->data->h-1; /* to the bottom of the matrix */
cdCanvasWriteMode(ih->data->cdcanvas, CD_XOR);
cdCanvasForeground(ih->data->cdcanvas, IMAT_RESIZE_COLOR);
/* If it is not the first time, move old line */
if (ih->data->colres_drag_col_last_x != -1)
{
cdCanvasLine(ih->data->cdcanvas, ih->data->colres_drag_col_last_x, iupMatrixInvertYAxis(ih, y1),
ih->data->colres_drag_col_last_x, iupMatrixInvertYAxis(ih, y2));
}
cdCanvasLine(ih->data->cdcanvas, x, iupMatrixInvertYAxis(ih, y1),
x, iupMatrixInvertYAxis(ih, y2));
ih->data->colres_drag_col_last_x = x;
cdCanvasWriteMode(ih->data->cdcanvas, CD_REPLACE);
}
开发者ID:Airr,项目名称:iup_mac,代码行数:30,代码来源:iupmat_colres.c
示例14: repaint_cell_in
/**
* Repaint function for one cell in a given coordinate;
* (assume that the canvas is already activated).
*/
static void repaint_cell_in(TCells* obj, int i, int j,
int xmin, int xmax, int ymin, int ymax) {
int k;
int w = obj->width;
int h = obj->height;
int hspan = 1;
int vspan = 1;
/* Checking if the cells is out of range. (no span will affect it!) */
if (xmin > w || ymax < 0) return;
/* Calculating cell spans */
hspan = get_hspan(obj, i, j);
vspan = get_vspan(obj, i, j);
/* if any span is set to zero, then another cell invaded its space and
* the cell does not need to draw itself */
if (hspan == 0 || vspan == 0) return;
/* Increasing cell's width and height according to its spans */
for(k = 1; k < hspan; k++) xmax += get_width(obj, j+k);
for(k = 1; k < vspan; k++) ymin -= get_height(obj, i+k);
/* Checking if the cell expanded enough to appear inside the canvas */
if (xmax < 0 || ymin > h) return;
/* Calling application's draw callback */
call_apl_draw(obj, xmin, xmax, ymin, ymax, i, j);
/* Drawing a box in cell's area */
if (obj->boxed) {
cdCanvasForeground(obj->cddbuffer,CD_BLACK);
cdCanvasRect(obj->cddbuffer,xmin, xmax, ymin, ymax);
}
}
开发者ID:svn2github,项目名称:iup-iup,代码行数:39,代码来源:iupcells.c
示例15: iMatrixDrawDropFeedback
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);
}
开发者ID:sanikoyes,项目名称:iup,代码行数:25,代码来源:iupmat_draw.c
示例16: iupMatrixColResMove
/* Change the column width interactively, just change the line in the screen.
When the user finishes the drag, the iupMatrixColResFinish function is called
to truly change the column width. */
void iupMatrixColResMove(Ihandle* ih, int x)
{
int y1, y2;
int delta = x - ih->data->colres_drag_col_start_x;
int width = ih->data->columns.dt[ih->data->colres_drag_col].size + delta;
if (width < 0)
return;
y1 = ih->data->lines.dt[0].size; /* from the bottom of the line of titles */
y2 = ih->data->h-1; /* to the bottom of the matrix */
cdCanvasWriteMode(ih->data->cdcanvas, CD_XOR);
cdCanvasForeground(ih->data->cdcanvas, ih->data->colres_color);
/* If it is not the first time, move old line */
if (ih->data->colres_drag_col_last_x != -1)
{
cdCanvasLine(ih->data->cdcanvas, ih->data->colres_drag_col_last_x, iupMATRIX_INVERTYAXIS(ih, y1),
ih->data->colres_drag_col_last_x, iupMATRIX_INVERTYAXIS(ih, y2));
}
cdCanvasLine(ih->data->cdcanvas, x, iupMATRIX_INVERTYAXIS(ih, y1),
x, iupMATRIX_INVERTYAXIS(ih, y2));
ih->data->colres_drag_col_last_x = x;
cdCanvasWriteMode(ih->data->cdcanvas, CD_REPLACE);
}
开发者ID:svn2github,项目名称:iup-iup,代码行数:31,代码来源:iupmat_colres.c
示例17: iupMatrixColResFinish
void iupMatrixColResFinish(Ihandle* ih, int x)
{
int delta = x - ih->data->colres_drag_col_start_x;
int width = ih->data->columns.dt[ih->data->colres_drag_col].size + delta;
if (width < 0)
width = 0;
/* delete feedback */
if (ih->data->colres_drag_col_last_x != -1)
{
int y1 = ih->data->lines.dt[0].size; /* from the bottom of the line of titles */
int y2 = ih->data->h-1; /* to the bottom of the matrix */
cdCanvasWriteMode(ih->data->cdcanvas, CD_XOR);
cdCanvasForeground(ih->data->cdcanvas, ih->data->colres_color);
cdCanvasLine(ih->data->cdcanvas, ih->data->colres_drag_col_last_x, iupMATRIX_INVERTYAXIS(ih, y1),
ih->data->colres_drag_col_last_x, iupMATRIX_INVERTYAXIS(ih, y2));
cdCanvasWriteMode(ih->data->cdcanvas, CD_REPLACE);
}
ih->data->colres_dragging = 0;
iupAttribSetIntId(ih, "RASTERWIDTH", ih->data->colres_drag_col, width-IMAT_PADDING_W-IMAT_FRAME_W);
iupAttribSetId(ih, "WIDTH", ih->data->colres_drag_col, NULL);
ih->data->need_calcsize = 1;
iupMatrixDraw(ih, 0);
{
IFni cb = (IFni)IupGetCallback(ih, "COLRESIZE_CB");
if (cb)
cb(ih, ih->data->colres_drag_col);
}
}
开发者ID:svn2github,项目名称:iup-iup,代码行数:34,代码来源:iupmat_colres.c
示例18: width
/* Change the column width interactively, just change the line in the screen.
When the user finishes the drag, the iupMatrixColResFinish function is called
to truly change the column width (x : x mouse coordinate (canvas coordinate)).
*/
void iupMatrixColResMove(Ihandle* ih, int x)
{
int y1, y2, charwidth, charheight;
iupdrvFontGetCharSize(ih, &charwidth, &charheight);
/* If the size column was tiny, no change the size column */
if(x < DragColStartPos + charwidth + IMAT_DECOR_X)
return;
y1 = ih->data->lin.titlewh;
y2 = ih->data->YmaxC;
cdCanvasWriteMode(ih->data->cdcanvas, CD_XOR);
cdCanvasForeground(ih->data->cdcanvas, IMAT_RESIZE_COLOR);
/* If it is not the first time, move old line */
if(Lastxpos != -1)
cdCanvasLine(ih->data->cdcanvas, Lastxpos, (ih->data->YmaxC - (y1)), Lastxpos, (ih->data->YmaxC - (y2)));
cdCanvasLine(ih->data->cdcanvas, x, (ih->data->YmaxC - (y1)), x, (ih->data->YmaxC - (y2)));
Lastxpos = x;
cdCanvasWriteMode(ih->data->cdcanvas, CD_REPLACE);
}
开发者ID:svn2github,项目名称:iup-iup,代码行数:29,代码来源:iupmat_colres.c
示例19: iMatrixDrawSort
static void iMatrixDrawSort(Ihandle* ih, int x2, int y1, int y2, int xc, int lin, int col, char* sort)
{
int yc;
/* Create an space between text and cell margin */
x2 -= IMAT_DECOR_X / 2; xc -= IMAT_DECOR_X / 2;
/* Set the color used to draw the text */
if((lin > 0 && ih->data->lin.inactive[lin-1]) ||
(col > 0 && ih->data->col.inactive[col-1]) ||
!IupGetInt(ih, "ACTIVE"))
cdCanvasForeground(ih->data->cddbuffer, IMAT_CD_INACTIVE_COLOR);
else
iMatrixDrawSetFgColor(ih, lin, col, 0);
yc = (int)( (y1 + y2 ) / 2.0 - .5);
cdCanvasBegin(ih->data->cddbuffer, CD_FILL);
if(iupStrEqualNoCase(sort, "UP"))
{
CdVertex(x2 - 5, yc + 2);
CdVertex(x2 - 1, yc - 2);
CdVertex(x2 - 9, yc - 2);
}
else
{
CdVertex(x2 - 1, yc + 2);
CdVertex(x2 - 9, yc + 2);
CdVertex(x2 - 5, yc - 2);
}
cdCanvasEnd(ih->data->cddbuffer);
}
开发者ID:svn2github,项目名称:iup-iup,代码行数:34,代码来源:iupmat_draw.c
示例20: size
/* Finish the interactive resize of columns. Call ChangeMatrixWidth to truly change
the column size (x : x mouse coordinate (canvas coordinate)).
*/
void iupMatrixColResFinish(Ihandle* ih, int x)
{
int charwidth, charheight, width;
int y1, y2;
iupdrvFontGetCharSize(ih, &charwidth, &charheight);
width = x - DragColStartPos - IMAT_DECOR_X;
if(width < charwidth)
width = charwidth ; /* min size to the cell */
/* delete feedback */
if(Lastxpos != -1)
{
y1 = ih->data->lin.titlewh;
y2 = ih->data->YmaxC;
cdCanvasWriteMode(ih->data->cdcanvas, CD_XOR);
cdCanvasForeground(ih->data->cdcanvas, IMAT_RESIZE_COLOR);
cdCanvasLine(ih->data->cdcanvas, Lastxpos, (ih->data->YmaxC - (y1)), Lastxpos, (ih->data->YmaxC - (y2)));
cdCanvasWriteMode(ih->data->cdcanvas, CD_REPLACE);
}
iMatrixColResChangeMatrixWH(ih, DragCol, width + IMAT_DECOR_X, IMAT_MAT_COL);
Dragging = 0;
}
开发者ID:svn2github,项目名称:iup-iup,代码行数:29,代码来源:iupmat_colres.c
注:本文中的cdCanvasForeground函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论