Professional UI Solutions
Site Map   /  Register
 
 

Forum

Please Log In to post a new message or reply to an existing one. If you are not registered, please register.

NOTE: Some forums may be read-only if you are not currently subscribed to our technical support services.

Forums » Prof-UIS Tech Support » CScrollView with themed scroll-bars Collapse All
Subject Author Date
Offer Har Mar 27, 2007 - 6:16 AM

Dear Support,

I have a CScrollView derived class, and it appears with the XP native scroll-bars.
How can I make the scroll bars be Prof-UIS themed?

Thanks,
Ron.

Suhai Gyorgy Mar 27, 2007 - 6:49 AM

You can learn more about themed scrollbars if you look at this sample.

Offer Har Mar 27, 2007 - 7:15 AM

Dear Suhai & Support,

I used your project to skin my scroll-view scroll bars, thanks.
However, there is one problem - the square at the right-bottom side of the view, is not being drawn correctly - it is left with some garbage.
You can see it also in the sample application you referred me to.

How can this be fixed?

Thanks,
Ron.

Offer Har Mar 27, 2007 - 6:58 AM

Dear Suhai & Support,

I think the scroll-bar theme should be an integral part of Prof-UIS.
Some kind of templating that adds the scroll-bar themes should be provided.

Regards,
Ron.

Technical Support Mar 27, 2007 - 7:41 AM

We answered a similar question in this forum thread. You can also see an example of themed scroll bars in the DrawCli sample (the CDrawView class).


Offer Har Mar 27, 2007 - 8:58 AM

Dear Support,

I tried to do exactly what is done in the suggested thread, and no scroll-bars appear.
I tried what Suhai suggested, and it worked - All I did is add this line:

SkinWndScroll(this);

My only problem is the right-bottom square that is not redrawn correctly.

How can this be fixed?

Thanks,
Ron.

Technical Support Mar 28, 2007 - 10:35 AM

This area should be painted manually by your scroll view window. This problem is solved in our CExtScrollWnd class (see the OnSwPaintAreaBetweenScrollBarWindows() method).

Offer Har Mar 28, 2007 - 11:12 AM

Dear Support,

I am using CSkinScrollWnd, so I updated the empty OnPaint with this code:

void CSkinScrollWnd::OnPaint() 
{
	CPaintDC dc(this); // device context for painting

	if (m_sbHorz.IsWindowVisible() && m_sbVert.IsWindowVisible())
	{
		CRect rcH, rcV;
		m_sbHorz.GetWindowRect(rcH);
		m_sbVert.GetWindowRect(rcV);
		ScreenToClient( &rcH );
		ScreenToClient( &rcV );
		CRect rcAreaBetweenScrollBarWindows;
		rcAreaBetweenScrollBarWindows.SetRect( rcV.left, rcH.top, rcV.right, rcH.bottom );

		dc.FillSolidRect(
			&rcAreaBetweenScrollBarWindows,
			g_PaintManager->GetColor( COLOR_3DFACE )
			);
	}
}

And it works.

Regards,
Ron.

Technical Support Mar 29, 2007 - 3:31 AM

The ::IsWindowVisible( hWnd ) code returns TRUE if the hWnd window has the WS_VISIBLE style and if it is not covered completely by any other window, i.e. if it is really visible on the screen. This API is not applicable in the code snippet listed in your message. You should simply check for the presence of the WS_VISIBLE style instead. So you should replace

      if( m_sbHorz.IsWindowVisible() && m_sbVert.IsWindowVisible() )
with
      if( (m_sbHorz.GetStyle()&WS_VISIBLE) != 0 && (m_sbVert.GetStyle()&WS_VISIBLE) != 0 )