//# MENU nick setBGcolor void doColorBG(void){ GLOBAL(nickbg)=colorpicker("Background:", GLOBAL(nickbg)); saveConfig(); getInputWaitRelease(); }
gint button_press_event( GtkWidget *widget, GdkEventButton *event ) { modified=1; if (event->button == 1 && pixmap != NULL) switch(tool) { case RECT_SEL: gdk_draw_drawable(undomap,fg_gc,pixmap,0,0,0,0,-1,-1); pre_x=event->x; pre_y=event->y; select_rectangular_region(widget,event->x,event->y,1); last_x=event->x; last_y=event->y; break; case ERASER: gdk_draw_drawable(undomap,fg_gc,pixmap,0,0,0,0,-1,-1); last_x=event->x; last_y=event->y; eraser(widget,event->x,event->y); break; case LINE: gdk_draw_drawable(undomap,fg_gc,pixmap,0,0,0,0,-1,-1); pre_x=event->x; pre_y=event->y; draw_line(widget,event->x,event->y,0); last_x=event->x; last_y=event->y; break; case TEXT: gdk_draw_drawable(undomap,fg_gc,pixmap,0,0,0,0,-1,-1); draw_text(widget,event->x,event->y); break; case BRUSH:gdk_draw_drawable(undomap,fg_gc,pixmap,0,0,0,0,-1,-1); last_x=event->x; last_y=event->y; paintbrush(widget,event->x,event->y); break; case SPRAYCAN:gdk_draw_drawable(undomap,fg_gc,pixmap,0,0,0,0,-1,-1); last_x=event->x; last_y=event->y; spraycan(widget,event->x,event->y); break; case PENCIL:gdk_draw_drawable(undomap,fg_gc,pixmap,0,0,0,0,-1,-1); last_x=event->x; last_y=event->y; draw_using_pencil(widget,event->x,event->y); break; case BUCKET: bucketfill(widget,event->x,event->y); break; case COLORPICK: gdk_gc_copy(undo_gc,fg_gc); undoflag=1; colorpicker(widget,event->x,event->y); break; case POLYLINE:if(!poly) {pre_x=event->x; pre_y=event->y; poly++;} draw_polyline(widget,event->x,event->y,1); break; case ELLIPSE:gdk_draw_drawable(undomap,fg_gc,pixmap,0,0,0,0,-1,-1); pre_x=event->x; pre_y=event->y; draw_arc(widget,event->x,event->y,0); last_x=event->x; last_y=event->y; break; case POLYGON:if(!poly) { pre_x=event->x; pre_y=event->y; last_x=event->x; last_y=event->y; poly++; } draw_polygon(widget,event->x,event->y,1); break; case RECTANGLE:gdk_draw_drawable(undomap,fg_gc,pixmap,0,0,0,0,-1,-1); pre_x=event->x; pre_y=event->y; draw_rectangle(widget,event->x,event->y,0); last_x=event->x; last_y=event->y; break; } return TRUE; }
//# MENU nick setFGcolor void doColorFG(void){ GLOBAL(nickfg)=colorpicker("Foreground:", GLOBAL(nickfg)); saveConfig(); getInputWaitRelease(); }