Exemplo n.º 1
0
void Flu_Combo_Box :: draw()
{
  int W = 18, H = h()-4;
  int X = x()+w()-W-2, Y = y()+2;

  fl_draw_box( box(), x(), y(), w(), h(), color() );

  // draw the arrow button
  fl_draw_box( (Fl_Boxtype)_valbox, X, Y, W, H, color() );
  fl_color( active_r() ? FL_FOREGROUND_COLOR : fl_inactive(FL_FOREGROUND_COLOR) );
  fl_polygon( X+W/2-5, Y+H/2-2, X+W/2+3, Y+H/2-2, X+W/2-1, Y+H/2+2 );

  draw_child( input );
  if( Fl::focus() == this )
    draw_focus( FL_NO_BOX, input.x(), input.y(), input.w(), input.h() );
}
Exemplo n.º 2
0
void Flu_Spinner :: NoTabInput :: draw()
{
  if( spinner->active() )
    activate();
  else
    deactivate();

  if( spinner->_dragging )
    {
      if( (spinner->align() & FL_ALIGN_INSIDE) || !spinner->editable() )
	position( size() );
      else
	position( 0, size() );
    }

  Fl_Input::draw();
  if( Fl::focus() == this && ( (spinner->align() & FL_ALIGN_INSIDE) || !spinner->editable() ) )
    draw_focus( box(), x(), y(), w(), h() );
}
Exemplo n.º 3
0
void TaskButton::draw(void) {
	Fl_Color col = value() ? selection_color() : color();
	draw_box(value() ? (down_box() ? down_box() : fl_down(box())) : box(), col);

	if(image()) {
		int X, Y, lw, lh;

		X = x() + 5;
		Y = (y() + h() / 2) - (image()->h() / 2);
		image()->draw(X, Y);

		X += image()->w() + 5;

		if(label()) {
			fl_font(labelfont(), labelsize());
			fl_color(labelcolor());

			lw = lh = 0;
			fl_measure(label(), lw, lh, 0);

			/* use clipping so long labels do not be drawn on the right border, which looks ugly */
			fl_push_clip(x() + Fl::box_dx(box()), 
						 y() + Fl::box_dy(box()), 
						 w() - Fl::box_dw(box()) - 5, 
						 h() - Fl::box_dh(box()));

			Y = (y() + h() / 2) - (lh / 2);
			fl_draw(label(), X, Y, lw, lh, align(), 0, 0);

			fl_pop_clip();
		}
	} else {
		draw_label();
	}

	if(Fl::focus() == this)
		draw_focus();
}
Exemplo n.º 4
0
// is the same as focus, cause a switch cannot be selected all the time !!
void SwitchButton::draw_selected()
{
	STACKTRACE;
	draw_focus();
}