HexEdit/AerialView.cpp
void CAerialView::update_bars()
{
	SCROLLINFO si;
	memset(&si, 0, sizeof(si)); // default to hiding the scrollbar
	si.cbSize = sizeof(si);
	si.fMask = SIF_ALL;

	CHexEditDoc *pDoc = GetDocument();
	int width = pDoc->GetBpe() * cols_;
	int pos = int(scrollpos_/width);                    // current pos as row no
	int endpos = int((pDoc->length()-1)/width + 1);     // row just past eof

	if (endpos > rows_)                                 // EOF past end of display
	{
		si.nMax = endpos/sbfact_;
		si.nPage = rows_/sbfact_;
		si.nPos = pos/sbfact_;
	}

	SetScrollInfo(SB_VERT, &si);
}
// Update the scroll bar based on the current display position (scrollpos_).
// Compare with CScrView::update_bars - but note there is only a vertical
// scroll bar in an aerial view as we "reshape" the bitmap before BLTing
// so that it always fits across the window.

Update the scroll bar based on the current display position (scrollpos_).
Compare with CScrView::update_bars - but note there is only a vertical
scroll bar in an aerial view as we "reshape" the bitmap before BLTing
so that it always fits across the window.
Update the scroll bar based on the current display position ( scrollpos_ ) . Compare with CScrView :: update_bars - but note there is only a vertical scroll bar in an aerial view as we " reshape " the bitmap before BLTing so that it always fits across the window .
void CAerialView::update_bars()
{
	SCROLLINFO si;
	memset(&si, 0, sizeof(si)); 
	si.cbSize = sizeof(si);
	si.fMask = SIF_ALL;
	CHexEditDoc *pDoc = GetDocument();
	int width = pDoc->GetBpe() * cols_;
	int pos = int(scrollpos_/width);                    
	int endpos = int((pDoc->length()-1)/width + 1);     
	if (endpos > rows_)                                 
	{
		si.nMax = endpos/sbfact_;
		si.nPage = rows_/sbfact_;
		si.nPos = pos/sbfact_;
	}
	SetScrollInfo(SB_VERT, &si);
}
void CAerialView :: update_bars ( ) { SCROLLINFO si ; memset ( & si , 0 , sizeof ( si ) ) ; si . cbSize = sizeof ( si ) ; si . fMask = SIF_ALL ; CHexEditDoc * pDoc = GetDocument ( ) ; int width = pDoc -> GetBpe ( ) * cols_ ; int pos = int ( scrollpos_ / width ) ; int endpos = int ( ( pDoc -> length ( ) - 1 ) / width + 1 ) ; if ( endpos > rows_ ) { si . nMax = endpos / sbfact_ ; si . nPage = rows_ / sbfact_ ; si . nPos = pos / sbfact_ ; } SetScrollInfo ( SB_VERT , & si ) ; }
Update the scroll bar based on the current display position (scrollpos_).
Update the scroll bar based on the current display position ( scrollpos_ ) .
// default to hiding the scrollbar
 // current pos as row no
 // row just past eof
 // EOF past end of display
