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 General Discussion » How can i use CExtScrollbar? Collapse All
Subject Author Date
Jayender V S Jun 26, 2006 - 4:45 AM


hi folks

i want to my change the scroll bar in the document view architecture like this link http://www.prof-uis.com/img/tour_img/ThemedScrollBars.jpg

Thanks

Technical Support Jun 26, 2006 - 1:39 PM

If you are using splitter-enabled views, the CExtSplitterWnd class will apply the themed scrollbars like in the DRAWCLI sample. The themed scroll bars are CExtScrollBar windows. You should create them as child windows of the view window. Additionally, please override the CWnd::GetScrollBarCtrl() virtual method in your view window and return the pointer to the created horizontal and/or vertical CExtScrollBar window dependently on whether the SB_HORZ or SB_VERT type of scroll bar is queried. After that, the view window will use the themed CExtScrollBar window(s) instead of built-in non-client scroll bar like areas. The same technique is used by the CExtScrollWnd class in Prof-UIS. The CExtScrollWnd class is used as the base class for all our scrollable controls including the grids, image editor and toolbox.

Jayender V S Jun 27, 2006 - 1:14 AM

CExtSplitterWnd m_wndBiSplitter;
// i created two window
BOOL CChildFrame::OnCreateClient(LPCREATESTRUCT /*lpcs*/, CCreateContext* pContext)
{
    m_wndBiSplitter.CreateStatic(this, 1,2,WS_CHILD | WS_VISIBLE );
    //m_wndBiSplitter.Create(this, 1,2,CSize(100, 100),pContext);// not working application crash
    CWnd* mywnd1 = AddView(0,0,RUNTIME_CLASS(CSampleView), pContext);
    CWnd* mywnd2=    AddView(0,1,RUNTIME_CLASS(CSampleView), pContext);
}

but i can’t get the CExtScrollbar in the application. help me.

Technical Support Jun 28, 2006 - 7:39 AM

When you use the CExtSplitterWnd class, Prof-UIS scrollbars are created automatically only if the splitter window is dynamic. In you case it is static. Please take see how it is done in the DrawCli sample where a dynamic splitter is used.

Jayender V S Jun 27, 2006 - 12:22 AM

this is my code in the view

CScrollBar* CSampleView::GetScrollBarCtrl(int nBar)
{
    return SB_HORZ;    
}

i changed the splitter window to CExtSplitterWnd. but stil now id id not get the CExtscrollbar. help me.

Thanks

Technical Support Jun 28, 2006 - 7:37 AM

The GetScrollBarCtrl virtual method is called to get a pointer to the specified sibling scroll bar or splitter window.
The nBar variable specifies the type of scroll bar. The parameter can take one of the following values:

SB_HORZ retrieves the position of the horizontal scroll bar
SB_VERT retrieves the position of the vertical scroll bar

So to return SB_HORZ in your case is incorrect.