Print Page | Close Window

ContScroll()

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Toolkit Pro
Forum Description: Topics Related to Codejock Toolkit Pro
URL: http://forum.codejock.com/forum_posts.asp?TID=24488
Printed Date: 16 September 2024 at 11:38am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: ContScroll()
Posted By: Plamen.Petrov
Subject: ContScroll()
Date Posted: 17 July 2024 at 10:19am
Hello,

We integrate CodeJock's Xtreme ToolkitPro v17.2.0 into an old MFC product, and now our client complains, that it happens, that the ListView scrolls sometimes without click on the scrollbar. The user clicks once, but then the scroll starts and doesn't end until the cursor moves outside the scroll bar.

We make a breakpoint into the OnVScroll() handler and find, that in these case the stack shows, that we are into the method CXTPSkinObjectFrame::ContScroll(). 

Unfortunatelly, we can find how to switch off this feature. Is there a flag, option or any other way to prevent such unwanted auto scroll?

Thanks,
Plamen



Replies:
Posted By: Plamen.Petrov
Date Posted: 19 July 2024 at 5:16am
I've found a solution, looking into the SDK code. The Listview class sets a flag into the OnNcLButtonDown() handler, and the OnVScroll() removes this flag. When the OnVScroll() is called and this flag is not set, it calls the next function:

void EndAutoScroll(HWND hWnd)
{
CXTPSkinManager* pSM = XTPSkinManager();
if (!pSM)
return;

CXTPSkinObject* pSO = pSM->Lookup(hWnd);
if (!pSO)
return;

CXTPSkinObjectFrame* pOF = dynamic_cast<CXTPSkinObjectFrame*>(pSO);
if (!pOF)
return;
XTP_SKINSCROLLBAR_TRACKINFO* pSBTrack = pOF->GetScrollBarTrackInfo();
if (pSBTrack && pSBTrack->hTimerSB)
{
pSBTrack->cmdSB = 0;
ReleaseCapture();

::KillTimer(hWnd,pSBTrack->hTimerSB);

pSBTrack->hTimerSB = 0;
pSBTrack->hWndSBNotify = NULL;
}
}

I'm not very happy with such hack - better would be to be possible to control such a feature so it could be switched off.



Posted By: agontarenko
Date Posted: 25 July 2024 at 2:33am
Hello,

Unfortunately it is not clear what exactly is going wrong. Can you please provide more detailed information.
If it cannot be re-produced in any of our sample applications provided
I would appreciate you sending a sample application so that we could debug it.

17.2 is very old version. You can to try last Codejock 22.1 (or 24 beta) version, and may be this problem already resolved.

Regards,
Artem Gontarenko


Posted By: Plamen.Petrov
Date Posted: 25 July 2024 at 10:06am
Hello,

What happens is: the user works with a listview, showing huge amount of image thumnails, which are loaded dynamically - during scrolling the list. He starts scrolling down, clicks several times on the scrollbar and then releases the left mouse button. But then the list continues to scroll down without any user interaction. 

I've already found it into the source code of the CodeJock SDK, setting a breakpoint into the our OnVScroll() handler - we handle OnNcLButtonDown(), where we set a flag on a click on the scrollbar, and OnVScroll() removes it after it handles the scroll. 

So, the breakpoint is where the scroll comes without any click - then the stack shows, that the execution is into CodeJock's ContScroll() - it creates a timer which triggers another WM_VSCROLL, etc... 

Very complicated mechanism, which I've succeeded to stop - but the solution is a kind of a hack, so I'm wondering isn't it possible to switch it off somehow else.

Regards,
Plamen






Posted By: agontarenko
Date Posted: 30 July 2024 at 2:46am
Hello,

How I can to reproduce this problem?

Regards,
Artem Gontarenko


Posted By: Plamen.Petrov
Date Posted: 30 July 2024 at 7:42am
Hello,

Unfortunately, to write a test application would take a couple of days - time which I don't have currently. 

But you could check why in CXTPScrollBase::ContScroll(), when pSBTrack->fHitOld is TRUE, a timer is created which calls ContScroll() again - it might be possible to switch it off by a property or maybe flag:

void CXTPScrollBase::ContScroll()
{
XTP_SCROLLBAR_TRACKINFO *pSBTrack = m_pSBTrack;
ASSERT(pSBTrack);

if (pSBTrack == NULL)
return;

CPoint pt;
GetCursorPos(&pt);

ScreenToClient(m_pSBTrack->hWndTrack, &pt);

TrackBox(WM_NULL, pt);

if (pSBTrack->fHitOld)
{
pSBTrack->hTimerSB = SetTimer(m_pSBTrack->hWndTrack, IDSYS_SCROLL, m_nTimerElapse = GetDoubleClickTime() / 10, NULL);

DoScroll(pSBTrack->cmdSB, 0);
}
}

Regards,
Plamen




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