HexEdit/HexEditView.cpp
int CHexEditView::pos_hex(int pos, int inside) const
{
	int col = pos - addr_width_*text_width_;
	col -= (col/(text_width_*(group_by_*3+1)))*text_width_;
	col = col/(3*text_width_);

	// Make sure col is within valid range
	if (col < 0) col = 0;
	else if (inside == 1 && col >= rowsize_) col = rowsize_ - 1;
	else if (inside == 0 && col > rowsize_) col = rowsize_;

	return col;
}
// Return closest hex area column given x display position
// Inside determines the numbers returned for columns above rowsize_
//  1 (TRUE) will return a value from 0 to rowsize_ - 1
//  0 (FALSE) will return a value from 0 to rowsize_
//  -1 will return value possibly greater than rowsize_

Return closest hex area column given x display position
Inside determines the numbers returned for columns above rowsize_
1 (TRUE) will return a value from 0 to rowsize_ - 1
0 (FALSE) will return a value from 0 to rowsize_
1 will return value possibly greater than rowsize_
Return closest hex area column given x display position Inside determines the numbers returned for columns above rowsize_ 1 ( TRUE ) will return a value from 0 to rowsize_ - 1 0 ( FALSE ) will return a value from 0 to rowsize_ 1 will return value possibly greater than rowsize_
int CHexEditView::pos_hex(int pos, int inside) const
{
	int col = pos - addr_width_*text_width_;
	col -= (col/(text_width_*(group_by_*3+1)))*text_width_;
	col = col/(3*text_width_);
	if (col < 0) col = 0;
	else if (inside == 1 && col >= rowsize_) col = rowsize_ - 1;
	else if (inside == 0 && col > rowsize_) col = rowsize_;
	return col;
}
int CHexEditView :: pos_hex ( int pos , int inside ) const { int col = pos - addr_width_ * text_width_ ; col -= ( col / ( text_width_ * ( group_by_ * 3 + 1 ) ) ) * text_width_ ; col = col / ( 3 * text_width_ ) ; if ( col < 0 ) col = 0 ; else if ( inside == 1 && col >= rowsize_ ) col = rowsize_ - 1 ; else if ( inside == 0 && col > rowsize_ ) col = rowsize_ ; return col ; }
Return closest hex area column given x display position
Inside determines the numbers returned for columns above rowsize_
1 (TRUE) will return a value from 0 to rowsize_ - 1
0 (FALSE) will return a value from 0 to rowsize_
1 will return value possibly greater than rowsize_
Return closest hex area column given x display position Inside determines the numbers returned for columns above rowsize_ 1 ( TRUE ) will return a value from 0 to rowsize_ - 1 0 ( FALSE ) will return a value from 0 to rowsize_ 1 will return value possibly greater than rowsize_
// Make sure col is within valid range
