Пример #1
0
// draw lines connecting pairs of points
void Lines::draw_lines() const
{
    if (color().visibility())
        for (int i=1; i<number_of_points(); i+=2)
            fl_line(point(i-1).x,point(i-1).y,point(i).x,point(i).y);
}
Пример #2
0
void EnvelopeFreeEdit::draw(void)
{
    int ox=x(),oy=y(),lx=w(),ly=h();
    //if (env->Pfreemode==0)
    //    env->converttofree();
    const int npoints=Penvpoints;

    if (active_r()) fl_color(FL_BLACK);
    else fl_color(90,90,90);
    if (!active_r()) currentpoint=-1;

    fl_rectf(ox,oy,lx,ly);

    //Margins
    ox+=5;oy+=5;lx-=10;ly-=10;

    //draw the lines
    fl_color(FL_GRAY);

    fl_line_style(FL_SOLID);
    fl_line(ox+2,oy+ly/2,ox+lx-2,oy+ly/2);

    //draws the evelope points and lines
    Fl_Color alb=FL_WHITE;
    if (!active_r()) alb=fl_rgb_color(180,180,180);
    fl_color(alb);
    int oldxx=0,xx=0,oldyy=0,yy=getpointy(0);
    fl_rectf(ox-3,oy+yy-3,6,6);
    for (int i=1; i<npoints; ++i){
        oldxx=xx;oldyy=yy;
        xx=getpointx(i);yy=getpointy(i);
        if (i==currentpoint || (ctrldown && i==lastpoint))
            fl_color(FL_RED);
        else
            fl_color(alb);
        fl_line(ox+oldxx,oy+oldyy,ox+xx,oy+yy);
        fl_rectf(ox+xx-3,oy+yy-3,6,6);
    }

    //draw the last moved point point (if exists)
    if (lastpoint>=0){
        fl_color(FL_CYAN);
        fl_rectf(ox+getpointx(lastpoint)-5,oy+getpointy(lastpoint)-5,10,10);
    }

    //draw the sustain position
    if(Penvsustain>0){
        fl_color(FL_YELLOW);
        xx=getpointx(Penvsustain);
        fl_line(ox+xx,oy+0,ox+xx,oy+ly);
    }

    //Show the envelope duration and the current line duration
    fl_font(FL_HELVETICA|FL_BOLD,10);
    float time=0.0;
    if (currentpoint<=0 && (!ctrldown||lastpoint <= 0)){
        fl_color(alb);
        for(int i=1; i<npoints; ++i)
            time+=getdt(i);
    } else {
        fl_color(FL_RED);
        time=getdt(lastpoint);
    }
    char tmpstr[20];
    if (time<1000.0)
        snprintf((char *)&tmpstr,20,"%.1fms",time);
    else
        snprintf((char *)&tmpstr,20,"%.2fs",time/1000.0);
    fl_draw(tmpstr,ox+lx-20,oy+ly-10,20,10,FL_ALIGN_RIGHT,NULL,0);
    if (lastpoint>=0){
        snprintf((char *)&tmpstr,20,"%d", Penvval[lastpoint]);
        fl_draw(tmpstr,ox+lx-20,oy+ly-23,20,10,FL_ALIGN_RIGHT,NULL,0);
    }
}
Пример #3
0
void Shape::draw_lines() const
{
    if (color().visibility() && 1<points.size())    // draw sole pixel?
        for (unsigned int i=1; i<points.size(); ++i)
            fl_line(points[i-1].x,points[i-1].y,points[i].x,points[i].y);
}
Пример #4
0
void Gate::draw_OR_gate(Point& ul) const{
    fl_arc(ul.x,ul.y-(.6*SCALE)/2,.8*SCALE,.9*SCALE,180,360);
    fl_arc(ul.x,ul.y-(.6*SCALE)/2,.8*SCALE,.6*SCALE,180,360);
    fl_line(ul.x+(.8*SCALE)/4,ul.y,ul.x+(.8*SCALE)/4,ul.y+(.6*SCALE)/3);
    fl_line(ul.x+3*(.8*SCALE)/4,ul.y,ul.x+3*(.8*SCALE)/4,ul.y+(.6*SCALE)/3);
}
Пример #5
0
void Gate::draw_NOT_gate(Point& ul) const{
    fl_line(ul.x,ul.y,ul.x+(.8*SCALE),ul.y);
    fl_line(ul.x+(.8*SCALE),ul.y,ul.x+(.8*SCALE)/2,ul.y+(.6*SCALE));
    fl_line(ul.x+(.8*SCALE)/2,ul.y+(.6*SCALE),ul.x,ul.y);
    fl_circle(ul.x+(.8*SCALE)/2,ul.y+(.6*SCALE), SCALE/10);
}
Пример #6
0
void Fl_Roller::draw()
{
    if (damage()&(FL_DAMAGE_ALL|FL_DAMAGE_HIGHLIGHT)) draw_box();
    int X=0; int Y=0; int W=w(); int H=h(); box()->inset(X,Y,W,H);
    if (W<=0 || H<=0) return;

    double s = step();
    if (!s) s = (maximum()-minimum())/100;
    int offset = int(value()/s);

    const double ARC = 1.5;      // 1/2 the number of radians visible
    const double delta = .2;     // radians per knurl
    if (type()==HORIZONTAL)
    {
        // draw shaded ends of wheel:
        int h1 = W/4+1;          // distance from end that shading starts
        fl_color(button_color()); fl_rectf(X+h1,Y,W-2*h1,H);
        for (int i=0; h1; i++)
        {
            fl_color((Fl_Color)(FL_GRAY-i-1));
            int h2 = FL_GRAY-i-1 > FL_DARK3 ? 2*h1/3+1 : 0;
            fl_rectf(X+h2,Y,h1-h2,H);
            fl_rectf(X+W-h1,Y,h1-h2,H);
            h1 = h2;
        }
        if (active_r())
        {
            // draw ridges:
            double junk;
            for (double y = -ARC+modf(offset*sin(ARC)/(W/2)/delta,&junk)*delta;;
                    y += delta)
            {
                int y1 = int((sin(y)/sin(ARC)+1)*W/2);
                if (y1 <= 0) continue; else if (y1 >= W-1) break;
                fl_color(FL_DARK3); fl_line(X+y1,Y+1,X+y1,Y+H-1);
                if (y < 0) y1--; else y1++;
                fl_color(FL_LIGHT1);fl_line(X+y1,Y+1,X+y1,Y+H-1);
            }
            // draw edges:
            h1 = W/8+1;          // distance from end the color inverts
            fl_color(FL_DARK2);
            fl_line(X+h1,Y+H-1,X+W-h1,Y+H-1);
            fl_color(FL_DARK3);
            fl_line(X,Y+H,X,Y);
            fl_line(X,Y,X+h1,Y);
            fl_line(X+W-h1,Y,X+W,Y);
            fl_color(FL_LIGHT2);
            fl_line(X+h1,Y,X+W-h1,Y);
            fl_line(X+W,Y,X+W,Y+H);
            fl_line(X+W,Y+H,X+W-h1,Y+H);
            fl_line(X+h1,Y+H,X,Y+H);
        }
    }                            // vertical one
    else
    {
        offset = (1-offset);
        // draw shaded ends of wheel:
        int h1 = H/4+1;          // distance from end that shading starts
        fl_color(button_color()); fl_rectf(X,Y+h1,W,H-2*h1);
        for (int i=0; h1; i++)
        {
            fl_color((Fl_Color)(FL_GRAY-i-1));
            int h2 = FL_GRAY-i-1 > FL_DARK3 ? 2*h1/3+1 : 0;
            fl_rectf(X,Y+h2,W,h1-h2);
            fl_rectf(X,Y+H-h1,W,h1-h2);
            h1 = h2;
        }
        if (active_r())
        {
            // draw ridges:
            double junk;
            for (double y = -ARC+modf(offset*sin(ARC)/(H/2)/delta,&junk)*delta;
                    ; y += delta)
            {
                int y1 = int((sin(y)/sin(ARC)+1)*H/2);
                if (y1 <= 0) continue; else if (y1 >= H-1) break;
                fl_color(FL_DARK3); fl_line(X+1,Y+y1,X+W-1,Y+y1);
                if (y < 0) y1--; else y1++;
                fl_color(FL_LIGHT1);fl_line(X+1,Y+y1,X+W-1,Y+y1);
            }
            // draw edges:
            h1 = H/8+1;          // distance from end the color inverts
            fl_color(FL_DARK2);
            fl_line(X+W-1,Y+h1,X+W-1,Y+H-h1);
            fl_color(FL_DARK3);
            fl_line(X+W,Y,X,Y);
            fl_line(X,Y,X,Y+h1);
            fl_line(X,Y+H-h1,X,Y+H);
            fl_color(FL_LIGHT2);
            fl_line(X,Y+h1,X,Y+H-h1);
            fl_line(X,Y+H,X+W,Y+H);
            fl_line(X+W,Y+H,X+W,Y+H-h1);
            fl_line(X+W,Y+h1,X+W,Y);
        }
    }
    if (focused())
    {
        focus_box()->draw(0,0,w(),h(), FL_BLACK, FL_INVISIBLE);
    }
}
Пример #7
0
void Gate::draw_two_lines(Point& ul, int iny1, int iny2) const{
    fl_line(ul.x+(.8*SCALE)/4,ul.y,ul.x+(.8*SCALE)/4, iny1);
    fl_circle(ul.x+(.8*SCALE)/4, iny1, 1);
    fl_line(ul.x+3*(.8*SCALE)/4,ul.y,ul.x+3*(.8*SCALE)/4, iny2);
    fl_circle(ul.x+3*(.8*SCALE)/4, iny2, 1);
}
Пример #8
0
void gWaveform::draw() {

	/* blank canvas */

	fl_rectf(x(), y(), w(), h(), COLOR_BG_0);

	/* draw selection (if any) */

	if (selectionA != selectionB) {

		int a_x = selectionA + x() - BORDER; // - start;
		int b_x = selectionB + x() - BORDER; //  - start;

		if (a_x < 0)
			a_x = 0;
		if (b_x >= w()-1)
			b_x = w()-1;

		if (selectionA < selectionB)
			fl_rectf(a_x+BORDER, y(), b_x-a_x, h(), COLOR_BD_0);
		else
			fl_rectf(b_x+BORDER, y(), a_x-b_x, h(), COLOR_BD_0);
	}

	/* draw waveform from x1 (offset driven by the scrollbar) to x2
	 * (width of parent window) */

	int offset = h() / 2;
	int zero   = y() + offset; // sample zero (-inf dB)

	int wx1 = abs(x() - ((gWaveTools*)parent())->x());
	int wx2 = wx1 + ((gWaveTools*)parent())->w();
	if (x()+w() < ((gWaveTools*)parent())->w())
		wx2 = x() + w() - BORDER;

	fl_color(0, 0, 0);
	for (int i=wx1; i<wx2; i++) {
			fl_color(0, 0, 0);
			fl_line(i+x(), zero, i+x(), data.sup[i]);
			fl_line(i+x(), zero, i+x(), data.inf[i]);
		}

	/* border box */

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

	/* print chanStart */

	int lineX = x()+chanStart+1;

	if (chanStartLit) fl_color(COLOR_BD_1);
	else              fl_color(COLOR_BD_0);

	/* vertical line */

	fl_line(lineX, y()+1, lineX, y()+h()-2);

	/* print flag and avoid overflow */

	if (lineX+FLAG_WIDTH > w()+x()-2)
		fl_rectf(lineX, y()+h()-FLAG_HEIGHT-1, w()-lineX+x()-1, FLAG_HEIGHT);
	else  {
		fl_rectf(lineX, y()+h()-FLAG_HEIGHT-1, FLAG_WIDTH, FLAG_HEIGHT);
		fl_color(255, 255, 255);
		fl_draw("s", lineX+4, y()+h()-3);
	}

	/* print chanEnd */

	lineX = x()+chanEnd;
	if (chanEndLit)	fl_color(COLOR_BD_1);
	else            fl_color(COLOR_BD_0);

	fl_line(lineX, y()+1, lineX, y()+h()-2);

	if (lineX-FLAG_WIDTH < x())
		fl_rectf(x()+1, y()+1, lineX-x(), FLAG_HEIGHT);
	else {
		fl_rectf(lineX-FLAG_WIDTH, y()+1, FLAG_WIDTH, FLAG_HEIGHT);
		fl_color(255, 255, 255);
		fl_draw("e", lineX-10, y()+10);
	}
}
Пример #9
0
Файл: Module.C Проект: 0mk/non
void
Module::draw_label ( int tx, int ty, int tw, int th )
{
    bbox( tx, ty, tw, th );

    if ( ! label() )
        return;

    char *lab = strdup( label() );

    Fl_Color c = fl_contrast( FL_FOREGROUND_COLOR, color() );

    fl_color( active_r() && ! bypass() ? c : fl_inactive(c) );

    fl_font( FL_HELVETICA, labelsize() );

    char *di = strstr( lab, " -" );
    
    if ( ! di )
        di = strstr( lab, "  " );

    if ( di )
        *di = '\0';

    int LW = fl_width( lab );
    char *s = NULL;

    bool initial = true;
    if ( LW > tw )
    {
        s = new char[strlen(lab) + 1];
        char *sp = s;
        const char *lp = lab;

        for ( ; *lp; ++lp )
        {
            bool skip = false;

            switch ( *lp )
            {
                case ' ':
                    initial = true;
                    skip = false;
                    break;
                case 'i': case 'e': case 'o': case 'u': case 'a':
                    skip = ! initial;
                    initial = false;
                    break;
                default:
                    skip = false;
                    initial = false;
                    break;
            }
            
            if ( ! skip )
                *(sp++) = *lp;
        }
     
        *sp = '\0';
   
    }

    fl_draw( s ? s : lab, tx, ty, tw, th, align() | FL_ALIGN_CLIP );
    
    if ( bypass() )
    {
        fl_color( fl_color_add_alpha( fl_color(), 127 )  );
        fl_line_style( FL_SOLID, 2 );
        fl_line( tx, ty + th * 0.5, tx + tw, ty + th * 0.5 );
        fl_line_style( FL_SOLID, 0 );
    }


    free(lab);

    if ( s )
        delete[] s;
}
Пример #10
0
 FL_EXPORT_C(void,flc_line)(int x,int y,int x1,int y1){
   fl_line(x,y,x1,y1);
 }
Пример #11
0
 FL_EXPORT_C(void,flc_line_with_x2_y2)(int x,int y,int x1,int y1,int x2,int y2){
   fl_line(x,y,x1,y1,x2,y2);
 }
Пример #12
0
void tabbar::draw() {
    const u32 startx = x();
    const u32 endx = x() + w() - 1;

    const u32 gradarea = h() - 2;
    u32 i, j;

    // bg
    u32 r1 = 63, g1 = 72, b1 = 81;
    u32 r2 = 38, g2 = 48, b2 = 59;
    for (i = 0; i <= gradarea; i++) {
        const float pos = i / (float) gradarea;

        fl_color(mix(r1, r2, pos),
                 mix(g1, g2, pos),
                 mix(b1, b2, pos));

        const u32 posy = y() + 1 + i;
        fl_line(startx, posy, endx, posy);
    }

    // Borders
    fl_color(37, 46, 52);
    fl_line(startx, y(), endx, y());
    fl_line(startx, y() + h() - 1, endx, y() + h() - 1);

    // Tabs
    u32 max;
    u32 tabw = calctabw(&max, w());

    bool highborder = false;
    if ((mousex - x()) % tabw > tabw / 2)
        highborder = true;

    u32 posx = x();
    const u32 lowy = y();
    const u32 highy = y() + h() - 1;
    for (i = 0; i < max; i++) {
        bool hover = false;
        // Borders
        fl_color(FL_BLACK);
        if (!i)
            fl_line(posx, lowy, posx, highy);
        fl_line(posx + tabw, lowy, posx + tabw, highy);

        // Bg
        r1 = 83, g1 = 92, b1 = 101;
        r2 = 58, g2 = 68, b2 = 79;

        if (i == g->curtab) {
            r1 = 100, g1 = 160, b1 = 191;
            r2 = 42, g2 = 100, b2 = 125;
        } else if ((mousein && mousex >= posx && mousex <= (posx + tabw - 1)) ||
                   (!firstpress && longorder.size() && longorder[longpress] == i)) {
            r1 = 150, g1 = 150, b1 = 191;
            r2 = 100, g2 = 100, b2 = 155;
            hover = true;
        }

        if (dragging && mousein && mousex >= posx && mousex <= (posx + tabw - 1)) {
            fl_color(FL_WHITE);
            if (!highborder)
                fl_line(posx, lowy, posx, highy);
            else
                fl_line(posx + tabw, lowy, posx + tabw, highy);
        }

        for (j = 0; j <= gradarea; j++) {
            const float pos = j / (float) gradarea;

            fl_color(mix(r1, r2, pos),
                     mix(g1, g2, pos),
                     mix(b1, b2, pos));

            const u32 posy = y() + 1 + j;
            fl_line(posx + 1, posy, posx + tabw - 1, posy);
        }

        // Icon
        Fl_Image *img = g->tabs[i].icon;
        if (!img)
            img = Fl_Shared_Image::get("newtab.png");

        const u32 imgy = y() + (h() - 16) / 2;
        img->draw(posx + 4, imgy, 16, 16);

        // Text
        fl_color(200, 200, 200);
        if (i == g->curtab)
            fl_color(FL_WHITE);
        else if (hover)
            fl_color(230, 230, 230);
        fl_font(labelfont(), labelsize());

        char tmp[80];
        memset(tmp, 0, 80);
        strncpy(tmp, g->tabs[i].title(), 79);

        int textw = 0, texth = 0;
        fl_measure(tmp, textw, texth, 0);

        const u32 textarea = tabw - 2 - 8 - 16 - 4;
        while ((u32) textw >= textarea) {
            // Shorten it until it fits
            const u32 len = strlen(tmp) - 1;
            tmp[len] = '\0';
            tmp[len - 1] = '.';
            tmp[len - 2] = '.';
            tmp[len - 3] = '.';

            textw = texth = 0;
            fl_measure(tmp, textw, texth, 0);
        }

        const u32 texty = y() - fl_descent() + fl_height() + (h() - fl_height())/2;
        fl_draw(tmp, posx + 2 + 8 + 16, texty);

        posx += tabw;
    }
}
Пример #13
0
void BaseArea::DrawLine(int nX0, int nY0, int nX1, int nY1)
{
    if(MathFunc::LocateLineSegment(0, 0, w(), h(), &nX0, &nY0, &nX1, &nY1)){
        fl_line(nX0 + x(), nY0 + y(), nX1 + x(), nY1 + y());
    }
}
Пример #14
0
void
imWindow::line(int x1, int y1, int x2, int y2)
{
  fl_color(myColor);
  fl_line(x1,y1,x2,y2);
}
Пример #15
0
Файл: draw.C Проект: imv/non
int
gui_draw_ruler ( int x, int y, int w, int div_w, int div, int ofs, int p1, int p2 )
{
    /* Across the top */

    fl_font( FL_TIMES, ruler_height );

    int h = ruler_height;

    fl_color( canvas_background_color );

    //  fl_rectf( x, y, x + (div_w * w), y + h );
    fl_rectf( x, y, (div_w * w), h );

    fl_color( FL_RED );

    fl_line( x + div_w / 2, y, x + div_w * w, y );

    char pat[40];
    int z = div;
    int i;
    for ( i = 0; i < w; i++ )
        if ( 0 == i % z )
        {
            int nx = x + (i * div_w) + (div_w / 2);

            fl_color( FL_RED );

            fl_line( nx, y, nx, y + h );

            int k = ofs + i;
            sprintf( pat, "%i", 1 + (k / z ));

            fl_color( FL_WHITE );
            fl_draw( pat, nx + div_w / 2, y + h + 1 / 2 );
        }

    if ( p1 != p2 )
    {
        if ( p1 >= 0 )
        {
            if ( p1 < p2 )
                fl_color( FL_GREEN );
            else
                fl_color( FL_RED );

            fl_rectf( x + (div_w * p1), y + h / 2, div_w, h / 2 );

        }
        if ( p2 >= 0 )
        {
            if ( p2 < p1 )
                fl_color( FL_GREEN );
            else
                fl_color( FL_RED );
            fl_rectf( x + (div_w * p2), y + h / 2, div_w, h / 2 );

        }
    }

    return h;
}
Пример #16
0
void Gate::draw_one_line(Point& ul, int iny1) const{
    fl_line(ul.x+(.8*SCALE)/2, ul.y, ul.x+(.8*SCALE)/2, iny1);
    fl_circle(ul.x+(.8*SCALE)/2, iny1, 1);
}
Пример #17
0
void Fl_Combo_Box_Panel::draw()
{
    bool selected = focused();

    int X=0, Y=0, W=w(), H=h();

    if(selected) {      
        // Draw using combo's focus_box
        m_comboBox->focus_box()->draw(X,Y,W,H, m_comboBox->selection_color(), FL_SELECTED);
    } else {
        // Draw using combo's BG
        fl_push_clip(X,Y,W,H);
        m_comboBox->draw_group_box();
        fl_pop_clip();
    }

    box()->inset(X,Y,W,H);  

    int dd = 2;

    Fl_ListView *lv = m_comboBox->listview();

    Fl_ListView_Item *item = lv->item();
    if (!item) return;

    Fl_ListView_ItemExt *item_ext = 0;
    if(item->type()==Fl_ListView_Item::EXT)
        item_ext = (Fl_ListView_ItemExt *)item;

    if (!item_ext) {
        fl_font(lv->text_font(), lv->text_size());
    }

    fl_push_clip(X,Y,W,H);

    Fl_Color text_color;
    for (unsigned c = 0; c < item->columns(); c++) {
        if (!lv->visible_col(c))
            continue;
        int ww = lv->column_width(c);
        fl_push_clip(X+dd, Y, ww-dd, H);
        if (item_ext) {
            fl_font(item_ext->label_font(c),item_ext->label_size(c));
            text_color = item_ext->label_color(c);
        } else
            text_color = m_comboBox->text_color();

        if(selected) {
            // set selection color for text
            text_color = m_comboBox->selection_text_color();
        }

        fl_color(text_color);
        fl_draw(item->label(c), X+dd, Y, ww-dd, H, FL_ALIGN_LEFT);

        fl_pop_clip();

        fl_color(fl_gray_ramp(20));
        fl_line(X + ww-1, Y, X + ww-1, H);
        fl_color(fl_gray_ramp(10));
        fl_line(X + ww, Y, X + ww, H);

        X += ww;
    }
    fl_pop_clip();
}
Пример #18
0
void gWaveform::draw() 
{
  /* blank canvas */

  fl_rectf(x(), y(), w(), h(), COLOR_BG_0);

  /* draw selection (if any) */

  if (selectionA != selectionB) {

    int a_x = selectionA + x() - BORDER; // - start;
    int b_x = selectionB + x() - BORDER; //  - start;

    if (a_x < 0)
      a_x = 0;
    if (b_x >= w()-1)
      b_x = w()-1;

    if (selectionA < selectionB)
      fl_rectf(a_x+BORDER, y(), b_x-a_x, h(), COLOR_BD_0);
    else
      fl_rectf(b_x+BORDER, y(), a_x-b_x, h(), COLOR_BD_0);
  }

  /* draw waveform from x1 (offset driven by the scrollbar) to x2
   * (width of parent window). We don't draw the entire waveform,
   * only the visibile part. */

  int offset = h() / 2;
  int zero   = y() + offset; // sample zero (-inf dB)

  int wx1 = abs(x() - ((gWaveTools*)parent())->x());
  int wx2 = wx1 + ((gWaveTools*)parent())->w();
  if (x()+w() < ((gWaveTools*)parent())->w())
    wx2 = x() + w() - BORDER;

  fl_color(0, 0, 0);
  for (int i=wx1; i<wx2; i++) {
    fl_line(i+x(), zero, i+x(), data.sup[i]);
    fl_line(i+x(), zero, i+x(), data.inf[i]);
    
    /* print grid */

    for (unsigned k=0; k<grid.points.size; k++) {
      if (grid.points.at(k) == i) {
        //gLog("draw grid line at %d\n", i);
        fl_color(fl_rgb_color(54, 54, 54));
        fl_line_style(FL_DASH, 0, NULL);
        fl_line(i+x(), y(), i+x(), y()+h());
        fl_color(0, 0, 0);
        fl_line_style(FL_SOLID, 0, NULL);
        break;
      }
    }
  }

  /* border box */

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

  /* print chanStart */

  int lineX = x()+chanStart+1;

  if (chanStartLit) fl_color(COLOR_BD_1);
  else              fl_color(COLOR_BD_0);

  /* vertical line */

  fl_line(lineX, y()+1, lineX, y()+h()-2);

  /* print flag and avoid overflow */

  if (lineX+FLAG_WIDTH > w()+x()-2)
    fl_rectf(lineX, y()+h()-FLAG_HEIGHT-1, w()-lineX+x()-1, FLAG_HEIGHT);
  else  {
    fl_rectf(lineX, y()+h()-FLAG_HEIGHT-1, FLAG_WIDTH, FLAG_HEIGHT);
    fl_color(255, 255, 255);
    fl_draw("s", lineX+4, y()+h()-3);
  }

  /* print chanEnd */

  lineX = x()+chanEnd;
  if (chanEndLit) fl_color(COLOR_BD_1);
  else            fl_color(COLOR_BD_0);

  fl_line(lineX, y()+1, lineX, y()+h()-2);

  if (lineX-FLAG_WIDTH < x())
    fl_rectf(x()+1, y()+1, lineX-x(), FLAG_HEIGHT);
  else {
    fl_rectf(lineX-FLAG_WIDTH, y()+1, FLAG_WIDTH, FLAG_HEIGHT);
    fl_color(255, 255, 255);
    fl_draw("e", lineX-10, y()+10);
  }
}