Example #1
0
void Desktop::draw(void) {
	if(!damage()) return;
	
	if(damage() & (FL_DAMAGE_ALL | FL_DAMAGE_EXPOSE)) {
		/*
		 * If any overlay was previously visible during full redraw, it will not be cleared because of fast flip.
		 * This will assure that does not happened.
		 */
		fl_overlay_clear();
		EDE_DESKTOP_WINDOW::draw();
		//E_DEBUG(E_STRLOC ": REDRAW ALL\n");
	}

	if(damage() & EDE_DESKTOP_DAMAGE_OVERLAY) {
		if(selbox->show)
			fl_overlay_rect(selbox->x, selbox->y, selbox->w, selbox->h);
		else
			fl_overlay_clear();

		/*
		 * now scan all icons and see if they needs redraw, and if do
		 * just update their label since it is indicator of selection
		 */
		for(int i = 0; i < children(); i++) {
			if(child(i)->damage() == EDE_DESKTOP_DAMAGE_CHILD_LABEL) {
				update_child(*child(i));
				child(i)->clear_damage();
				//E_DEBUG(E_STRLOC ": ICON REDRAW \n");
			}
		}
	}

	clear_damage();
}
void Fl_Value_Slider_Input::draw() {

  int sxx = x(); 
	int syy = y();
	int sww = w();
	int shh = h();

  int bxx = x();
	int byy = y();
	int bww = w();
	int bhh = h();

  int X = x();
	int Y = y();
	int W = w();
	int H = h();

	UNUSED(bxx); 
	UNUSED(byy);
	UNUSED(bhh);

  int border_size=Fl::box_dx(box());

  if (horizontal())
  {
    bww = textboxsize();
    UNUSED(bww);
    sxx += textboxsize(); 
    sww -= textboxsize();
    input.resize(X,Y,W-sww,shh);
  }
  else
  {
    fl_font(input.textfont(), input.textsize());
    syy += fl_height()+(border_size+1)*2; shh -= fl_height()+(border_size+1)*2;
    input.resize(X,Y,W,H-shh);
  }
  if (damage()&~FL_DAMAGE_CHILD)  input.clear_damage(FL_DAMAGE_ALL);
  input.box(box());
  input.color(FL_WHITE, selection_color());
  input.doDraw();
  input.resize(X,Y,W,H);
  input.clear_damage();
//  if (horizontal())   input.doDraw();
  clear_damage();
  draw_box(box(),sxx,syy,sww,shh,color());
  sxx+=border_size;
  syy+=border_size; 
  sww-=border_size*2;  
  shh-=border_size*2;
  if(border_size<2) {
    sxx++;
    syy++;
    sww--;
    shh--;
  }  
  Fl_Slider::draw(sxx,syy,sww,shh);
}
Example #3
0
void Fl_Spin::draw() {

  int sxx = x(), syy = y(), sww = w(), shh = h(); 
  Fl_Boxtype box1 = (Fl_Boxtype)(box());
  int border_size=Fl::box_dx(box());

  if (damage()&~FL_DAMAGE_CHILD) clear_damage(FL_DAMAGE_ALL);

  if (!box1) box1 = (Fl_Boxtype)(box()&-2);

  if((indrag || mouseobj) && deltadir!=0) {
     if(deltadir>0) {
       draw_box(down(box1),sxx,syy,sww,shh/2,color());
       draw_box(box1,sxx,syy+shh/2,sww,shh/2,color());
     } else {
       draw_box(box1,sxx,syy,sww,shh/2,color());
       draw_box(down(box1),sxx,syy+shh/2,sww,shh/2,color());
     }
  } else {
   draw_box(box1,sxx,syy,sww,shh/2,color());
   draw_box(box1,sxx,syy+shh/2,sww,shh/2,color());
  }
  sxx+=border_size;
  syy+=border_size;
  sww-=border_size*2;  
  shh-=border_size*2;
  if (active_r()) {
        fl_color(selection_color());  
  } else {
        fl_color(selection_color() | 8);
  }    
  int w1 = (sww-1)|1; // use odd sizes only
  int X = sxx+w1/2;
  int W = w1/3;
  int h1 = shh/2-border_size-2;
  int Y= syy;
  fl_polygon(X, Y, X+W,Y+h1 , X-W, Y+h1);
  Y=syy+shh/2+border_size+1+h1; 
  fl_polygon(X, Y, X-W, Y-h1, X+W, Y-h1); 
  clear_damage();  
} 
//*****************************************************************************
// Vp_Value_Input_Spin::draw() -- Draw widget
void Vp_Value_Input_Spin::draw()
{
  int sxx = x(), syy = y(), sww = w(), shh = h();
  sxx += sww - buttonssize(); sww = buttonssize();
  Fl_Boxtype box1 = FL_BORDER_FRAME;
  //int border_size=Fl::box_dx(FL_BORDER_FRAME);
  int border_size=1;

  if (damage()&~FL_DAMAGE_CHILD) input.clear_damage(FL_DAMAGE_ALL);
  input.box(box());
  input.color(FL_WHITE, selection_color());
  Fl_Widget * draw_hack = &input;
  draw_hack->draw();
  input.clear_damage();
  sxx+=border_size;
  syy+=border_size;
  sww-=border_size*2;
  shh-=border_size*2;

  if (!box1) box1 = (Fl_Boxtype)(box()&-2);

  if((indrag || mouseobj) && deltadir!=0) {
     if(deltadir>0) {
       draw_box(down(box1),sxx,syy,sww,shh/2,color());
       draw_box(box1,sxx,syy+shh/2,sww,shh/2,color());
     } else {
       draw_box(box1,sxx,syy,sww,shh/2,color());
       draw_box(down(box1),sxx,syy+shh/2,sww,shh/2,color());
     }
  } else {
   draw_box(box1,sxx,syy,sww,shh/2,color());
   draw_box(box1,sxx,syy+shh/2,sww,shh/2,color());
  }
  sxx+=border_size;
  syy+=border_size;
  sww-=border_size*2;
  shh-=border_size*2;
  if (active_r()) {
        fl_color(labelcolor());
  } else {
        fl_color(labelcolor() | 8);
  }
  int w1 = (sww-1)|1; // use odd sizes only
  int X = sxx+w1/2;
  int W = w1/3;
  int h1 = shh/2-border_size-2;
  int Y= syy;
  fl_polygon(X, Y, X+W,Y+h1 , X-W, Y+h1);
  Y=syy+shh/2+border_size+1+h1;
  fl_polygon(X, Y, X-W, Y-h1, X+W, Y-h1);
  clear_damage();
}