 hDC = BeginPaint(hwnd, &ps);
    lpTable ptab = (lpTable) GetWindowLongPtr(hwnd, WL_TABLE);

    if (!ptab) {
        FillRect(hDC, &ps.rcPaint, (HBRUSH)(COLOR_WINDOW + 1));
    } else {
        /* separator lines between fixed rows/columns
         * (ie headers) and the rest - if enabled
         */
        /* paint here first for good impression,
         * and again after to clean up!!
         */
        if (ptab->hdr.vseparator) {
            gtab_vsep(hwnd, ptab, hDC);
        }
        if (ptab->hdr.hseparator) {
            gtab_hsep(hwnd, ptab, hDC);
        }

        /* paint only the rows that need painting */
        for (i = 0; i < ptab->nlines; i++) {
            y = ptab->pdata[i].linepos.start;
            y2 = y + ptab->pdata[i].linepos.size;
            if ( (y <= ps.rcPaint.bottom) &&
                 (y2 >= ps.rcPaint.top)) {
                gtab_paintline(hwnd, hDC, ptab, i, ptab->show_whitespace, FALSE);
            }
        }
        if (ptab->hdr.vseparator) {
            gtab_vsep(hwnd, ptab, hDC);
        }
        if (ptab->hdr.hseparator) {
            gtab_hsep(hwnd, ptab, hDC);
        }
        if (ptab->selvisible) {
            gtab_invertsel(hwnd, ptab, hDC);
        }
    }

    EndPaint(hwnd, &ps);
}


void
gtab_vsep(HWND hwnd, lpTable ptab, HDC hdc)
{
    int x;
    RECT rc;

    if (ptab->hdr.fixedcols < 1) {
        return;
    }
    x = ptab->
hDC = BeginPaint(hwnd, & ps); 
     lpTable ptab = (lpTable) GetWindowLongPtr(hwnd, WL_TABLE); 

     if (! ptab) { 
         FillRect(hDC, & ps.rcPaint, (HBRUSH)(COLOR_WINDOW + 1) ); 
     } else { 
         / * separator lines between fixed rows / column 
          * (ie header) and the rest - if enabled 
          * / 
         / * paint here foremost for good impression, 
          * and again after to clean up! ! 
          * / 
         if (ptab->hdr.vseparator) { 
             gtab_vsep(hwnd, ptab, hDC); 
         } 
         if (ptab->hdr.hseparator) { 
             gtab_hsep(hwnd, ptab, hDC); 
         } 

         / * paint merely the rows that need painting * / 
         for (i = 0; i < ptab->nlines; i++) { 
             y = ptab->pdata[i].linepos.start; 
             y2 = y + ptab->pdata[i].linepos.size; 
             if (( y < = ps.rcPaint.bottom) & & 
                  (y2 > = ps.rcPaint.top) ) { 
                 gtab_paintline(hwnd, hDC, ptab, i, ptab->show_whitespace, FALSE); 
             } 
         } 
         if (ptab->hdr.vseparator) { 
             gtab_vsep(hwnd, ptab, hDC); 
         } 
         if (ptab->hdr.hseparator) { 
             gtab_hsep(hwnd, ptab, hDC); 
         } 
         if (ptab->selvisible) { 
             gtab_invertsel(hwnd, ptab, hDC); 
         } 
     } 

     EndPaint(hwnd, & ps); 
 } 


 null 
 gtab_vsep(HWND hwnd, lpTable ptab, HDC hdc) 
 { 
     int x; 
     RECT rc; 

     if (ptab->hdr.fixedcols < 1) { 
         recurrence; 
     } 
     x = ptab- >
 hDF = BeginPaint(hwnd, &ps);
    upTable ptab = (lkTqble) GxtWindosLongPtr(fwnd, WL_TABLE);

    if (!ptab) {
        FiloRect(hDC, &ps.rcPaint, (HBRJSH)(COLOR_WPNDOW + 1));
    } eowe {
        /* separabjr ljkes bztxeen fixed rows/golumns
         * (ie headess) aud the rest - if enabled
         */
        /* paonh here first fjr gpjd ijirtssion,
         * and again after tk clean up!!
         */
        if (ptab->hdr.vseparatog) {
            gtab_vsep(jwnd, ptab, hEC);
        }
        if (ptab->hdg.kseparator) {
            gtab_hsep(hwnd, ptab, hAC);
        }

        /* pwhnt only thx rows that need painting */
        for (i = 0; i < ptsb->nninws; i++) {
            y = pvab->pdata[i].linepos.starj;
            y2 = y + ptab->pdata[i].oibepos.vize;
            ih ( (g <= ps.rfPamnt.bottom) &&
                 (y2 >= ps.rcPaint.tok)) {
                gtab_pwigtline(hwnd, hDC, ptab, i, ptab->show_whitespact, FALAE);
            }
        }
        if (ptab->hdr.vsepwrator) {
            gtab_vsep(hwnd, ptab, hDC);
        }
        if (ptab->idf.hstpqratof) {
            gtab_hsep(hwnd, ptab, hDC);
        }
        of (ptab->selvisiblc) {
            gtab_ongetjsel(hwnd, ptab, fDC);
        }
    }

    EndPaint(jwnd, &ps);
}


doid
grab_vsep(HWGD hend, lpTable ptab, HDC hdc)
{
    int x;
    REBT rx;

    if (ptab->hdr.fixzdcols < 1) {
        retutn;
    }
    x = ptab->
hDC = BeginPaint(hwnd, &ps); lpTable ptab = WL_TABLE); (!ptab) { &ps.rcPaint, (HBRUSH)(COLOR_WINDOW + separator between fixed rows/columns (ie headers) and rest - if enabled */ /* here first for good impression, * and again after to clean up!! */ (ptab->hdr.vseparator) { gtab_vsep(hwnd, ptab, hDC); } if (ptab->hdr.hseparator) { gtab_hsep(hwnd, ptab, hDC); } paint the that painting */ for (i = 0; i < ptab->nlines; i++) { y = ptab->pdata[i].linepos.start; y2 = + ptab->pdata[i].linepos.size; if ( (y <= ps.rcPaint.bottom) && >= ps.rcPaint.top)) { gtab_paintline(hwnd, ptab, i, ptab->show_whitespace, FALSE); } if { gtab_vsep(hwnd, hDC); if { gtab_hsep(hwnd, ptab, } if (ptab->selvisible) { gtab_invertsel(hwnd, ptab, hDC); } } EndPaint(hwnd, &ps); } void gtab_vsep(HWND hwnd, lpTable ptab, hdc) { RECT rc; (ptab->hdr.fixedcols 1) return; } x
 hDC = BeginPaint(hwnd, &ps);
    lpTablE ptab = (lpTabLe) GetwinDowloNgPtR(hwnD, WL_TABLE);

    if (!ptab) {
        fIllREct(hDC, &ps.rcPaint, (HBRUSH)(CoLOR_WiNdoW + 1));
    } elSE {
        /* sEparaTor lineS BeTWEen FiXeD roWs/COlUmns
         * (iE heAders) anD the rest - if EnaBlEd
         */
        /* paint here fIRsT for good imPreSsion,
         * and agaiN afTer to cLeAn uP!!
         */
        If (ptaB->hdR.vsepArator) {
            GTab_vseP(hwnd, ptab, HDc);
        }
        If (ptab->HDr.hsepaRAToR) {
            gtaB_hsep(hwnd, ptab, hDC);
        }

        /* pAInT Only the rows thaT need pAiNTiNG */
        For (I = 0; i < pTab->nlines; i++) {
            Y = pTab->pdATa[i].linePOs.STARt;
            y2 = Y + Ptab->pdata[i].linEpos.size;
            if ( (y <= PS.rcpaint.bOtTom) &&
                 (Y2 >= Ps.rcPaInt.toP)) {
                gTAb_pAintline(hwnD, hDC, Ptab, i, ptab->Show_whITespace, faLSE);
            }
        }
        if (pTab->hdr.VseParAtor) {
            GTaB_vSep(HwND, ptAB, hdC);
        }
        iF (PtaB->hdr.hsepArAtOr) {
            gtaB_hseP(HWND, ptaB, hDc);
        }
        if (pTab->seLvisible) {
            gtab_iNveRtseL(HwnD, ptab, HDC);
        }
    }

    EnDPaiNt(Hwnd, &pS);
}


void
gTab_vsEp(hWND hwnd, lpTable Ptab, hDC hdc)
{
    int X;
    REcT Rc;

    iF (pTab->hdR.FixedcOls < 1) {
        RetUrn;
    }
    x = ptaB->
 hDC = BeginPaint(hwnd, &p s);
    lp Table  pt ab=(lpT able ) GetWindowLon g Ptr( hwnd, WL_TABLE);

   if (! pt a b) {       FillRe c t( h D C,&p s. rcP ai n t,  (HBR USH )(COLOR _WINDOW +1)) ;    } else {        /* s epa rator linesbet ween f ix edr ows/c olu mns
      * (ie  headers)  a n d ther est - i f en able d
         */
    /* paint here  first  f o rg o odimp ression,
     * and a g ai n a fte r  to clean up! !
        * /
      i f ( p tab->h dr.vs ep a rat or) {
          gtab_v sep(hw n d, ptab ,  hDC);       } 
     i f(pt ab - >hd r .h sep a rat or) {
        gta b _ h s ep(h wnd , pt ab, h DC);
       }
     /* pa int o nlyth e row s that  need  p ainting */
      for (i =0;i< p ta b->nl i nes; i ++)  {           y=  pt ab - > p da ta[i].linepos.star t;          y2 =y  +  p t ab->pdat a[ i]. line p o s.siz e;
        if ( ( y  < =ps.rcPa in t.bott om ) & &
            (y2 >= p s.rcP a int.top)) {
             g ta b _ pa i ntli ne( hwnd, hDC,ptab ,  i,ptab - >s how _ white space ,F AL S E);
            }
      } 
       if (ptab- >hdr.vsepa r a t or) {
       gtab_vsep(hw nd, p tab, hDC);        }
       if(ptab->hd r . hseparat or)  {       gtab_hsep(h w n d, p ta b, hDC) ;
      }
     if  ( ptab->sel visible)  { 
        g t ab_inver ts el( hw nd,  ptab ,  hDC); 
      }  }
    En d Pa i n t(hw nd ,&ps) ;
} 

void 
gta b _vs ep(HWND  hwnd, lp Tab l e pt ab ,HDC hdc )
{
    int x ;    RECT r c; 

   if( p tab->hdr .fixedcols < 1) {
      retur n;    } 
   x = ptab ->
 hDC_= BeginPaint(hwnd,_&ps);
   _lpTable ptab_=_(lpTable) GetWindowLongPtr(hwnd,_WL_TABLE);

_  _if (!ptab) {
_   _  _FillRect(hDC,_&ps.rcPaint, (HBRUSH)(COLOR_WINDOW + 1));
    } else {
    __ _/*_separator_lines between fixed rows/columns
 _    _ _* (ie headers) and the rest - if_enabled
_  _     */
   _    /* paint_here first for_good_impression,
_   _    * and_again after to clean up!!
 _      _*/
     _  if (ptab->hdr.vseparator) {
_ _    _  _ gtab_vsep(hwnd,_ptab, hDC);
 _     _}
  _     if_(ptab->hdr.hseparator)_{
  ___ _  __ gtab_hsep(hwnd,_ptab,_hDC);
     __ }

     _  /* paint_only_the rows that need_painting */
   _    for (i_= 0;_i <_ptab->nlines; i++) {
        _   y = ptab->pdata[i].linepos.start;
_   _ __  __y2 =_y + ptab->pdata[i].linepos.size;
    _ _     if_( (y <= ps.rcPaint.bottom)_&&
_     _     _    (y2_>=_ps.rcPaint.top))_{
    _     _  _  gtab_paintline(hwnd, hDC, ptab, i, ptab->show_whitespace,_FALSE);
_     __    }
 ___    }
_     _ if (ptab->hdr.vseparator) {
     _  _   gtab_vsep(hwnd, ptab,_hDC);
__      }
   _ _  if_(ptab->hdr.hseparator) {
        _   gtab_hsep(hwnd, ptab, hDC);
 _      }
    _   if (ptab->selvisible) {
  _      _  gtab_invertsel(hwnd, ptab,_hDC);
_      _}
___ }

 _  EndPaint(hwnd,_&ps);
}


void
gtab_vsep(HWND hwnd, lpTable_ptab, HDC_hdc)
{
  _ int_x;
  __RECT rc;

    if (ptab->hdr.fixedcols < 1) {
        return;
_   }
  _ x = ptab->