Print Page | Close Window

CXTPPropertyGridItemDate

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=16601
Printed Date: 28 September 2024 at 4:21am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: CXTPPropertyGridItemDate
Posted By: restlessone
Subject: CXTPPropertyGridItemDate
Date Posted: 15 April 2010 at 10:13am
Hello!
With version of 13.0.0 i used this code and got notification when user changed date by selecting it on dropdown calendar control and when user typed date manually too.

class CUIPropertyDate : public CXTPPropertyGridItemDate
{
   ...
   virtual void OnValueChanged(CString strValue)
   {
     // want notification here!
   }
};

Now with version 13.3.1 i'm getting notification only when user typed date manually, but when user selecting it on calendar control - no more notification.

Do i something wrong or it's a bug of new version ?



Replies:
Posted By: restlessone
Date Posted: 19 April 2010 at 6:35am
So, sources:

void CXTPPropertyGridInplaceMonthCal::OnAccept()
{
     SYSTEMTIME sysTime;
     ::SendMessage(m_hWnd, MCM_GETCURSEL, 0, (LPARAM) &sysTime);

     sysTime.wHour = sysTime.wMinute = sysTime.wSecond = sysTime.wMilliseconds = 0;

     COleDateTime dtSelected(sysTime);

     CString str = m_pItem->Format(dtSelected);
     CString strBeforeEdit = str;

     CXTPPropertyGridItemDate* pItem = m_pItem;
     m_pItem = NULL;

     ShowWindow(SW_HIDE);
     ReleaseCapture();
     PostMessage(WM_CLOSE);

     if (pItem->OnAfterEdit(str))
     {
          if (strBeforeEdit == str) // Can changed in OnAfterEdit handler
          {
               pItem->SetDate(dtSelected);
               pItem->NotifyValueChanged();
          }
          else

          {
           pItem->OnValueChanged(str);
          }
     }
}

Blue strings was added in 13.3.1 and now red string seems always unreachable. So it's bug ?

Somebody can tell me, is there any other way to get more faster tech. support here ? Or i must wait for an answer for a weeks ? :)



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