Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Property Grid
  New Posts New Posts RSS Feed - Problems with vertical scrollbar
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Problems with vertical scrollbar

 Post Reply Post Reply
Author
Message
farr02 View Drop Down
Groupie
Groupie


Joined: 10 May 2005
Status: Offline
Points: 51
Post Options Post Options   Thanks (0) Thanks(0)   Quote farr02 Quote  Post ReplyReply Direct Link To This Post Topic: Problems with vertical scrollbar
    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

Back to Top
Oleg View Drop Down
Admin Group
Admin Group


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: 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
Back to Top
farr02 View Drop Down
Groupie
Groupie


Joined: 10 May 2005
Status: Offline
Points: 51
Post Options Post Options   Thanks (0) Thanks(0)   Quote farr02 Quote  Post ReplyReply Direct Link To This Post 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


Back to Top
Oleg View Drop Down
Admin Group
Admin Group


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: 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
Back to Top
cpede View Drop Down
Senior Member
Senior Member


Joined: 13 August 2004
Location: Denmark
Status: Offline
Points: 645
Post Options Post Options   Thanks (0) Thanks(0)   Quote cpede Quote  Post ReplyReply Direct Link To This Post 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 (20.3.0)
Platform: Windows 10 (x64)
Language: Visual Studio 2017 (C++)
Back to Top
farr02 View Drop Down
Groupie
Groupie


Joined: 10 May 2005
Status: Offline
Points: 51
Post Options Post Options   Thanks (0) Thanks(0)   Quote farr02 Quote  Post ReplyReply Direct Link To This Post 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)
Back to Top
farr02 View Drop Down
Groupie
Groupie


Joined: 10 May 2005
Status: Offline
Points: 51
Post Options Post Options   Thanks (0) Thanks(0)   Quote farr02 Quote  Post ReplyReply Direct Link To This Post 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)
Back to Top
farr02 View Drop Down
Groupie
Groupie


Joined: 10 May 2005
Status: Offline
Points: 51
Post Options Post Options   Thanks (0) Thanks(0)   Quote farr02 Quote  Post ReplyReply Direct Link To This Post 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)
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.203 seconds.