scbuf.c
/*------------------------------------------*/
/* Draw window area with or without border. */
/*------------------------------------------*/
Draw window area with or without border.
Draw window area with or without border .
void draw_window(SCREENCELL *newScreen, int x1, int y1, int x2, int y2, int backcolor, int bordercolor, int titlecolor, BOOL  border, BOOL title, BOOL shadow, BOOL raw) {
  SCREENCELL *aux = newScreen;
  int     i, j;
  wchar_t ch=FILL_CHAR;
  i = x1;
  j = y1;
  if (shadow == TRUE){
  for(j = y1 + 1; j <= y2 + 1; j++)
    for(i = x1 + 1; i <= x2 + 1; i++)
    {
      ch=read_char(aux, i,j); 
      if (ch=='\0') ch=FILL_CHAR;
      write_ch(aux, i, j, ch, B_BLACK, F_WHITE,raw);
    }
  }
  for(j = y1; j <= y2; j++)
    for(i = x1; i <= x2; i++)
      write_ch(aux, i, j, FILL_CHAR, backcolor, bordercolor,raw);
  if(border == TRUE) {
    for(i = x1; i <= x2; i++) {
      write_ch(aux, i, y1, HOR_LINE, backcolor, bordercolor,raw);   
      write_ch(aux, i, y2, HOR_LINE, backcolor, bordercolor,raw);
    }
    for(j = y1; j <= y2; j++) {
      write_ch(aux, x1, j, VER_LINE, backcolor, bordercolor,raw);   
      write_ch(aux, x2, j, VER_LINE, backcolor, bordercolor,raw);
    }
    write_ch(aux, x1, y1, UPPER_LEFT_CORNER, backcolor, bordercolor,raw);   
    write_ch(aux, x1, y2, LOWER_LEFT_CORNER, backcolor, bordercolor,raw);   
    write_ch(aux, x2, y1, UPPER_RIGHT_CORNER, backcolor, bordercolor,raw);  
    write_ch(aux, x2, y2, LOWER_RIGHT_CORNER, backcolor, bordercolor,raw);  
  }
  if (title == TRUE) {
    for(i = x1+1; i <= x2-1; i++)
      write_ch(aux, i, y1, ' ', titlecolor, titlecolor,raw);
  }
}
void draw_window ( SCREENCELL * newScreen , int x1 , int y1 , int x2 , int y2 , int backcolor , int bordercolor , int titlecolor , BOOL border , BOOL title , BOOL shadow , BOOL raw ) { SCREENCELL * aux = newScreen ; int i , j ; wchar_t ch = FILL_CHAR ; i = x1 ; j = y1 ; if ( shadow == TRUE ) { for ( j = y1 + 1 ; j <= y2 + 1 ; j ++ ) for ( i = x1 + 1 ; i <= x2 + 1 ; i ++ ) { ch = read_char ( aux , i , j ) ; if ( ch == ' \0 ' ) ch = FILL_CHAR ; write_ch ( aux , i , j , ch , B_BLACK , F_WHITE , raw ) ; } } for ( j = y1 ; j <= y2 ; j ++ ) for ( i = x1 ; i <= x2 ; i ++ ) write_ch ( aux , i , j , FILL_CHAR , backcolor , bordercolor , raw ) ; if ( border == TRUE ) { for ( i = x1 ; i <= x2 ; i ++ ) { write_ch ( aux , i , y1 , HOR_LINE , backcolor , bordercolor , raw ) ; write_ch ( aux , i , y2 , HOR_LINE , backcolor , bordercolor , raw ) ; } for ( j = y1 ; j <= y2 ; j ++ ) { write_ch ( aux , x1 , j , VER_LINE , backcolor , bordercolor , raw ) ; write_ch ( aux , x2 , j , VER_LINE , backcolor , bordercolor , raw ) ; } write_ch ( aux , x1 , y1 , UPPER_LEFT_CORNER , backcolor , bordercolor , raw ) ; write_ch ( aux , x1 , y2 , LOWER_LEFT_CORNER , backcolor , bordercolor , raw ) ; write_ch ( aux , x2 , y1 , UPPER_RIGHT_CORNER , backcolor , bordercolor , raw ) ; write_ch ( aux , x2 , y2 , LOWER_RIGHT_CORNER , backcolor , bordercolor , raw ) ; } if ( title == TRUE ) { for ( i = x1 + 1 ; i <= x2 - 1 ; i ++ ) write_ch ( aux , i , y1 , ' ' , titlecolor , titlecolor , raw ) ; } }
Draw window area with or without border.
Draw window area with or without border .
/*
   Draw a box on screen
 */ //shadow //dynamic shadow //window //borders //upper and lower borders //horizontal line box-like char //left and right borders //vertical line box-like char //upper-left corner box-like char //lower-left corner box-like char //upper-right corner box-like char //lower-right corner box-like char