Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Controls
  New Posts New Posts RSS Feed - CXTPControlScrollBar::OnScroll Bug
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

CXTPControlScrollBar::OnScroll Bug

 Post Reply Post Reply
Author
Message
Simon HB9DRV View Drop Down
Senior Member
Senior Member
Avatar

Joined: 07 July 2005
Location: Switzerland
Status: Offline
Points: 458
Post Options Post Options   Thanks (0) Thanks(0)   Quote Simon HB9DRV Quote  Post ReplyReply Direct Link To This Post Topic: CXTPControlScrollBar::OnScroll Bug
    Posted: 12 August 2009 at 3:47pm
Hi All,
 
With 12.0.1 there's a bug in void CXTPControlScrollBar::OnScroll(UINT nSBCode, UINT nPos), you are not using m_nMin in the switch statement
I've created my own class from CXTPControlScrollBar but I'm sure you'll want to fix this (if you haven't already).
 
While you're at it you may want to add a member function to set m_nPage
Simon HB9DRV
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: 13 August 2009 at 1:53am
Guess it was fixed already. Here code we have now:
 
switch (nSBCode)
 {
  case SB_TOP: nCurPos = m_nMin; break;
  case SB_BOTTOM: nCurPos = m_nMax; break;
  case SB_LINEUP: nCurPos = max(nCurPos - 1, m_nMin); break;
  case SB_LINEDOWN: nCurPos = min(nCurPos + 1, m_nMax); break;
  case SB_THUMBTRACK: nCurPos = nPos; break;
  case SB_PAGEUP: nCurPos = max(nCurPos - m_nMax / 10, m_nMin); break;
  case SB_PAGEDOWN: nCurPos = min(nCurPos + m_nMax / 10, m_nMax); break;
 }
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
Simon HB9DRV View Drop Down
Senior Member
Senior Member
Avatar

Joined: 07 July 2005
Location: Switzerland
Status: Offline
Points: 458
Post Options Post Options   Thanks (0) Thanks(0)   Quote Simon HB9DRV Quote  Post ReplyReply Direct Link To This Post Posted: 13 August 2009 at 3:15am
OK, well done:)
 
Just make sure you add a member function so that the page size can be set.
 
I'll be upgrading later this year...
Simon HB9DRV
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.125 seconds.