PlanetSquires Forums

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: CWindow SetupScrollBars  (Read 956 times)

Paul Squires

  • Administrator
  • Guru Member
  • *****
  • Posts: 9389
  • Windows 10
    • PlanetSquires Software
CWindow SetupScrollBars
« on: September 15, 2019, 08:59:56 PM »

Seems to be a little bit of dead code in there and a slight typo:

Code: [Select]
PRIVATE SUB CScrollWindow.SetupScrollbars

   'DIM bMaximized AS LONG,
   dim tempRect AS RECT 

   GetClientRect(m_hwnd, @tempRect)
   'GetWindowPlacement(m_hwnd, @wp)
   'bMaximized = (wp.showCmd = SW_MAXIMIZE)

   ' // Calculate how many scrolling increments for the client area
   m_nHorzInc = ((m_ClientRect.Right - m_ClientRect.Left) - (tempRect.Right  - tempRect.Left) ) \ m_HorzUnits
   'm_nVertInc = ((m_ClientRect.Bottom - m_ClientRect.Top) - (tempRect.bottom - tempRect.Top ) ) \ m_HorzUnits
   m_nVertInc = ((m_ClientRect.Bottom - m_ClientRect.Top) - (tempRect.bottom - tempRect.Top ) ) \ m_VertUnits

I am looking at trying to set up the code so that the scroll thumb grows in size to represent the percentage of how much the child clientrect fills the parent clientrect. I am also trying to simply a lot of the calls by using setting the ScrollInfo structure and calling SetScrollInfo.
If I get it all working okay then I will send along those changes.
Paul Squires
PlanetSquires Software
WinFBE Editor and Visual Designer