MakeVisible implemented

Originally committed to SVN as r66.
This commit is contained in:
Rodrigo Braz Monteiro 2006-02-18 23:00:09 +00:00
parent 798a718381
commit 6edfa51c21
1 changed files with 15 additions and 0 deletions

View File

@ -134,6 +134,21 @@ void BaseGrid::EndBatch() {
//////////////////////
// Makes cell visible
void BaseGrid::MakeCellVisible(int row, int col) {
// Get size
int w = 0;
int h = 0;
GetClientSize(&w,&h);
bool forceCenter = true;
// Get min and max visible
int minVis = yPos+1;
int maxVis = yPos+h/lineHeight-3;
// Make visible
if (forceCenter || row < minVis || row > maxVis) {
yPos = MID(0,row - h/lineHeight/2 + 1,GetRows()+2 - h/lineHeight);
scrollBar->SetThumbPosition(yPos);
}
}