Ejemplo n.º 1
0
void gStatus::draw() {

	fl_rect(x(), y(), w(), h(), COLOR_BD_0);		          // reset border
	fl_rectf(x()+1, y()+1, w()-2, h()-2, COLOR_BG_0);		  // reset background

	/* same status for wait, ending, ... */

	int waitStat = STATUS_WAIT | STATUS_ENDING | REC_ENDING | REC_WAITING;

	if (G_Mixer.chanStatus[ch] & waitStat) {
		fl_rectf(x()+1, y()+1, w()-2, h()-2, COLOR_BG_2);	// status wait
		fl_rect(x(), y(), w(), h(), COLOR_BD_1);
	}
	else if (G_Mixer.chanStatus[ch] == STATUS_PLAY)
		fl_rect(x(), y(), w(), h(), COLOR_BD_1);
	else
		fl_rectf(x()+1, y()+1, w()-2, h()-2, COLOR_BG_0);     // status empty


	if (G_Mixer.chanInput == ch)
		fl_rectf(x()+1, y()+1, w()-2, h()-2, COLOR_BG_3);	    // take in progress
	else if (recorder::active && recorder::canRec(ch))
		fl_rectf(x()+1, y()+1, w()-2, h()-2, COLOR_BG_4);     // action record

	/* equation for the progress bar:
	 * ((chanTracker - chanStart) * w()) / (chanEnd - chanStart). */

	int mixerPos = G_Mixer.getChanPos(ch);
	if (mixerPos == -1)
		mixerPos = 0;
	else
		mixerPos = (mixerPos * (w()-1)) / (G_Mixer.chanEnd[ch] - G_Mixer.chanStart[ch]);

	fl_rectf(x()+1, y()+1, mixerPos, h()-2, COLOR_BG_2);
}
Ejemplo n.º 2
0
void gStatus::draw() {

	fl_rect(x(), y(), w(), h(), COLOR_BD_0);		          // reset border
	fl_rectf(x()+1, y()+1, w()-2, h()-2, COLOR_BG_0);		  // reset background

	if (ch != NULL) {
		if (ch->status    & (STATUS_WAIT | STATUS_ENDING | REC_ENDING | REC_WAITING) ||
				ch->recStatus & (REC_WAITING | REC_ENDING))
		{
			fl_rect(x(), y(), w(), h(), COLOR_BD_1);
		}
		else
		if (ch->status == STATUS_PLAY)
			fl_rect(x(), y(), w(), h(), COLOR_BD_1);
		else
			fl_rectf(x()+1, y()+1, w()-2, h()-2, COLOR_BG_0);     // status empty


		if (G_Mixer.chanInput == ch)
			fl_rectf(x()+1, y()+1, w()-2, h()-2, COLOR_BG_3);	    // take in progress
		else
		if (recorder::active && recorder::canRec(ch))
			fl_rectf(x()+1, y()+1, w()-2, h()-2, COLOR_BG_4);     // action record

		/* equation for the progress bar:
		 * ((chanTracker - chanStart) * w()) / (chanEnd - chanStart). */

		int pos = ch->getPosition();
		if (pos == -1)
			pos = 0;
		else
			pos = (pos * (w()-1)) / (ch->end - ch->begin);
		fl_rectf(x()+1, y()+1, pos, h()-2, COLOR_BG_2);
	}
}
Ejemplo n.º 3
0
void g_customDownBox(int x, int y, int w, int h, Fl_Color c)
{
  fl_color(c);
  fl_rectf(x, y, w, h);
  fl_color(COLOR_BG_0);
  fl_rect(x, y, w, h);
}
Ejemplo n.º 4
0
void g_customBorderBox(int x, int y, int w, int h, Fl_Color c)
{
  fl_color(c);
  fl_rectf(x, y, w, h);
  fl_color(COLOR_BD_0);
  fl_rect(x, y, w, h);
}
Ejemplo n.º 5
0
void gChoice::draw() {
	fl_rectf(x(), y(), w(), h(), COLOR_BG_0);              // bg
	fl_rect(x(), y(), w(), h(), (Fl_Color) COLOR_BD_0);    // border
	if (angle)
		fl_polygon(x()+w()-8, y()+h()-1, x()+w()-1, y()+h()-8, x()+w()-1, y()+h()-1);

	/* pick up the text() from the selected item (value()) and print it in
	 * the box and avoid overflows */

	fl_color(!active() ? COLOR_BD_0 : COLOR_TEXT_0);
	if (value() != -1) {
		if (fl_width(text(value())) < w()-8) {
			fl_draw(text(value()), x(), y(), w(), h(), FL_ALIGN_CENTER);
		}
		else {
			std::string tmp = text(value());
			int size        = tmp.size();
			while (fl_width(tmp.c_str()) >= w()-16) {
				tmp.resize(size);
				size--;
			}
			tmp += "...";
			fl_draw(tmp.c_str(), x(), y(), w(), h(), FL_ALIGN_CENTER);
		}

	}
}
Ejemplo n.º 6
0
/*
=================================================================
draw_static:	This routine draws the static portions of the LCD,
				such as erasing the background, drawing function
				key labls, etc.
=================================================================
*/
void Fl_Usage_Box::draw()
{
	int c, i;
	int x_pos, y_pos;

	// Draw background
    fl_color(m_backgroundColor);
    fl_rectf(x()+1,y()+1,w()-2,h()-2);

	// Draw frame
	fl_color(FL_BLACK);
	fl_rect(x(),y(), w(), h());

	// Draw usage information
	for (c = 1; c < 256; c++)
	{
		// Test if index greater than max usage entry
		if (c > m_maxUsageEntry)
			break;

		// Selet Color for this usage entry
		fl_color(m_usageColors[c]);

		// "Walk" through the usage map and draw a pixel for each entry with this usage
		for (i = 0; i < m_usageMapSize; i++)
		{
			if (m_pUsageMap[i] == c)
			{
				x_pos = i / (h()-4) + 2;
				y_pos = i % (h()-4) + 2;
				fl_point(x() + x_pos, y() + y_pos);
			}
		}
	}
}
Ejemplo n.º 7
0
void CairoBox::draw(void) 
  {
  // using fltk functions, set up white background with thin black frame
  fl_push_no_clip();            /* remove any clipping region set by the expose events... */
  fl_push_clip(x(), y(), w(), h());
  fl_color(FL_WHITE);
  fl_rectf(x(), y(), w(), h());
  fl_color(FL_BLACK);
  fl_rect(x(), y(), w(), h());

  // set up cairo structures
  surface = set_surface(w(), h());
  cr      = cairo_create(surface);
  /* All Cairo co-ordinates are shifted by 0.5 pixels to correct anti-aliasing */
  cairo_translate(cr, 0.5, 0.5);
  cairo_set_source_rgb(cr, 0.0, 0.0, 0.0); // set drawing color to black
  cairo_new_path(cr);

  // virtual function defined in driver program
  graphic(cr, x(), y(), w(), h());

  // release the cairo context
  cairo_destroy(cr);
  cairo_surface_destroy(surface);
//  cr = NULL;

  // remove clip regions
  fl_pop_clip();                          // local clip region
  fl_pop_clip();                          // "no_clip" region
  }
Ejemplo n.º 8
0
void cairo_box::draw(void)
{
  // using fltk functions, set up white background with thin black frame
  //fl_color(FL_WHITE);
  //fl_rectf(x(), y(), w(), h());
  draw_box();

// Rahmen außenrum?
#if 0
  fl_color(FL_BLACK);
  fl_rect(x(), y(), w(), h());
#endif

  //fl_push_clip(100,100,100,100);
  //fl_color(FL_BLACK);
  //fl_line(1,1,parent()->w(),parent()->h());

  // set up cairo structures
  Fl_Widget *p = this;
  while (p->parent ())
    p = p->parent ();

  //printf ("p=%p\n", p);
  surface = set_surface(p->w(), p->h());
  cr      = cairo_create(surface);
  cairo_set_source_rgb (cr, 0.0, 0.0, 0.0); // set drawing color to black
  cairo_new_path(cr);

  //printf ("x()=%i, y()=%i, w()=%i, h()=%i\n", x(), y(), w(), h());
  cairo_draw ();

  // release the cairo context
  cairo_destroy(cr);
  cairo_surface_destroy(surface);
}
Ejemplo n.º 9
0
	void Binary_tree_rectangle::draw_lines() const{
		if(fill_color().visibility()) {	// fill
			fl_color(fill_color().as_int());

			for(int i = 0; i < number_of_points(); ++i)
				fl_rectf(point(i).x, point(i).y, radius * 2, radius * 2);	// ノード(正方形)を描画

			fl_color(color().as_int());	// reset color
		}

		if(color().visibility()) {
			fl_color(color().as_int());

			int parent = 0;	// point(i)に対する親ノードのインデックス
			for(int i = 0; i < number_of_points(); ++i){
				fl_rect(point(i).x, point(i).y, radius * 2, radius * 2);	// ノード(正方形)を描画

				// エッジ(線)を描画
				if(i != 0){
					fl_line(point(parent).x + radius, point(parent).y + radius * 2, point(i).x + radius, point(i).y);
					if(i % 2 == 0) parent++;
				}
			}
		}
	}
Ejemplo n.º 10
0
void gAction::draw() {

	/* a singlepress action narrower than 8 pixel is useless. So check it.
	 * Warning: if an action is 8 px narrow, it has no body space to drag
	 * it. It's up to the user to zoom in and drag it. */


	if (G_Mixer.chanMode[parent->chan] == SINGLE_PRESS)
		if (w() < MIN_WIDTH)
			w(MIN_WIDTH);


	int color;
	if (selected)  /// && gActionChannel !disabled
		color = COLOR_BD_1;
	else
		color = COLOR_BG_2;

	if (type == ACTION_KILLCHAN)
		fl_rect(x(), y(), w(), h(), (Fl_Color) color);
	else {
		fl_rectf(x(), y(), w(), h(), (Fl_Color) color);
		if (G_Mixer.chanMode[parent->chan] != SINGLE_PRESS) { // don't do that for SINGLE PRESS
			if (type == ACTION_KEYPRESS)
				fl_rectf(x()+3, y()+h()-11, 2, 8, COLOR_BD_0);
			else
			if  (type == ACTION_KEYREL)
				fl_rectf(x()+3, y()+3, 2, 8, COLOR_BD_0);
		}
	}

}
Ejemplo n.º 11
0
void gBeatMeter::draw() {

	int cursorW = (w()/MAX_BEATS);

	fl_rect(x(), y(), w(), h(), COLOR_BD_0);													      // border
	fl_rectf(x()+1, y()+1, w()-2, h()-2, FL_BACKGROUND_COLOR);  						// bg
	fl_rectf(x()+(G_Mixer.actualBeat*cursorW)+3, y()+3, cursorW-5, h()-6, COLOR_BG_2); // cursor

	/* beat cells */

	fl_color(COLOR_BD_0);
	for (int i=1; i<=G_Mixer.beats; i++)
		fl_line(x()+cursorW*i, y()+1, x()+cursorW*i, y()+h()-2);

	/* bar line */

	fl_color(COLOR_BG_2);
	int delta = G_Mixer.beats / G_Mixer.bars;
	for (int i=1; i<G_Mixer.bars; i++)
		fl_line(x()+cursorW*(i*delta), y()+1, x()+cursorW*(i*delta), y()+h()-2);

	/* unused grey area */

	fl_rectf(x()+(G_Mixer.beats*cursorW)+1, y()+1, ((MAX_BEATS-G_Mixer.beats)*cursorW)-1, h()-2, COLOR_BG_1);
}
Ejemplo n.º 12
0
void gModeBox::draw() {
	fl_rect(x(), y(), w(), h(), COLOR_BD_0);		// border
	switch (ch->mode) {
		case LOOP_BASIC:
			fl_draw_pixmap(loopBasic_xpm, x()+1, y()+1);
			break;
		case LOOP_ONCE:
			fl_draw_pixmap(loopOnce_xpm, x()+1, y()+1);
			break;
		case LOOP_ONCE_BAR:
			fl_draw_pixmap(loopOnceBar_xpm, x()+1, y()+1);
			break;
		case LOOP_REPEAT:
			fl_draw_pixmap(loopRepeat_xpm, x()+1, y()+1);
			break;
		case SINGLE_BASIC:
			fl_draw_pixmap(oneshotBasic_xpm, x()+1, y()+1);
			break;
		case SINGLE_PRESS:
			fl_draw_pixmap(oneshotPress_xpm, x()+1, y()+1);
			break;
		case SINGLE_RETRIG:
			fl_draw_pixmap(oneshotRetrig_xpm, x()+1, y()+1);
			break;
		case SINGLE_ENDLESS:
			fl_draw_pixmap(oneshotEndless_xpm, x()+1, y()+1);
			break;
	}
}
Ejemplo n.º 13
0
void gRadio::draw() {

	int color = !active() ? FL_INACTIVE_COLOR : COLOR_BD_0;

	if (value()) {
		fl_rect(x(), y(), 12, 12, (Fl_Color) color);
		fl_rectf(x(), y(), 12, 12, (Fl_Color) color);
	}
	else {
		fl_rectf(x(), y(), 12, 12, FL_BACKGROUND_COLOR);
		fl_rect(x(), y(), 12, 12, (Fl_Color) color);
	}

	fl_rectf(x()+20, y(), w(), h(), FL_BACKGROUND_COLOR);  // clearer
	fl_font(FL_HELVETICA, 11);
	fl_color(COLOR_TEXT_0);
	fl_draw(label(), x()+20, y(), w(), h(), (Fl_Align) (FL_ALIGN_LEFT | FL_ALIGN_TOP));
}
Ejemplo n.º 14
0
// Draw a feature.  Currently, this just draws a green box for selected
// features, and a red box for unselected features.
void Feature::draw() const {
	if (selected) {
		fl_color(FL_GREEN);
	}
	else {
		fl_color(FL_RED);
	}

	fl_rect(x-3, y-3, 7, 7);
}
Ejemplo n.º 15
0
void roc_box_draw(int x, int y, int w, int h, Fl_Color bgcolor) {

  fl_color(draw_it_active ? FL_BLACK : fl_inactive(FL_BLACK));
  fl_rect(x, y, w, h);
  fl_color(draw_it_active ? bgcolor : fl_inactive(bgcolor));
  fl_rectf(x + 1, y + 1, w - 2, h - 2);
  fl_color(draw_it_active ? FL_BLACK : fl_inactive(FL_BLACK));
  fl_line(x, y, x + w - 1, y + h - 1);
  fl_line(x, y + h - 1, x + w - 1, y);

}
Ejemplo n.º 16
0
  void Rectangle::draw_lines() const
{
    if (fill_color().visibility()) {    // fill
      fl_color(fill_color().as_int());
      fl_rectf(point(0).x,point(0).y,w,h);
    }

    if (color().visibility()) {    // lines on top of fill
      fl_color(color().as_int());
      fl_rect(point(0).x,point(0).y,w,h);
    }
}
void Fl_Envelope::Fl_Handle::draw()
{
	if (m_Coincident)
	{
		fl_color(FL_BLACK);
		fl_rect(x(),y(),w()+1,h()+1);
		fl_line(x(),y(),x()+w(),y()+h());
		fl_line(x(),y()+h(),x()+w(),y());		
	}
	else
	{
		fl_color(FL_RED);
		fl_arc(	x(),y(),w()+1,h()+1,0,360);
	}
}
Ejemplo n.º 18
0
void Fl_Canvas::DrawSelection()
{
	if (m_Selecting)
	{
		int X, Y, W, H;

		fl_color(FL_YELLOW);

		X = min(m_StartSelectX, m_EndSelectX);
		Y = min(m_StartSelectY, m_EndSelectY);
		W = max(m_StartSelectX, m_EndSelectX) - X;
		H = max(m_StartSelectY, m_EndSelectY) - Y;

		fl_rect(X-1, Y-1, W+2, H+2);
	}
}
Ejemplo n.º 19
0
void Fl_Shadow_Box::draw(
    int x, int y, int w, int h, Fl_Color color, Fl_Flags f) const
{
    w-=BW;
    h-=BW;
    if (!(f & FL_INVISIBLE))
    {
        fl_color(color);
        fl_rectf(x+1,y+1,w-2,h-2);
    }
    fl_color(FL_DARK3);
    fl_rectf(x+BW, y+h,  w, BW);
    fl_rectf(x+w,  y+BW, BW,  h);
    fl_color(fl_inactive(FL_BLACK,f));
    fl_rect(x,y,w,h);
}
Ejemplo n.º 20
0
void gActionWidget::baseDraw(bool clear) {

	/* clear the screen */

	if (clear)
		fl_rectf(x(), y(), w(), h(), COLOR_BG_MAIN);

	/* draw the container */

	fl_color(COLOR_BD_0);
	fl_rect(x(), y(), w(), h());

	/* grid drawing, if > 1 */

	if (pParent->gridTool->getValue() > 1) {

		fl_color(fl_rgb_color(54, 54, 54));
		fl_line_style(FL_DASH, 0, NULL);

		for (int i=0; i<(int) pParent->gridTool->points.size; i++) {
			int px = pParent->gridTool->points.at(i)+x()-1;
			fl_line(px, y()+1, px, y()+h()-2);
		}
		fl_line_style(0);
	}

	/* bars and beats drawing */

	fl_color(COLOR_BD_0);
	for (int i=0; i<(int) pParent->gridTool->beats.size; i++) {
		int px = pParent->gridTool->beats.at(i)+x()-1;
		fl_line(px, y()+1, px, y()+h()-2);
	}

	fl_color(COLOR_BG_2);
	for (int i=0; i<(int) pParent->gridTool->bars.size; i++) {
		int px = pParent->gridTool->bars.at(i)+x()-1;
		fl_line(px, y()+1, px, y()+h()-2);
	}

	/* cover unused area. Avoid drawing cover if width == 0 (i.e. beats
	 * are 32) */

	int coverWidth = pParent->totalWidth-pParent->coverX;
	if (coverWidth != 0)
		fl_rectf(pParent->coverX+x(), y()+1, coverWidth, h()-2, COLOR_BG_1);
}
Ejemplo n.º 21
0
void gActionWidget::baseDraw(bool clear) {

	

	if (clear)
		fl_rectf(x(), y(), w(), h(), COLOR_BG_MAIN);

	

	fl_color(COLOR_BD_0);
	fl_rect(x(), y(), w(), h());

	

	if (pParent->gridTool->getValue() > 1) {

		fl_color(fl_rgb_color(54, 54, 54));
		fl_line_style(FL_DASH, 0, NULL);

		for (int i=0; i<(int) pParent->gridTool->points.size(); i++) {
			int px = pParent->gridTool->points.at(i)+x()-1;
			fl_line(px, y()+1, px, y()+h()-2);
		}
		fl_line_style(0);
	}

	

	fl_color(COLOR_BD_0);
	for (int i=0; i<(int) pParent->gridTool->beats.size(); i++) {
		int px = pParent->gridTool->beats.at(i)+x()-1;
		fl_line(px, y()+1, px, y()+h()-2);
	}

	fl_color(COLOR_BG_2);
	for (int i=0; i<(int) pParent->gridTool->bars.size(); i++) {
		int px = pParent->gridTool->bars.at(i)+x()-1;
		fl_line(px, y()+1, px, y()+h()-2);
	}

	

	int coverWidth = pParent->totalWidth-pParent->coverX;
	if (coverWidth != 0)
		fl_rectf(pParent->coverX+x(), y()+1, coverWidth, h()-2, COLOR_BG_1);
}
Ejemplo n.º 22
0
void Icon::draw()
{
    Fl_Flags f=0;
    Fl_Image *im = icon_im;
    if(focused()) {
        f=FL_SELECTED;
    }

    if(im)
        im->draw(0, 0, w(), h(),f);
    else {
        fl_color(FL_RED);
        fl_rect(0,0,w(),h());
        fl_color(FL_BLACK);
        fl_rectf(1,1,w()-2,h()-2);
        fl_color(FL_WHITE);
        fl_font(label_font()->bold(), 10);
        fl_draw("NO ICON FOUND!", 1, 1, w()-2, h()-2, FL_ALIGN_TOP|FL_ALIGN_LEFT|FL_ALIGN_WRAP);
    }

    int X = w()-(w()/2)-(lwidth/2);
    int Y = h()+2;

    if(!label_trans) {
        fl_color(label_background);
        fl_rectf(X,Y,lwidth,lheight);
    }

    if(focused()) {
        focus_box()->draw(X, Y, lwidth, lheight, color(), 0);
    }

    fl_font(label_font(), label_size());

    // A little shadow, from Dejan's request :)
    // SUCKS!
    /*fl_color(fl_darker(label_color()));
    fl_draw(label(), X-1, Y+1, lwidth, lheight, flags());
    fl_draw(label(), X, Y+1, lwidth, lheight, flags());
    */

    fl_color(label_color());
    fl_draw(label(), X, Y, lwidth, lheight, flags());
}
Ejemplo n.º 23
0
static void
frame_label_draw(const Fl_Label* o, int X, int Y, int W, int H, Fl_Align align)
{
  Frame* f = (Frame*)(o->value);
  if (window_deleted(f)) return;
  fl_draw_box(FL_THIN_DOWN_BOX, X, Y, MENU_ICON_W, MENU_ICON_H, FL_GRAY);
  for (Frame* c = Frame::first; c; c = c->next) {
    if (c->state() != UNMAPPED && (c==f || c->is_transient_for(f))) {
      int x = ((c->x()-Root->x())*SCREEN_W+Root->w()/2)/Root->w();
      int w = (c->w()*SCREEN_W+Root->w()-1)/Root->w();
      if (w > SCREEN_W) w = SCREEN_W;
      if (w < 3) w = 3;
      if (x+w > SCREEN_W) x = SCREEN_W-w;
      if (x < 0) x = 0;
      int y = ((c->y()-Root->y())*SCREEN_H+Root->h()/2)/Root->h();
      int h = (c->h()*SCREEN_H+Root->h()-1)/Root->h();
      if (h > SCREEN_H) h = SCREEN_H;
      if (h < 3) h = 3;
      if (y+h > SCREEN_H) y = SCREEN_H-h;
      if (y < 0) y = 0;
      fl_color(FL_FOREGROUND_COLOR);
      if (c->state() == ICONIC)
	fl_rect(X+x+SCREEN_DX, Y+y+SCREEN_DX, w, h);
      else
	fl_rectf(X+x+SCREEN_DX, Y+y+SCREEN_DX, w, h);
    }
  }
  fl_font(o->font, o->size);
  fl_color((Fl_Color)o->color);
  const char* l = f->label(); if (!l) l = "unnamed";
  // double any ampersands to turn off the underscores:
  char buf[256];
  if (strchr(l,'&')) {
    char* t = buf;
    while (t < buf+254 && *l) {
      if (*l=='&') *t++ = *l;
      *t++ = *l++;
    }
    *t = 0;
    l = buf;
  }
  fl_draw(l, X+MENU_ICON_W+3, Y, W-MENU_ICON_W-3, H, align);
}
Ejemplo n.º 24
0
void gClickRepeat::draw() {
	if (value()) {															 // -- clicked
		fl_rectf(x(), y(), w(), h(), COLOR_BG_1);  // bg
		if (imgOn != NULL)
			fl_draw_pixmap(imgOn, x()+1, y()+1);
	}
	else {                                       // -- not clicked
		fl_rectf(x(), y(), w(), h(), COLOR_BG_0);  // bg
		fl_rect(x(), y(), w(), h(), COLOR_BD_0);   // border
		if (imgOff != NULL)
			fl_draw_pixmap(imgOff, x()+1, y()+1);
	}
	if (!active())
		fl_color(FL_INACTIVE_COLOR);

	fl_color(COLOR_TEXT_0);
	fl_font(FL_HELVETICA, 11);
	fl_draw(label(), x(), y(), w(), h(), FL_ALIGN_CENTER);
}
Ejemplo n.º 25
0
void Icon::draw(void)
{
	Fl_Flags f = 0;
    if(is_focused()) 
		f = FL_SELECTED;

	if(icon_img)
		icon_img->draw(0, 0, w(), h(),f);
	else
	{
		fl_color(FL_RED);
		fl_rect(0,0,w(),h());
		fl_color(FL_BLACK);
		fl_rectf(1,1,w()-2,h()-2);
		fl_color(FL_WHITE);
		fl_font(label_font()->bold(), 10);
		fl_draw(_("NO ICON FOUND!"), 1, 1, w()-2, h()-2, FL_ALIGN_TOP|FL_ALIGN_LEFT|FL_ALIGN_WRAP);
		return;
	}

	if(globals->label_draw)
	{
    	int X = w()-(w()/2)-(lwidth/2);
		int Y = h()+2;
		if(!globals->label_transparent) 
		{
        	fl_color(globals->label_background);
			fl_rectf(X,Y,lwidth,lheight);
		}

    	if(is_focused())
			focus_box()->draw(X, Y, lwidth, lheight, color(), 0);

    	fl_font(label_font(), label_size());
		fl_color(label_color());
		fl_draw(label(), X, Y, lwidth, lheight, flags());
    }
}
Ejemplo n.º 26
0
void gModeBox::draw() {
	fl_rect(x(), y(), w(), h(), COLOR_BD_0);		// border
	switch (G_Mixer.chanMode[id]) {
		case LOOP_BASIC:
			fl_draw_pixmap(loopBasic_xpm, x()+1, y()+1);
			break;
		case LOOP_ONCE:
			fl_draw_pixmap(loopOnce_xpm, x()+1, y()+1);
			break;
		case LOOP_REPEAT:
			fl_draw_pixmap(loopRepeat_xpm, x()+1, y()+1);
			break;
		case SINGLE_BASIC:
			fl_draw_pixmap(oneshotBasic_xpm, x()+1, y()+1);
			break;
		case SINGLE_PRESS:
			fl_draw_pixmap(oneshotPress_xpm, x()+1, y()+1);
			break;
		case SINGLE_RETRIG:
			fl_draw_pixmap(oneshotRetrig_xpm, x()+1, y()+1);
			break;
	}
}
Ejemplo n.º 27
0
void gSoundMeter::draw() {

	fl_rect(x(), y(), w(), h(), COLOR_BD_0);

	/* peak = the highest value inside the frame */

	peak = 0.0f;
	float tmp_peak = 0.0f;

	tmp_peak = fabs(mixerPeak);
	if (tmp_peak > peak)
		peak = tmp_peak;

	clip = peak >= 1.0f ? true : false; // 1.0f is considered clip


	/*  dBFS (full scale) calculation, plus decay of -2dB per frame */

	db_level = 20 * log10(peak);
	if (db_level < db_level_old)
		if (db_level_old > -DB_MIN_SCALE)
			db_level = db_level_old - 2.0f;

	db_level_old = db_level;

	/* graphical part */

	float px_level = 0.0f;
	if (db_level < 0.0f)
		px_level = ((w()/DB_MIN_SCALE) * db_level) + w();
	else
		px_level = w();

	fl_rectf(x()+1, y()+1, w()-2, h()-2, COLOR_BG_0);
	fl_rectf(x()+1, y()+1, (int) px_level, h()-2, clip || !G_audio_status ? COLOR_ALERT : COLOR_BD_0);
}
Ejemplo n.º 28
0
void gClick::draw() {

	if (!active()) txtColor = bdColor;
	else 					 txtColor = COLOR_TEXT_0;

	fl_rect(x(), y(), w(), h(), bdColor);             // borders
	if (value()) {													          // -- clicked
		if (imgOn != NULL)
			fl_draw_pixmap(imgOn, x()+1, y()+1);
		else
			fl_rectf(x(), y(), w(), h(), bgColor1);       // covers the border
	}
	else {                                            // -- not clicked
		fl_rectf(x()+1, y()+1, w()-2, h()-2, bgColor0); // bg inside the border
		if (imgOff != NULL)
			fl_draw_pixmap(imgOff, x()+1, y()+1);
	}
	if (!active())
		fl_color(FL_INACTIVE_COLOR);

	fl_color(txtColor);
	fl_font(FL_HELVETICA, 11);
	fl_draw(label(), x(), y(), w(), h(), FL_ALIGN_CENTER);
}
Ejemplo n.º 29
0
void ItemTableView::draw_cell(TableContext context,
	int r, int c, int x, int y, int w, int h
) {
	static char s[(NAME_LENGTH+1)];
	memset(s, 0x00, (NAME_LENGTH+1)*sizeof(char));

	_ITEM_TABLE* item = NULL;

	switch(context) {
		case CONTEXT_STARTPAGE:
			fl_font(FL_HELVETICA, 16);
			return;
		case CONTEXT_COL_HEADER:
			switch(c) {
				case 0: strcpy(s, "Filename"); break;
				//case 0: strcpy(s, "Num");     break;
				//case 1: strcpy(s, "strName"); break;
			}

			fl_push_clip(x, y, w, h);
			{
				fl_draw_box(FL_THIN_UP_BOX, x, y, w, h, col_header_color());
				fl_color(FL_BLACK);
				fl_draw(s, x, y, w, h, FL_ALIGN_CENTER);
			}
			fl_pop_clip();
			return;
		case CONTEXT_ROW_HEADER:
			sprintf(s, "%d", r+1);

			fl_push_clip(x, y, w, h);
			{
				fl_draw_box(FL_THIN_UP_BOX, x, y, w, h, row_header_color());
				fl_color(FL_BLACK);
				fl_draw(s, x, y, w, h, FL_ALIGN_CENTER);
			}
			fl_pop_clip();
			return;
		case CONTEXT_CELL:
			switch(c) {
				case 0: sprintf(s, "%s", disp_files[r]); break;
			}
			/*
			item = ItemTableMap.GetData(r);
			switch(c) {
				case 0: sprintf(s, "  %d", item->m_iNum);  break;
				case 1: sprintf(s, "  %s", item->m_sName); break;
			}
			*/

			fl_push_clip(x, y, w, h);
			{
				fl_color(row_selected(r) ? selection_color() : cell_bgcolor);
				fl_rectf(x, y, w, h);
				fl_color(cell_fgcolor);
				fl_draw(s, x, y, w, h, FL_ALIGN_LEFT);
				fl_color(color());
				fl_rect(x, y, w, h);
			}
			fl_pop_clip();
			return;
		case CONTEXT_TABLE:
			printf("Table Context Called?\n");
			return;
		case CONTEXT_ENDPAGE:
		case CONTEXT_RC_RESIZE:
		case CONTEXT_NONE:
			return;
	}
}
Ejemplo n.º 30
0
void gDrawBox(int x, int y, int w, int h, Fl_Color c) {
	fl_color(c);
  fl_rectf(x, y, w, h);
  fl_color(COLOR_BD_0);
  fl_rect(x, y, w, h);
}