Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Toolkit Pro
  New Posts New Posts RSS Feed - ContScroll()
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

ContScroll()

 Post Reply Post Reply
Author
Message
Plamen.Petrov View Drop Down
Groupie
Groupie


Joined: 22 June 2016
Location: Bulgaria
Status: Offline
Points: 12
Post Options Post Options   Thanks (0) Thanks(0)   Quote Plamen.Petrov Quote  Post ReplyReply Direct Link To This Post Topic: ContScroll()
    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
Back to Top
Plamen.Petrov View Drop Down
Groupie
Groupie


Joined: 22 June 2016
Location: Bulgaria
Status: Offline
Points: 12
Post Options Post Options   Thanks (0) Thanks(0)   Quote Plamen.Petrov Quote  Post ReplyReply Direct Link To This Post 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.

Back to Top
agontarenko View Drop Down
Admin Group
Admin Group


Joined: 25 March 2016
Status: Offline
Points: 275
Post Options Post Options   Thanks (0) Thanks(0)   Quote agontarenko Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
Plamen.Petrov View Drop Down
Groupie
Groupie


Joined: 22 June 2016
Location: Bulgaria
Status: Offline
Points: 12
Post Options Post Options   Thanks (0) Thanks(0)   Quote Plamen.Petrov Quote  Post ReplyReply Direct Link To This Post 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




Back to Top
agontarenko View Drop Down
Admin Group
Admin Group


Joined: 25 March 2016
Status: Offline
Points: 275
Post Options Post Options   Thanks (0) Thanks(0)   Quote agontarenko Quote  Post ReplyReply Direct Link To This Post Posted: 30 July 2024 at 2:46am
Hello,

How I can to reproduce this problem?

Regards,
Artem Gontarenko
Back to Top
Plamen.Petrov View Drop Down
Groupie
Groupie


Joined: 22 June 2016
Location: Bulgaria
Status: Offline
Points: 12
Post Options Post Options   Thanks (0) Thanks(0)   Quote Plamen.Petrov Quote  Post ReplyReply Direct Link To This Post 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

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.219 seconds.