![]() |
Problem with CCustomItemSlider in PropertyGrid. |
Post Reply ![]() |
Author | |
Ronney ![]() Newbie ![]() Joined: 31 March 2008 Location: Brazil Status: Offline Points: 4 |
![]() ![]() ![]() ![]() ![]() Posted: 08 July 2013 at 2:01pm |
Since version 16.1.0 I'm having an issue with CCustomItemSlider, from Property Grid sample: When the user clicks on the bar, it becomes black and It's not possible to drag the slider cursor also. The problem occurs on the sample program also.
![]() |
|
![]() |
|
Ronney ![]() Newbie ![]() Joined: 31 March 2008 Location: Brazil Status: Offline Points: 4 |
![]() ![]() ![]() ![]() ![]() |
I figured out how to use CXTPPropertyGridItem::AddSliderControl(). But it solves the problem partially. The 'black issue' does not appears anymore, but I still cannot drag the cursor.
If I insist dragging, the software crashes, falling in the condition bellow, the same with the PropertyGrid sample program: Output: HEAP[playlist.exe]: HEAP: Free Heap block 05CE0D28 modified at 05CE0DF4 after it was freed Windows has triggered a breakpoint in playlist.exe. This may be due to a corruption of the heap, which indicates a bug in playlist.exe or any of the DLLs it has loaded. Callstack: ntdll.dll!_RtlpBreakPointHeap@4() + 0x20 bytes ntdll.dll!@RtlpAllocateHeap@24() + 0x33167 bytes ntdll.dll!_RtlAllocateHeap@12() + 0x11f70 bytes ntdll.dll!_RtlDebugAllocateHeap@12() + 0xcc bytes ntdll.dll!@RtlpAllocateHeap@24() + 0x32ff9 bytes ntdll.dll!_RtlAllocateHeap@12() + 0x11f70 bytes user32.dll!_UserRtlAllocMem@4() + 0x16 bytes user32.dll!_MBToWCSEx@24() + 0x118ce bytes user32.dll!_DrawTextExA@24() + 0x3a bytes user32.dll!_DrawTextA@20() + 0x3d bytes > Playlist.exe!CDC::DrawTextA(const char * lpszString, int nCount, tagRECT * lpRect, unsigned int nFormat) Line 596 + 0x15 bytes C++ Playlist.exe!CXTPPropertyGridPaintManager::FillPropertyGrid(CDC * pDC) Line 283 + 0x14 bytes C++ Playlist.exe!CXTPPropertyGrid::OnPaint() Line 497 C++ Playlist.exe!CWnd::OnWndMsg(unsigned int message, unsigned int wParam, long lParam, long * pResult) Line 2460 C++ Playlist.exe!CXTPPropertyGrid::OnWndMsg(unsigned int message, unsigned int wParam, long lParam, long * pResult) Line 1615 + 0x13 bytes C++ Playlist.exe!CWnd::WindowProc(unsigned int message, unsigned int wParam, long lParam) Line 2137 + 0x17 bytes C++ |
|
![]() |
|
Ronney ![]() Newbie ![]() Joined: 31 March 2008 Location: Brazil Status: Offline Points: 4 |
![]() ![]() ![]() ![]() ![]() |
SOLVED:
Comparing the source code with version 15.3.1, I found the line "m_pGrid->Refresh()" out of place: void CXTPPropertyGridItem::OnMarkupChanged() { // update markup XTPMarkupReleaseElement(m_pMarkupValue); if (!m_pGrid || !m_pGrid->m_pGrid) return; if (m_pGrid->m_pGrid->GetMarkupContext() && GetMarkupTemplate().GetLength()) { CString final_markup = GetMarkupTemplate(); final_markup.Replace(XTP_PG_ITEMVALUE_TO_REPLACE_IN_MARKUP, GetValue()); m_pMarkupValue = XTPMarkupParseText(m_pGrid->m_pGrid->GetMarkupContext(), final_markup); } m_pGrid->Refresh(); // to force call MeasureItem, markup should be changed } Previously it was inside the last 'if': void CXTPPropertyGridItem::OnMarkupChanged() { // update markup XTPMarkupReleaseElement(m_pMarkupValue); if (!m_pGrid || !m_pGrid->m_pGrid) return; if (m_pGrid->m_pGrid->GetMarkupContext() && GetMarkupTemplate().GetLength()) { CString final_markup = GetMarkupTemplate(); final_markup.Replace(XTP_PG_ITEMVALUE_TO_REPLACE_IN_MARKUP, GetValue()); m_pMarkupValue = XTPMarkupParseText(m_pGrid->m_pGrid->GetMarkupContext(), final_markup); m_pGrid->Refresh(); // to force call MeasureItem, markup should be changed } } |
|
![]() |
Post Reply ![]() |
|
Tweet
|
Forum Jump | Forum Permissions ![]() You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |