CDockContainer

Win32++

CDockContainer Class

Description

The CDockContainer class adds "Containers" to the Win32++ framework. A Container is a tab control which has been designed to co-operate with docking.  While Dockers allows any child window to be used as the view window, Containers add additional features when used as the view window for Dockers.  These additional features include Container within Container docking (where the newly docked Container adds another tab), as well as additions to the dock targeting and dock hinting visual cues.  Containers can also have a toolbar. The use of a toolbar is optional, but when used they are set up in the same way as toolbars for Frames.

CDockContainers have views of their own.  These views can be any child window, and are set in the same way as views for Frames and MDI children.

CDockContainer Members

CDockContainer
CDockContainer();
Constructor for CDockContainer.
AddContainer
virtual void AddContainer(CDockContainer* pContainer, BOOL bInsert = FALSE);
Adds the specified container as a child to this container. Set bInsert to TRUE to insert the container as the first tab, or FALSE to add it as the last tab. AddToolBarButton
virtual void AddToolBarButton(UINT nID, BOOL bEnabled = TRUE);
Adds a resource ID to the container's toolbar. GetActiveContainer
CDockContainer* GetActiveContainer() const;
Returns a pointer to the currently active container. GetActiveView
CWnd* GetActiveView() const;
Returns a pointer to the view window for the currently active container. GetAllContainers
std::vector<ContainerInfo>* GetAllContainers() const;
Returns a reference to the vector of container information. GetContainerFromIndex
virtual CDockContainer* GetContainerFromIndex(UINT nPage);
Returns a pointer to the container at the specified tab number. GetContainerFromView
virtual CDockContainer* GetContainerFromView(CWnd* pView) const;
Returns a pointer to the container with the specified view. GetContainerIndex
virtual int GetContainerIndex(CDockContainer* pContainer);
Returns the tab index of the specified container. GetContainerParent
CDockContainer* GetContainerParent() const;
Returns a pointer to the container which is the parent of this container group. GetDockCaption
CString& GetDockCaption() const;
Returns the CString which contains the text displayed in the caption of a docked container. GetMaxTabTextSize
virtual SIZE GetMaxTabTextSize();
Returns the size (width and height) of the caption text. GetTabIcon
HICON GetTabIcon() const;
Returns the icon handle for this container's tab. GetTabText
LPCTSTR GetTabText() const;
Returns the text for this container's tab. GetToolBar
virtual CToolBar* GetToolBar() const;
Returns a pointer to the container's toolbar. GetView
CWnd* GetView() const;
Returns a pointer to the view window for this container. GetViewPage
virtual CViewPage* GetViewPage() const;
Returns a pointer to the container's page. The container's page holds the toolbar and view window. RecalcLayout
virtual void RecalcLayout();
Recalculates the positions of the child windows for the container, and repositions them. RemoveContainer
virtual void RemoveContainer(CDockContainer* pWnd);
Removes the specified child container from this container group. SelectPage
virtual void SelectPage(int nPage);
Activates the specified page number. SetActiveContainer
void SetActiveContainer(CDockContainer* pContainer);
Sets the active container. SetDockCaption
void SetDockCaption(LPCTSTR szCaption);
Sets the text associated with a docked container. SetHideSingleTab
void SetHideSingleTab(BOOL bHide);
Shows or hides the tab if it has only one page. SetTabIcon
void SetTabIcon(HICON hTabIcon);
void SetTabIcon(UINT nID_Icon);
Sets the icon for this container's tab. SetTabText
void SetTabText(LPCTSTR szText);
void SetTabText(UINT nTab, LPCTSTR szText);
Sets the text for this container's tab. SetToolBarImages
virtual void SetToolBarImages(COLORREF crMask, UINT ToolBarID, UINT ToolBarHotID, UINT ToolBarDisabledID);
Sets the normal, hot and disabled images for the ToolBar SetupToolBar
virtual void SetupToolBar();
Override this function to specify the container's toolbar's bitmap and resource IDs. SetView
void SetView(CWnd& Wnd);
Sets the view window for this container. SwapTabs
virtual void SwapTabs(UINT nTab1, UINT nTab2);
Swaps the position of two tabs.
Overridables
OnLButtonDown
OnLButtonDown(WPARAM wParam, LPARAM lParam);
Called when the left mouse button is pressed.
OnLButtonUp
OnLButtonUp(WPARAM wParam, LPARAM lParam);
Called when the left mouse button is released.
OnMouseLeave
virtual LRESULT OnMouseLeave(WPARAM wParam, LPARAM lParam);
Called when the mouse cursor leaves the window.
OnMouseMove
virtual LRESULT OnMouseMove(WPARAM wParam, LPARAM lParam);
Called when the mouse cursor is moved over the window.
OnSetFocus
virtual LRESULT OnSetFocus(WPARAM wParam, LPARAM lParam);
Called when the window gets keyboard focus. We set the keyboard focus to the active view window.
OnSize
virtual LRESULT OnSize(WPARAM wParam, LPARAM lParam);
Called when the window is resized.
OnTCNSelChange
virtual LRESULT OnTCNSelChange(LPNMHDR pNMHDR);
Called when the currently selected tab has changed.
Base class Members

For base class members, refer to the members of CTab.

Remarks

The CDockContainer could be also used as a view window for other window types, such as Frames and MDI children, although using a CTab for these other views is more common.

Summary Information

Header file docking.h
Win32/64 support Yes
WinCE support No
Library required Comctl32.lib