If you take a look at the GUI implemented in Visual Studio .NET, you will notice that many windows and controls inside dockable resizable bars have a thin (one pixel wide) border. So, we decided to provide Prof-UIS users with such a feature, which is adding a thin border to any window. This can be done in one of the following ways:
1) You can implement this border in the non-client area of the window inserted into CExtControlBar
. For that, just use our CExtWRB
template class (WRB stands for Window in Resizable Bar). This template class implements the WindowProc()
virtual method for recomputing and repainting the non-client area of a window. So, please use CExtWRB < CExtResizableDialog >
type instead of CExtResizableDialog
to add a thin border to your dialog window. But, the CExtWRB
class is not good when applied to windows which have non-client scroll bar areas. As we said above, the CExtWRB
class recomputes and repaints the non-client area of the window. So, scroll bars are simply "killed".
2) You can also use the CProfStudioThinFrame
class from the ProfStudio sample to implement such a thin border. This class does not modify the non-client area. It is a stand alone 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.