/*
 * Copyright (c) 2002 Robert Collins.
 * Copyright (c) 2005-2006 Tom N Harris.
 *
 *     This program is free software; you can redistribute it and/or modify
 *     it under the terms of the GNU General Public License as published by
 *     the Free Software Foundation; either version 2 of the License, or
 *     (at your option) any later version.
 *
 *     A copy of the GNU General Public License can be found at
 *     http://www.gnu.org/
 *
 * Written by Robert Collins <robertc@hotmail.com>
 * Written by Tom N Harris <telliamed@whoopdedo.org>
 *
 */

#include "PickLine.h"
#include "PickView.h"

using namespace Setup;

void
PickLine::DrawCheck(PickView & view, HDC hdc, HRGN clip, int x, int y, CheckState checked)
{
	HDC bitmap_dc;
	switch (checked)
	{
	case CheckStateUnchecked:
		bitmap_dc = view.GetBitmapDC(VIEW_BITMAPCHECKNO); break;
	case CheckStateChecked:
		bitmap_dc = view.GetBitmapDC(VIEW_BITMAPCHECKYES); break;
	case CheckStateIndeterminate:
		bitmap_dc = view.GetBitmapDC(VIEW_BITMAPCHECKNA); break;
	default:
		return;
	}
  
	if (clip)
		::IntersectClipRect(hdc, x, y, x + CHECK_SIZE + ICON_MARGIN, y + CHECK_SIZE);
	::BitBlt(hdc, x + ICON_MARGIN / 2, y, CHECK_SIZE, CHECK_SIZE, bitmap_dc, 0, 0, SRCCOPY);
	if (clip)
		::SelectClipRgn(hdc, clip);
}

