Exemplo n.º 1
0
//REDRAW SCROLL BARS
void ScrollDraw(struct ScrollBar *scroll,int fromx,long fromy)
{
 long pom;
 int zblo=0;

 if(user_interface.scrollbarstyle == 'C') //C = Clarence ;)
  return;

 if(!scroll->onscrollx)
 {
  if(scroll->total_y<=scroll->ysize || scroll->total_y==0)
  {
   scroll->yscrsz=scroll->max_yscrsz;
   scroll->yscr=0;
  }
  else
  {
   pom=(long)scroll->ysize*(long)scroll->max_yscrsz;
   scroll->yscrsz=(int)(pom/scroll->total_y)+1;
   if(scroll->yscrsz<8)
   {
    scroll->yscrsz=8;
    if(scroll->yscrsz>scroll->max_yscrsz)scroll->yscrsz=scroll->max_yscrsz;
   }

   pom=fromy*(long)scroll->max_yscrsz;
   scroll->yscr=(int)(pom/scroll->total_y);

//!!Ray: Dec 17, 2007 -- fix BSOD
// Return if overflow:
if(scroll->yscr < 0) return;
//!!Ray: end

   if(scroll->yscr+scroll->yscrsz>scroll->max_yscrsz)scroll->yscr=scroll->max_yscrsz-scroll->yscrsz;
  }

  if(!scroll->yvisible)
   return;

  x_setfill(0,0);
  if(scroll->scrollbarstyle)
   zblo=1;

  scroll->yscr+=scroll->gap;

  if(scroll->yscr>0)
   x_bar(scroll->xtop+scroll->xsize+1,scroll->ytop+scroll->gap,
         scroll->xtop+scroll->xsize+user_interface.scrollbarsize,scroll->ytop+scroll->yscr-1);
  if(scroll->yscr+scroll->yscrsz<scroll->max_yscrsz+scroll->gap)
   x_bar(scroll->xtop+scroll->xsize+1,scroll->ytop+scroll->yscr+scroll->yscrsz+1,
         scroll->xtop+scroll->xsize+user_interface.scrollbarsize,scroll->ytop+scroll->max_yscrsz+scroll->gap+zblo);

  Box3Dv(scroll->xtop+scroll->xsize+1,scroll->ytop+scroll->yscr,
        scroll->xtop+scroll->xsize+user_interface.scrollbarsize,scroll->ytop+scroll->yscr+scroll->yscrsz+zblo);

  //ozdobicky (tr.: ornaments)
  if(scroll->yscrsz>24)
  {
   int ymid=scroll->yscrsz/2;
   int xleft=scroll->xtop+scroll->xsize+3;
   int xright=scroll->xtop+scroll->xsize+user_interface.scrollbarsize-3;
   int yyy=scroll->ytop+scroll->yscr+ymid;

   x_setcolor(15);
   x_line(xleft,yyy,
          xright,yyy);
   x_line(xleft,yyy-4,
          xright,yyy-4);
   x_line(xleft,yyy+4,
          xright,yyy+4);
   x_line(xleft,yyy-8,
	  xright,yyy-8);
   x_line(xleft,yyy+8,
	  xright,yyy+8);
   x_setcolor(8);
   x_line(xleft,yyy-1,
	  xright,yyy-1);
   x_line(xleft,yyy-5,
	  xright,yyy-5);
   x_line(xleft,yyy+3,
	       xright,yyy+3);
   x_line(xleft,yyy-9,
	  xright,yyy-9);
   x_line(xleft,yyy+7,
	  xright,yyy+7);
  }
 }

 if(scroll->onscrolly)
 {
#ifdef GGI
  Smart_ggiFlush();
#endif 
  return;
 }
 
 if(!scroll->xvisible || scroll->total_x<=scroll->xsize || scroll->total_x==0)
 {
  scroll->xscrsz=scroll->max_xscrsz;
  scroll->xscr=0;
  if(!scroll->xvisible)
   return;
 }
 else
 {
  pom=(long)scroll->xsize*(long)scroll->max_xscrsz;
  scroll->xscrsz=(int)(pom/scroll->total_x)+1;
  if(scroll->xscrsz<8)
  {
   scroll->xscrsz=8;
   if(scroll->xscrsz>scroll->max_xscrsz)scroll->xscrsz=scroll->max_xscrsz;
  }

  pom=fromx*(long)scroll->max_xscrsz;
  scroll->xscr=(int)(pom/scroll->total_x);
  if(scroll->xscr+scroll->xscrsz>scroll->max_xscrsz)scroll->xscr=scroll->max_xscrsz-scroll->xscrsz;
 }

 x_setfill(0,0);
 if(scroll->scrollbarstyle!='N')
  zblo=0;

 scroll->xscr+=scroll->gap+zblo;
 if(scroll->xscr>0)
   x_bar(scroll->xtop+scroll->gap+zblo,scroll->ytop+scroll->ysize+1,
         scroll->xtop+scroll->xscr-1,scroll->ytop+scroll->ysize+user_interface.scrollbarsize);
 if(scroll->xscr+scroll->xscrsz<scroll->max_xscrsz+scroll->gap+zblo)
   x_bar(scroll->xtop+scroll->xscr+scroll->xscrsz+1,scroll->ytop+scroll->ysize+1,
         scroll->xtop+scroll->max_xscrsz+scroll->gap+zblo,scroll->ytop+scroll->ysize+user_interface.scrollbarsize);

 Box3Dh(scroll->xtop+scroll->xscr,scroll->ytop+scroll->ysize+1,
       scroll->xtop+scroll->xscr+scroll->xscrsz,scroll->ytop+scroll->ysize+user_interface.scrollbarsize);

 if(scroll->xscrsz>24)//ozdobicky...  (tr.: ornaments...)
 {
  int xmid=scroll->xscrsz/2;
  int yend=scroll->ytop+scroll->ysize+3;
  int ystart=scroll->ytop+scroll->ysize+user_interface.scrollbarsize-3;
  int xxx=scroll->xtop+scroll->xscr+xmid;

  x_setcolor(15);

  x_line(xxx,yend,
         xxx,ystart);
  x_line(xxx-4,yend,
         xxx-4,ystart);
  x_line(xxx+4,yend,
         xxx+4,ystart);
  x_line(xxx-8,yend,
         xxx-8,ystart);
  x_line(xxx+8,yend,
         xxx+8,ystart);
  x_setcolor(8);
  x_line(xxx-1,yend,
         xxx-1,ystart);
  x_line(xxx-5,yend,
         xxx-5,ystart);
  x_line(xxx+3,yend,
         xxx+3,ystart);
  x_line(xxx-9,yend,
         xxx-9,ystart);
  x_line(xxx+7,yend,
         xxx+7,ystart);
 }
#ifdef GGI
  Smart_ggiFlush();
#endif 

}
Exemplo n.º 2
0
void Forced_ggiFlush(void)
{
 tv_lastflush.tv_sec--; //force flush by modifying last flush date...
 Smart_ggiFlush();
}