예제 #1
0
  /**
   * Returns a pointer to the row 
   */
  BGRColor *GetRow(unsigned row) {
#ifndef USE_GDI
    return GetTopRow() + corrected_width * row;
#else
    return GetTopRow() - corrected_width * row;
#endif
  }
예제 #2
0
// Update Cursor Rect
void Window_Selectable::UpdateCursorRect() {
	int cursor_width = 0;
	int x = 0;
	if (index < 0) {
		SetCursorRect(Rect());
		return;
	}
	int row = index / column_max;
	if (row < GetTopRow()) {
		SetTopRow(row);
	} else if (row > GetTopRow() + (GetPageRowMax() - 1)) {
		SetTopRow(row - (GetPageRowMax() - 1));
	}

	if (column_max > 1){
		cursor_width = (width / column_max - 16) + 12;
		x = (index % column_max * cursor_width) - 4 ;
	}
	else{
		cursor_width = (width / column_max - 16) + 8;
		x = (index % column_max * (cursor_width + 16)) - 4;
	}

	int y = index / column_max * 16 - oy;
	SetCursorRect(Rect(x, y, cursor_width, 16));

}