• Welcome to PlanetSquires Forums.
 

CWindow SetupScrollBars

Started by Paul Squires, September 15, 2019, 08:59:56 PM

Previous topic - Next topic

Paul Squires

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


PRIVATE SUB CScrollWindow.SetupScrollbars

   'DIM bMaximized AS LONG,
   ', wp AS WINDOWPLACEMENT
   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