Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Toolkit Pro
  New Posts New Posts RSS Feed - CPropertyGridItemBool bug
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

CPropertyGridItemBool bug

 Post Reply Post Reply
Author
Message
tmolander View Drop Down
Newbie
Newbie


Joined: 11 April 2006
Location: Finland
Status: Offline
Points: 3
Post Options Post Options   Thanks (0) Thanks(0)   Quote tmolander Quote  Post ReplyReply Direct Link To This Post Topic: CPropertyGridItemBool bug
    Posted: 05 May 2006 at 4:37am

What happens if Bool item has a child or children and you try to check/uncheck the check box (SetCheckBoxStyle(TRUE) has been called for the item)? Item is expanded and check box is not selected! Here's why:

BOOL CXTPPropertyGridItemBool::OnKeyDown (UINT nChar)
{
 if (m_bCheckBoxStyle && !GetReadOnly() && (nChar == VK_SPACE))
 {
  OnLButtonDblClk();
  return TRUE;
 }
 return FALSE;
}

BOOL CXTPPropertyGridItemBool::OnLButtonDown(UINT nFlags, CPoint point)
{
 if (!CXTPPropertyGridItem::OnLButtonDown(nFlags, point))
  return FALSE;

 if (m_bCheckBoxStyle)
 {
  CRect rc = GetValueRect();
  rc.right = rc.left + 15;

  if (rc.PtInRect(point) && !GetReadOnly())
  {
   OnLButtonDblClk();
  }
 }

 return TRUE;
}

OnLButtonDblClk() is called but value is not changed!

Fix? Thanks.

 

Back to Top
Oleg View Drop Down
Senior Member
Senior Member


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post Posted: 05 May 2006 at 9:06am

Hello,

It was  already fixed in 10.1 release.

Was added parameters to OnLButtonDblClk:

BOOL CXTPPropertyGridItemBool::OnKeyDown (UINT nChar)
{
 if (m_bCheckBoxStyle && !GetReadOnly() && (nChar == VK_SPACE))
 {
  CRect rc = GetValueRect();
  OnLButtonDblClk(0, rc.CenterPoint());

  return TRUE;
 }
 return FALSE;
}

void CXTPPropertyGridItemBool::OnLButtonDblClk(UINT nFlags, CPoint point)
{
 if (m_bCheckBoxStyle && PtInValueRect(point) && !GetReadOnly())
 {
  OnSelect();
  SelectNextConstraint();
 }
 else
 {
  CXTPPropertyGridItem::OnLButtonDblClk(nFlags, point);
 }
}

etc.

Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.047 seconds.