ContScroll() |
Post Reply |
Author | |
Plamen.Petrov
Groupie Joined: 22 June 2016 Location: Bulgaria Status: Offline Points: 12 |
Post Options
Thanks(0)
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
|
|
Plamen.Petrov
Groupie Joined: 22 June 2016 Location: Bulgaria Status: Offline Points: 12 |
Post Options
Thanks(0)
|
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. |
|
agontarenko
Admin Group Joined: 25 March 2016 Status: Offline Points: 293 |
Post Options
Thanks(0)
|
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
|
|
Plamen.Petrov
Groupie Joined: 22 June 2016 Location: Bulgaria Status: Offline Points: 12 |
Post Options
Thanks(0)
|
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 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 |
|
agontarenko
Admin Group Joined: 25 March 2016 Status: Offline Points: 293 |
Post Options
Thanks(0)
|
Hello, Regards, Artem Gontarenko |
|
Plamen.Petrov
Groupie Joined: 22 June 2016 Location: Bulgaria Status: Offline Points: 12 |
Post Options
Thanks(0)
|
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 |
|
agontarenko
Admin Group Joined: 25 March 2016 Status: Offline Points: 293 |
Post Options
Thanks(0)
|
Hello, 24 version already released. Can you check your problem with latest version. Regards, Artem Gontarenko
|
|
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 |