BOOL CXTPPropertyGridItemBool::PtInCheckBoxRect(CPoint point)
{
	CRect rc = GetValueRect();
	rc.right = rc.left + 15;

	return rc.PtInRect(point);
}
void CCustomItemButtonGV::CreateButton()
{
	if (IsVisible())
	{	
		CRect rc;
		if (m_bFullRowButton)
		{		
			rc = GetItemRect();
			rc.DeflateRect( m_nIndent * 18, 0, 0, 1);
		} else
		{
			rc = GetValueRect();
		}


		if (!m_wndButton.m_hWnd)
		{
			m_wndButton.Create(m_strButtonText, WS_CHILD|BS_FLAT|BS_NOTIFY|WS_VISIBLE|BS_OWNERDRAW, rc, (CWnd*)m_pGrid, 100);
			m_wndButton.SetFont(&m_wndFont);
			//m_wndButton.SetTheme(new CXTButtonThemeOffice2003(TRUE));//主题冲突了
		}
		if (m_wndButton.GetChecked() != m_bValue) m_wndButton.SetChecked(m_bValue);
		m_wndButton.MoveWindow(rc);
		m_wndButton.Invalidate(FALSE);
	}
	else
	{
		m_wndButton.DestroyWindow();
	}
}
BOOL CXTPPropertyGridItemBool::OnKeyDown (UINT nChar)
{
	if (m_bCheckBoxStyle && IsAllowEdit() && (nChar == VK_SPACE))
	{
		CRect rc = GetValueRect();
		OnLButtonDblClk(0, rc.CenterPoint());

		return TRUE;
	}
	return FALSE;
}