WndProc (Part 11)
By SalimMeghani
- 203 reads
// Called when performing a scroll by a column.
case WM_HSCROLL:
hdc=GetDC(hWnd);
SelectObject(hdc, GetStockObject(SYSTEM_FIXED_FONT));
GetTextMetrics(hdc, &tm);
cxChar=tm.tmAveCharWidth;
cyChar=tm.tmHeight;
scroll=0;
switch (LOWORD(wParam))
{
case SB_LINEUP:
ctxpos--;
if (ctxpos<1)
ctxpos=1;
else
{
if (ctxpos<stxpos)
{
endxpos--;
stxpos--;
curxpos=1;
nHscrollPos-=1;
scroll=1;
dscroll=3;
hredraw=1;
}
else
curxpos--;
}
scrlval=+(0.25+cxChar*9);
break;
case SB_LINEDOWN:
ctxpos++;
if (ctxpos>100)
ctxpos=100;
else
{
if (ctxpos>endxpos)
{
endxpos++;
stxpos++;
curxpos=NUMCOLS;
nHscrollPos+=1;
scroll=1;
dscroll=4;
hredraw=1;
}
else
curxpos++;
}
scrlval=-(0.25+cxChar*9);
break;
}
SetScrollPos(hWnd,SB_HORZ,ctxpos,TRUE);
cvalx=5+((olrxpos-1)*9);
cvaly=cyChar*(4+olrypos);
SetTextColor(hdc, RGB(0,0,0));
SetBkColor(hdc, RGB(255,255,255));
{
int pvalue=0;
pvalue=((column-1)*100)+row;
type=stype+pvalue;
evaluate_cell(column,row,(char)*type,szBuffer,'D',genetic);
TextOut(hdc, 0.25+cxChar*cvalx, cvaly, szBuffer,9);
}
if (scroll)
{
dscroll=5;
- Log in to post comments