WndProc (Part 9)
By SalimMeghani
- 209 reads
// Called when performing a scroll by a row.
case WM_VSCROLL:
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:
ctypos--;
if (ctypos<1)
ctypos=1;
else
{
if (ctypos<stypos)
{
endypos--;
stypos--;
curypos=1;
nVscrollPos-=1;
scroll=1;
dscroll=1;
vredraw=1;
}
else
curypos--;
}
scrlval=+cyChar;
break;
case SB_LINEDOWN:
ctypos++;
if (ctypos>100)
ctypos=100;
else
{
if (ctypos>endypos)
{
endypos++;
stypos++;
curypos=MAXROW;
nVscrollPos+=1;
scroll=1;
dscroll=2;
vredraw=1;
}
else
curypos++;
}
scrlval=-cyChar;
break;
}
SetScrollPos(hWnd,SB_VERT,ctypos,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