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 » Scrollbar in CIconListBox does not use the selected theme Collapse All
Subject Author Date
Torsten Schucht Jan 15, 2008 - 12:12 PM

Hello Support Team,

I am using your CIconListBox from the IconEditor Example. The box works fine, but it does not use the paint manager for the scrollbar. Some time ago you have send me a template class which make themed scrollbars available to the CExtGridWnd. That template does not work with the CIconListbox:
template < class _BT >
class CExtNicerScrollBarsT : public _BT
{
public:
mutable CExtScrollBar m_wndScrollBarH, m_wndScrollBarV;
protected:
bool _EnsureScrollBarsCreated() const
{
if( m_wndScrollBarH.GetSafeHwnd() != NULL
&& m_wndScrollBarV.GetSafeHwnd() != NULL
)
return true;
m_wndScrollBarH.m_eSO = CExtScrollBar::__ESO_BOTTOM;
m_wndScrollBarV.m_eSO = CExtScrollBar::__ESO_RIGHT;
if( m_wndScrollBarV.GetSafeHwnd() == NULL )
{
if( ! m_wndScrollBarV.Create(
WS_CHILD|WS_VISIBLE|SBS_VERT|SBS_RIGHTALIGN,
CRect(0,0,0,0),
((CWnd*)this),
1
)
)
{
ASSERT( FALSE );
return false;
}
}
if( m_wndScrollBarH.GetSafeHwnd() == NULL )
{
if( ! m_wndScrollBarH.Create(
WS_CHILD|WS_VISIBLE|SBS_HORZ|SBS_BOTTOMALIGN,
CRect(0,0,0,0),
((CWnd*)this),
2
)
)
{
ASSERT( FALSE );
return false;
}
}
m_wndScrollBarH.SyncReservedSpace( &m_wndScrollBarV );
m_wndScrollBarV.SyncReservedSpace( &m_wndScrollBarH );
return true;
}
public:
virtual CScrollBar* GetScrollBarCtrl(int nBar) const
{
ASSERT_VALID( this );
switch( nBar )
{
case SB_HORZ:
case SB_VERT:
if( _EnsureScrollBarsCreated() )
{
CExtScrollBar * pScrollBar = ( nBar == SB_HORZ ) ? (&m_wndScrollBarH) : (&m_wndScrollBarV);
ASSERT_VALID( pScrollBar );
ASSERT( pScrollBar->GetSafeHwnd() != NULL );
return pScrollBar;
}
break;
}
return NULL;
}
};

In our case the CIconListbox is derived from CListBox and COleDropTarget (to support Drag’n’Drop).

Do you have a suggestion, what I should do?

Thanks in advance.

Torsten

Technical Support Mar 17, 2008 - 11:08 AM

The scroll bars are already skinned in Prof-UIS 2.83, including the ProfSkin library and default window non client area scroll bars. You can see skinned scroll bars of common controls in the following sample application:

TestSkinnedNcScrollBars.zip

The list box in the main dialog has a skinned scroll bar. The date picker related dialog page has an edit control with skinned scroll bars. The date browser related dialog page has a rich edit control with skinned scroll bars. The grid related dialog page has a popup list box with skinned scroll bars displayed for font face name selection grid cells.

Torsten Schucht Mar 14, 2008 - 3:57 AM

I don’t want to put the bite on you, but your last post is now older than a month and you told me that you would have a solution within ca. 10 days. Could please give me an update on the schedule ?

Thx
Torsten

Technical Support Feb 5, 2008 - 11:31 AM

We are working on skinned built-in scroll bars for all controls in Prof-UIS and the update will be available in approximately ten days. We will provide you with this update as soon as it is ready.

Torsten Schucht Feb 5, 2008 - 2:53 AM

Thanks for that information. This works quite good. But there is one issue we have not been able to resolve.
We have a resizeable dialog (CExtResizableDialog) (DlgA) which embedds another resizeable dialog (DlgB). Both dialogs use anchoring for correct resizig. The resizing works fine for DlgA and DlgB. When we now add a skinned Listbox to DlgB, the resizing stops working for DlgB but is still working for DlgA.
This problem does not occur, if we insert a skinned listbox directly in DlgA without having an embedded DlgB.

Any ideas?

Torsten

Technical Support Jan 17, 2008 - 4:00 AM

The CExtNicerScrollBarsT template class (the CExtNSB template class inside Prof-UIS 2.82) is designed to be used with CExtScrollWnd-derived classes like CExtGridWnd. This class uses two scroll bar common controls. All the scrollable common controls (list view, tree view, and list box) are not designed to be used with scroll bar common controls. They rather use a scroll bar like window non-client areas. We are working on an improvement for the CExtNCW template class so it will enable you to work with child windows and replace their scroll bar like areas. At this moment you can try the following solution:

http://www.codeproject.com/KB/dialog/skinscrollbar.aspx

And try the following test project that is based on it but that uses Prof-UIS skinned scroll bars:

http://www.prof-uis.com/download/forums/SkinnedScrollBars.zip