Print Page | Close Window

Problems with vertical scrollbar

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=3147
Printed Date: 21 November 2024 at 4:53pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Problems with vertical scrollbar
Posted By: farr02
Subject: Problems with vertical scrollbar
Date Posted: 03 November 2005 at 7:39am
Hello,
I have two problems with the vertical scrollbar in the property-grid. I have added two more categories to the GridSample. They only hold one variable height item each. When these categories are expanded and another category will be expanded so that the visible grid becomes bigger than the corresponding window the vertical scrollbar does not appear. The image below shows this problem:



The second problem may have the same cause as the first one. After expanding another category the vertical scrollbar appears but its length is incorrect. When I click it, the scrollbar gets shorter. See the second picture.



It looks like a problem in calculating the correct height of the grid. I hope someone can help me.

Best regards,
   Holger




Replies:
Posted By: Oleg
Date Posted: 04 November 2005 at 12:49am
Hmmm... using 9.80 I can't reproduce it... Can you download evaluation version and check if problem was fixed?

-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS


Posted By: farr02
Date Posted: 04 November 2005 at 3:19am
Hello Oleg,
I am already using XTP v. 9.80 together with Visual Studio 6.0.
I can produce the problem as follows:
I add the following code

        pCustom = m_wndPropertyGrid.AddCategory(_T("Height:  72"));
        pItem = pCustom->AddChildItem(new CXTPPropertyGridItem(_T("Variable Height 1"), _T("Height 72")));
        pItem->SetHeight(72);

        pCustom = m_wndPropertyGrid.AddCategory(_T("Height: 144"));
        pItem = pCustom->AddChildItem(new CXTPPropertyGridItem(_T("Variable Height 2"), _T("Height 144")));
        pItem->SetHeight(144);

to the OnInitDialog-function of CPropertyGridDlg-class (in file PropertyGridDlg.cpp of GridSample, right behind the "Custon Buttons"-category).
Then I run the application, enlarge the window a little bit (currently it has a height of 510  pixel, width doesn't matter), expand the "Height: 72"-category, after that expand the "Height: 144"-category and get no scrollbar but nearly half of the "Height: 144"-item is invisible. If you collapse "Height: 72"-category and expand it again a scrollbar occurs but it has a wrong length as you can see the length of the bar changing, when clicking on it.

BTW if the window is a little bit bigger (lets say height about 520 pixel) no scrollbar occurs when expanding/collapsing "Height: 72"-category ("Height: 144"-category remains expanded). But also half of the "Height: 144"-category is not visible.

Hope this helps you to reproduce the error.

Bye
   Holger




Posted By: Oleg
Date Posted: 04 November 2005 at 4:47am

Yes, catched it.

Actually seems it is standard ListBox control bug - it not refresh scrollbar after SetItemHeight for LBS_OWNERDRAWVARIABLE items.

Trying to find workaround.



-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS


Posted By: cpede
Date Posted: 20 July 2012 at 10:19am
Did you ever find a solution for this problem?
 
It is even more visible when using the CXTPMarkupListBox control.
 
-cpede


-------------
Product: Xtreme ToolkitPro (24.0.0)
Platform: Windows 10 (x64)
Language: Visual Studio 2017 (C++)


Posted By: farr02
Date Posted: 14 August 2012 at 5:30am
Hello cpede,

sorry for the delay but I have to do some Java programming since a couple of weeks...
No, I haven't found a solution or workaround for the problem you mentioned. To be honest I haven't looked for a solution very hard because it is marked as a minor and hard to detect problem in our software. (And I relied on Oleg;-) But I am still interested in a solution.

Best regards,
   Holger.


-------------
Product: Xtreme Toolkit Pro version 16.3.1, 18.4.0

Platform: Windows 10 (64 Bit)

Language: Visual C++ 15.0 (Visual Studio 2017)


Posted By: farr02
Date Posted: 14 August 2012 at 10:33am
Hello again,

when I add the following code to the OnGridNotify function of the PropertyGrid sample (together with the above mentioned variable heights items) I get a correct scrollbar behavior:


if(wParam == XTP_PGN_ITEMEXPANDCHANGED)
{
    CXTPPropertyGridItem* pItem = (CXTPPropertyGridItem*)lParam;
    if (pItem)
    {
        pItem->GetGrid()->SetTopIndex(pItem->GetGrid()->GetTopIndex());
    }
}


I don't know what side effects the above code has, but during debugging the PropertyGrid sample I saw that CListBox::SetTopIndex recalculates the scrollbar. So I just gave it a try. It is not what I would tell a good solution but maybe it can be a hint for the CodeJock team on how to improve the library code.

Bye
   Holger.



-------------
Product: Xtreme Toolkit Pro version 16.3.1, 18.4.0

Platform: Windows 10 (64 Bit)

Language: Visual C++ 15.0 (Visual Studio 2017)


Posted By: farr02
Date Posted: 14 August 2012 at 11:24am
Hello,

it also works when replacing the
pItem->GetGrid()->SetTopIndex(pItem->GetGrid()->GetTopIndex());
line with
pItem->GetGrid()->SetCurSel(pItem->GetIndex());
.
Maybe one can add
m_pGrid->SetCurSel(m_nIndex);
to the library function
CXTPPropertyGridItem::Expand()

This should fix the problem.

Bye
   Holger.


-------------
Product: Xtreme Toolkit Pro version 16.3.1, 18.4.0

Platform: Windows 10 (64 Bit)

Language: Visual C++ 15.0 (Visual Studio 2017)



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