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 » About CExtWRB Collapse All
Subject Author Date
tera t Sep 2, 2007 - 11:46 PM

Q1,

Because a border of Grid was hard to find, I tried to use CExtWRB.
Scroll bar of Grid disappeared, and it was assumed that I used WRB.
Will not there be a good method?

Technical Support Sep 3, 2007 - 1:24 PM

You should not use the CExtWRB template class with the controls which have scroll bars. The CExtWRB template class re-computes and re-paints window non-client area making it looking like a thin 1 pixel border. But scroll bars of the tree control are not scroll bar windows. Thay are rather parts of the window non-client area and they are not based on HWND handles. So, the CExtWRB template class simply kills scroll bars.

The CExtWRB template class is designed for non-scrollable windows like CExtResizableDialog.

If you want to implement a thin border in the scrollable windows you can use the CProfStudioThinFrame class from the ProfStudio sample. This class does not modify the non-client area. It is a standalone window that has its own thin border. The CProfStudioThinFrame class is designed to be a container for another window. This child window is automatically resized to fit all the inner area of the CProfStudioThinFrame window. So, this implementation of the thin border does not affect the scroll bars in its child window. To use it with windows inside the resizable control bar, create a resizable control bar (the m_wndBar in the code snippet below, created in part A) and its child window (the m_wndInside in the code snippet below, created in part B). After that, you should create a CProfStudioThinFrame container (created in part C) with the window in the resizable bar (m_wndInside):

if(    // PART A
           (! m_wndBar.Create(
                _T("My resizable bar caption"),
                this,
                ID_VIEW_MY_RESIZABLE_BAR
                ) )
           // PART B
        || (! m_wndInside.Create(
                . . .
                &m_wndBar,
                . . .
                ) )
           // PART C
        || (! (new CProfStudioThinFrame)->
                CreateDynamicThinFrame(
                &m_wndInside
                ) ) )
       )

    {
        TRACE0("Failed to create my resizable bar\n");
        return . . .;
    }
Before the code enters part C, the m_wndInside window is a child of the m_wndBar window. After that, m_wndInside is a child of the dynamically created CProfStudioThinFrame window. The CProfStudioThinFrame window is a child of the m_wndBar window. So, the CProfStudioThinFrame window simply injects itself between the m_wndInside and m_wndBar windows. The CProfStudioThinFrame class automatically deletes itself when the window layout is destroyed. This allows you to forget about it after its initialization is complete.