Objective Toolkit : Chapter 13 Tabbed Windows : The Tabbed Window Classes
The Tabbed Window Classes
A tabbed window is a small, rectangular window that draws tabs and processes mouse events. A tabbed window contains and manages the layout of a tab control and one or more sub-windows (or pages). When the user selects a tab with the mouse, the associated page is activated.
The following figure shows the relationship of the various tabbed window classes.
Figure 105 – Objective Toolkit Tabbed Window Class Hierarchies
SECTabControlBase
SECTabControlBase is an abstract base class that defines the interface of a tab control. SECTabControlBase does not implement the tab control’s functionality or appearance. That is the responsibility of derived classes. SECTabControlBase defines the interface for a generic tab control. The derived classes add the implementation details necessary to define a specific look-and-feel.
SECTabControl
TheSECTabControl class implements a tab control with a two-dimensional look- and-feel that is similar to Microsoft Excel’s. This class handles drawing and activating the tabs for the tabbed window.
Figure 106 – The SECTabControl Window
The SECTabControl inherits its interface from SECTabControlBase and adds the implementation details that define its appearance. Typically, you would not use this class directly. It is created as a child of the SECTabWnd object, and all its operations are performed through the SECTabWnd interface.
For each tab on the control, the SECTabControl references an SECTab object, which in turn references an associated CWnd.
SEC3DTabControl
TheSEC3DTabControl class implements a tab control with a three-dimensional look-and-feel that is similar to the Visual Studio’s tabbed windows. This class is responsible for drawing the tabs and handling tab activation.
Figure 107 – The SEC3DTabControl Window
You can orient tabs so that they are on the top, bottom, left, or right of the tabbed window. The SEC3DTabControl inherits its interface from SECTabControlBase and adds the implementation details that define its appearance. Like SECTabControl, this class is typically not used directly. It is created as a child of the SEC3DTabWnd object, and all its operations are performed through the SEC3DTabWnd interface.
For each tab on the control, the SEC3DTabControl references an SEC3DTab object, which in turn references an associated CWnd.
SECTabWndBase
SECTabWndBase is an abstract base class that defines the interface of a tabbed window, which supports the dynamic creation, renaming, and destruction of tabs. SECTabWndBase supports a rich set of operations that allows you to perform a number of actions on windows objects, such as adding, deleting, renaming, activating, scrolling into view, and more. In addition, you can customize the appearance of the tabs with alternative fonts and other features.
This class does not implement the tabbed window’s functionality or appearance. That is the responsibility of derived classes. SECTabWndBase defines the methods that operate on a generic tabbed window. The derived classes inherit the methods common to all tabbed windows and add the implementation details necessary to define a look-and-feel.
SECTabWnd
TheSECTabWnd class implements a tabbed window with a two-dimensional look and feel similar to the tabbed worksheet pages in Microsoft Excel. If an SECTabWnd does not have enough room to display each of its tabs, scroll buttons appear on the dialog (depending on the style settings) so the user can navigate to each of the tabs.
The SECTabWnd inherits its interface from SECTabWndBase and adds the implementation details that define its appearance. The SECTabWnd contains the SECTabControl, draws its own border, and activates tab-associated CWnds for display.
SEC3DTabWnd
TheSEC3DTabWnd class implements a tabbed window with a three-dimensional appearance that is similar to the Visual Studio’s tabbed windows. You can position tabs on the top, bottom, left, or right. SEC3DTabWnd does not display scroll buttons for navigating the tabs.
The SEC3DTabWnd inherits its interface from SECTabWndBase and adds the implementation details that define its appearance. The SEC3DTabWnd contains the SEC3DTabControl and is responsible for drawing its own border and activating the tab-associated CWnds for display.
NOTE >> Only the three-dimensional tab classes support styles that allow you to position tabs on the top, left, and right. These styles are not available in the two dimensional tab classes.