#include "stdafx.h"
#include "../include/SelectionBound.h"
#include "../include/ASelection.h"
#include "../include/GridBase.h"
namespace mycell{
SelectionBound::SelectionBound(GridBase* pGrid):pGrid_(pGrid)
{}
//void SelectionBound::DrawErease(HDC hDC)
//{
// //SetROP2(hDC,R2_XORPEN);
// DrawBound(hDC,rcBound_);
//}
//void SelectionBound::DrawBound(HDC hDC,LPCRECT)
//{
// CDCHandle dc(hDC);
// //SetROP2(hDC,R2_XORPEN);
// HBRUSH hOldBrush=dc.SelectBrush((HBRUSH)GetStockObject(NULL_BRUSH));
// CPen pen;
// pen.CreatePen(PS_SOLID,3,RGB(0,0,0));
// HPEN hOldPen=dc.SelectPen(pen);
// dc.Rectangle(&rc);
// dc.SelectPen(hOldPen);
// dc.SelectBrush(hOldBrush);
//}
void SelectionBound::Draw(HDC hDC,LPCRECT lprc)
{
return;
//ASelection* pSel=pGrid_->pSelection_;
/*
CellRange cr=pSel->GetActiveSelection();
cr.Normalize();
RECT rc=pGrid_->get_RangeRect(&cr);
if(rc.top>=lprc->bottom || rc.bottom<=lprc->top
||rc.left>=lprc->right || rc.right<=lprc->left)
return;
CDCHandle dc(hDC);
CPen pen;
{
LOGBRUSH lb;
lb.lbColor=RGB(0,0,0);
lb.lbStyle=BS_SOLID;
lb.lbHatch=0;
pen.Attach(ExtCreatePen(PS_GEOMETRIC|PS_SOLID|PS_ENDCAP_SQUARE,3,&lb,0,NULL));
}
HPEN hOldPen=dc.SelectPen(pen);
RECT rcCell=pGrid_->GetCellRect(cr.first.row-1,cr.first.col);
RECT rcCell1=pGrid_->GetCellRect(cr.first.row-1,cr.second.col);
dc.MoveTo(max(lprc->left,rcCell.left+1),min(lprc->bottom,rcCell.bottom-2));
dc.LineTo(min(lprc->right,rcCell1.right-2),min(lprc->bottom,rcCell.bottom-2));
rcCell=pGrid_->GetCellRect(cr.second.row,cr.second.col);
dc.MoveTo(min(lprc->right,rcCell1.right),max(lprc->top,rcCell1.bottom-2));
dc.LineTo(min(lprc->right,rcCell1.right),min(lprc->bottom,rcCell.bottom-2));
dc.SelectPen(hOldPen);
*/
/*
const static int nInf=5;
if(rc.top<=lprc->top)
rc.top=max(0,lprc->top-nInf);
if(rc.bottom>=lprc->bottom)
rc.bottom=lprc->bottom+nInf;
if(rc.left<=lprc->left)
rc.left=max(0,lprc->left-nInf);
if(rc.right>=lprc->right)
rc.right=lprc->right+nInf;
rcBound_=rc;
DrawBound(hDC,&rc);
*/
}
}//namespace mycell