示例#1
0
int
d_abitmap_slider_proc (int msg, DIALOG *d, int c)
{

	if (msg == MSG_DRAW) {
		abitmap_draw_slider (d);

		return D_O_K;
	}

	return d_slider_proc (msg, d, c);
}
示例#2
0
文件: agtk.c 项目: ufaith/d2imdev
int d_agtk_slider_proc(int msg, DIALOG *d, int c)
{
    if (msg == MSG_DRAW) {
        BITMAP *bmp = gui_get_screen();
        int vert = TRUE;    /* flag: is slider vertical? */
        int hh = 32;        /* handle height (width for horizontal sliders) */
        int slp;            /* slider position */
        int irange;
        int slx, sly, slh, slw;
        fixed slratio, slmax, slpos;

        /* check for slider direction */
        if (d->h < d->w)
            vert = FALSE;

        irange = (vert) ? d->h : d->w;
        slmax = itofix(irange-hh);
        slratio = slmax / (d->d1);
        slpos = slratio * d->d2;
        slp = fixtoi(slpos);

        /* draw background */
        gtk_box(bmp, d->x, d->y, d->w, d->h, 2, 0);

        /* now draw the handle */
        if (vert) {
            slx = d->x+2;
            sly = d->y+2+(d->h)-(hh+slp);
            slw = d->w-1-3;
            slh = hh-1-3;
        } else {
            slx = d->x+2+slp;
            sly = d->y+2;
            slw = hh-1-3;
            slh = d->h-1-3;
        }

        gtk_box(bmp, slx, sly, slw, slh, (d->flags & D_GOTFOCUS) ? 1 : 0, 0);

        return D_O_K;
    }

    return d_slider_proc(msg, d, c);
}
示例#3
0
文件: ex30.c 项目: Grumbel/vect
/* gui object procedure for the color selection sliders */
int my_slider_proc(int msg, DIALOG *d, int c)
{
   int *color = (int *)d->dp3;

   switch (msg) {

      case MSG_START:
	 /* initialise the slider position */
	 d->d2 = *color;
	 break;

      case MSG_IDLE:
	 /* has the slider position changed? */
	 if (d->d2 != *color) {
	    d->d2 = *color;
	    show_mouse(NULL);
	    SEND_MESSAGE(d, MSG_DRAW, 0);
	    show_mouse(screen);
	 }
	 break;
   }

   return d_slider_proc(msg, d, c);
}
示例#4
0
文件: aphoton.c 项目: Fomka/ufo2000
int d_aphoton_slider_proc(int msg, DIALOG *d, int c)
{
    if (msg == MSG_DRAW) {
	int vert = TRUE;    /* flag: is slider vertical? */
	int slp;            /* slider position */
	int irange, inmark, ismark, i;
	fixed slratio, slmax, slpos;

	/* check for slider direction */
	if (d->h < d->w)
	    vert = FALSE;

	irange = (vert ? d->h-2 : d->w-2);
	inmark = irange/MSPACE;
	ismark = irange/inmark;
	slmax = itofix(irange - HHEIGHT);
	slratio = slmax / (d->d1);
	slpos = slratio * d->d2;
	slp = 1+fixtoi(slpos);

        rectfillwh(screen, d->x, d->y, d->w, d->h, normal);

        if (vert) {
           vline(screen, d->x+d->w/2-3, d->y+1, d->y+d->h-2, check_gray2);
           vline(screen, d->x+d->w/2-2, d->y+1, d->y+d->h-2, slider_gray2);
           vline(screen, d->x+d->w/2-1, d->y+1, d->y+d->h-2, slider_gray1);
           vline(screen, d->x+d->w/2+0, d->y+1, d->y+d->h-2, container_black);
           vline(screen, d->x+d->w/2+1, d->y+1, d->y+d->h-2, slider_white1);
           hline(screen, d->x+d->w/2-1, d->y, d->x+d->w/2+0, slider_gray2);
           hline(screen, d->x+d->w/2-1, d->y+d->h-1, d->x+d->w/2+0, slider_gray2);
           
           /* marks */
           for (i=0; i<inmark; i++)
              photon_slider_mark(screen, d->x+d->w-3, d->y+1 + i*ismark);
           
           photon_slider_mark(screen, d->x+d->w-3, d->y+d->h-2);

	   photon_slider_cursor(screen, d->x, d->y+d->h-slp-HHEIGHT, d->w, HHEIGHT, TRUE);
	}
        else {
           /* support */
           hline(screen, d->x+1, d->y+d->h/2-3, d->x+d->w-2, check_gray2);
           hline(screen, d->x+1, d->y+d->h/2-2, d->x+d->w-2, slider_gray2);
           hline(screen, d->x+1, d->y+d->h/2-1, d->x+d->w-2, slider_gray1);
           hline(screen, d->x+1, d->y+d->h/2+0, d->x+d->w-2, container_black);
           hline(screen, d->x+1, d->y+d->h/2+1, d->x+d->w-2, slider_white1);
           vline(screen, d->x, d->y+d->h/2-1, d->y+d->h/2+0, slider_gray2);
           vline(screen, d->x+d->w-1, d->y+d->h/2-1, d->y+d->h/2+0, slider_gray2);
           
           /* marks */
           for (i=0; i<inmark; i++)
              photon_slider_mark(screen, d->x+1 + i*ismark, d->y+d->h-3);
           
           photon_slider_mark(screen, d->x+d->w-2, d->y+d->h-3);
           
	   photon_slider_cursor(screen, d->x+slp, d->y, HHEIGHT, d->h, FALSE);
        }
	
	return D_O_K;
    }
    
    return d_slider_proc(msg, d, c);
}
示例#5
0
文件: aase.c 项目: Fomka/ufo2000
int d_aase_slider_proc(int msg, DIALOG *d, int c)
{
  return d_slider_proc(msg, d, c);
}