Print Page | Close Window

mixed checkbox

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Property Grid
Forum Description: Topics Related to Codejock Property Grid
URL: http://forum.codejock.com/forum_posts.asp?TID=6445
Printed Date: 13 May 2024 at 8:35pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: mixed checkbox
Posted By: esc67
Subject: mixed checkbox
Date Posted: 17 February 2007 at 3:15am

Can you add a "Mixed" property for CXTPPropertyGridItemBool?

Here's my override (for 10.4.2)
 

 BOOL OnDrawItemValue(CDC& dc, CRect rcValue)
 {
  if (!m_bCheckBoxStyle)
   return FALSE;
  CRect rcSample(rcValue.left - 1, rcValue.CenterPoint().y - 6, rcValue.left - 1 + 13, rcValue.CenterPoint().y + 7);
  CXTPPropertyGridPaintManager* pPaintManager = m_pGrid->GetPaintManager();
  if (pPaintManager->m_buttonsStyle == xtpGridButtonsThemed && pPaintManager->m_themeButton.IsAppThemed())
  {
   int style =
    GetReadOnly()
     ? (isMultiValue()
      ? CBS_MIXEDDISABLED
      : (GetBool() ? CBS_CHECKEDDISABLED : CBS_UNCHECKEDDISABLED)
     )
     : (isMultiValue()
      ? CBS_MIXEDNORMAL
      : (GetBool() ? CBS_CHECKEDNORMAL : CBS_UNCHECKEDNORMAL)
     );
   pPaintManager->m_themeButton.DrawThemeBackground(dc, BP_CHECKBOX, style, rcSample, 0);
  }
  else
  {
   dc.DrawFrameControl(rcSample, DFC_BUTTON, DFCS_BUTTONCHECK |
    (GetReadOnly() ? DFCS_INACTIVE : 0) | (GetBool() ? DFCS_CHECKED : 0));
  }
  return TRUE;
 }



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net