HexEdit/HexEditView.cpp
int CHexEditView::pos_char(int pos, int inside) const
{
	int col;
	if (display_.vert_display)
	{
		col = (pos - addr_width_*text_width_)/text_width_w_;
		col -= col/(group_by_+1);
	}
	else if (display_.hex_area)
		col = (pos - addr_width_*text_width_ -
			   rowsize_*3*text_width_ - ((rowsize_-1)/group_by_)*text_width_) / text_width_w_;
	else
		col = (pos - addr_width_*text_width_) / text_width_w_;

	// 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 char area column given display (X) coord
// 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 char area column given display (X) coord
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 char area column given display ( X ) coord 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_char(int pos, int inside) const
{
	int col;
	if (display_.vert_display)
	{
		col = (pos - addr_width_*text_width_)/text_width_w_;
		col -= col/(group_by_+1);
	}
	else if (display_.hex_area)
		col = (pos - addr_width_*text_width_ -
			   rowsize_*3*text_width_ - ((rowsize_-1)/group_by_)*text_width_) / text_width_w_;
	else
		col = (pos - addr_width_*text_width_) / text_width_w_;
	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_char ( int pos , int inside ) const { int col ; if ( display_ . vert_display ) { col = ( pos - addr_width_ * text_width_ ) / text_width_w_ ; col -= col / ( group_by_ + 1 ) ; } else if ( display_ . hex_area ) col = ( pos - addr_width_ * text_width_ - rowsize_ * 3 * text_width_ - ( ( rowsize_ - 1 ) / group_by_ ) * text_width_ ) / text_width_w_ ; else col = ( pos - addr_width_ * text_width_ ) / text_width_w_ ; 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 char area column given display (X) coord
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 char area column given display ( X ) coord 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
