CMFCOutlookBarTabCtrl Class
A tab control that has the visual appearance of the Navigation Pane in Microsoft Outlook. For more detail see the source code located in the VC\atlmfc\src\mfc folder of your Visual Studio installation.
class CMFCOutlookBarTabCtrl : public CMFCBaseTabCtrl
Name | Description |
---|---|
CMFCOutlookBarTabCtrl::CMFCOutlookBarTabCtrl |
Default constructor. |
CMFCOutlookBarTabCtrl::~CMFCOutlookBarTabCtrl |
Destructor. |
Name | Description |
---|---|
CMFCOutlookBarTabCtrl::AddControl | Adds a Windows control as a new tab in the Outlook bar. |
CMFCOutlookBarTabCtrl::CalcRectEdit |
Called by the framework to determine the dimensions of the edit box that appears when a user renames a tab. (Overrides CMFCBaseTabCtrl::CalcRectEdit .) |
CMFCOutlookBarTabCtrl::CanShowFewerPageButtons | Called by the framework during resizing operations to determine if fewer Outlook bar tab page buttons can be displayed than are currently visible. |
CMFCOutlookBarTabCtrl::CanShowMorePageButtons | Called by the framework during resizing operations to determine if more Outlook bar tab page buttons can be displayed than are currently visible. |
CMFCOutlookBarTabCtrl::Create | Creates the Outlook bar tab control. |
CMFCOutlookBarTabCtrl::CreateObject |
Used by the framework to create a dynamic instance of this class type. |
CMFCOutlookBarTabCtrl::EnableAnimation | Specifies whether the animation that occurs during the switch between active tabs is enabled. |
CMFCOutlookBarTabCtrl::EnableInPlaceEdit | Specifies whether a user can modify the text labels on the tab buttons of the Outlook bar. (Overrides CMFCBaseTabCtrl::EnableInPlaceEdit.) |
CMFCOutlookBarTabCtrl::EnableScrollButtons | Called by the framework to enable buttons that allow the user to scroll through buttons on the Outlook bar pane. |
CMFCOutlookBarTabCtrl::FindTargetWnd |
Identifies the pane that contains a specified point. (Overrides CMFCBaseTabCtrl::FindTargetWnd.) |
CMFCOutlookBarTabCtrl::GetBorderSize | Returns the border size of the Outlook tab control. |
CMFCOutlookBarTabCtrl::GetTabArea |
Retrieves the size and position of the tab area of the tab control. (Overrides CMFCBaseTabCtrl::GetTabArea.) |
CMFCOutlookBarTabCtrl::GetThisClass |
Used by the framework to obtain a pointer to the CRuntimeClass object that is associated with this class type. |
CMFCOutlookBarTabCtrl::GetVisiblePageButtons | |
CMFCOutlookBarTabCtrl::IsAnimation | Determines whether the animation that occurs during the switch between active tabs is enabled. |
CMFCOutlookBarTabCtrl::IsMode2003 | Determines if the Outlook bar tab control is in a mode that emulates Microsoft Outlook 2003. |
CMFCOutlookBarTabCtrl::IsPtInTabArea |
Determines if a point is inside the tab area. (Overrides CMFCBaseTabCtrl::IsPtInTabArea.) |
CMFCOutlookBarTabCtrl::IsTabDetachable |
Determines whether a tab is detachable. (Overrides CMFCBaseTabCtrl::IsTabDetachable.) |
CMFCOutlookBarTabCtrl::OnChangeTabs |
Called by the framework when a tab is inserted or removed. (Overrides CMFCBaseTabCtrl::OnChangeTabs .) |
CMFCOutlookBarTabCtrl::OnShowFewerPageButtons | Called by the framework to decrease the number of tab page buttons that are visible. |
CMFCOutlookBarTabCtrl::OnShowMorePageButtons | Called by the framework to increase the number of tab page buttons that are visible. |
CMFCOutlookBarTabCtrl::OnShowOptions | Displays the Navigation Pane Options dialog. |
CMFCOutlookBarTabCtrl::RecalcLayout |
Recalculates the internal layout of the tab control. (Overrides CMFCBaseTabCtrl::RecalcLayout.) |
CMFCOutlookBarTabCtrl::SetActiveTab | Sets the active tab. (Overrides CMFCBaseTabCtrl::SetActiveTab.) |
CMFCOutlookBarTabCtrl::SetBorderSize | Sets the border size of the Outlook tab control. |
CMFCOutlookBarTabCtrl::SetPageButtonTextAlign | Sets the alignment of the text labels on the tab buttons of the Outlook bar. |
CMFCOutlookBarTabCtrl::SetToolbarImageList | Sets the bitmap that contains the icons that are displayed on the bottom of the Outlook bar in Outlook 2003 mode (see CMFCOutlookBar Class). |
CMFCOutlookBarTabCtrl::SetVisiblePageButtons |
To create an Outlook bar that has docking support, use a CMFCOutlookBar
object to host the Outlook bar tab control. For more information, see CMFCOutlookBar Class.
The following example demonstrates how to initialize a CMFCOutlookBarTabCtrl
object and use various methods in the CMFCOutlookBarTabCtrl
class. The example shows how to enable the in-place editing of the text label on the tab page buttons of the Outlook bar, enable the animation, enable scroll handles that enable the user to scroll through buttons on the Outlook bar pane, set the border size of the Outlook tab control, and set the alignment of the text labels on the tab buttons of the Outlook bar. This code snippet is part of the Outlook Demo sample.
// CMFCOutlookBar& bar
CMFCOutlookBarTabCtrl *pOutlookBar = (CMFCOutlookBarTabCtrl*)bar.GetUnderlyingWindow();
pOutlookBar->EnableInPlaceEdit(TRUE);
pOutlookBar->EnableAnimation();
pOutlookBar->EnableScrollButtons();
pOutlookBar->SetBorderSize(10);
pOutlookBar->SetPageButtonTextAlign(TA_LEFT);
Header: afxoutlookbartabctrl.h
Adds a Windows control as a new tab in the Outlook bar.
void AddControl(
CWnd* pWndCtrl,
LPCTSTR lpszName,
int nImageID=-1,
BOOL bDetachable=TRUE,
DWORD dwControlBarStyle=AFX_CBRS_FLOAT | AFX_CBRS_CLOSE | AFX_CBRS_RESIZE | CBRS_AFX_AUTOHIDE);
pWndCtrl
[in] A pointer to a control to add.
lpszName
[in] Specifies the name of tab.
bDetachable
[in] If TRUE, the page will be created as detachable.
nImageID
[in] Image index in the internal image list for the image to be displayed in the new tab.
dwControlBarStyle
[in] Specifies the AFX_ CBRS_* style for wrapped docking panes.
Use this function to add a control as a new page of an outlook bar.
This function internally calls on CMFCBaseTabCtrl::AddTab.
If you set bDetachable to TRUE, AddControl
internally creates a CDockablePaneAdapter
object and wraps the added control. It automatically sets the runtime class of the tabbed window to the runtime class of CMFCOutlookBar
and the runtime class of the floating frame to CMultiPaneFrameWnd
.
The following example demonstrates how to use the AddControl
method in the CMFCOutlookBarTabCtrl
class. This code snippet is part of the Outlook Demo sample.
// CMFCOutlookBarTabCtrl* pOutlookBar
// DWORD dwStyle = AFX_CBRS_FLOAT | AFX_CBRS_AUTOHIDE | AFX_CBRS_RESIZE
// CMFCOutlookBarPane pane1
// The third parameter is the image index.
pOutlookBar->AddControl(&pane1, _T("General"), 0, TRUE, dwStyle);
Called by the framework during resizing operations to determine whether fewer Outlook bar tab page buttons can be displayed than are currently visible.
virtual BOOL CanShowFewerPageButtons() const;
TRUE if there is more than one button; otherwise FALSE.
The Outlook bar tab control dynamically adds or removes tabs from the display depending on how much room is available. This method is used by the framework to assist in that process.
Called by the framework during resizing operations to determine whether more Outlook bar tab page buttons can be displayed than are currently visible.
virtual BOOL CanShowMorePageButtons() const;
TRUE if there are buttons that are not currently visible; otherwise FALSE.
The Outlook bar tab control dynamically adds or removes tabs from the display, depending on how much room is available. This method is used by the framework to assist in that process.
Creates the Outlook bar tab control.
virtual BOOL Create(
const CRect& rect,
CWnd* pParentWnd,
UINT nID);
rect
[in] Specifies the initial size and position, in pixels.
pParentWnd
[in] Points to the parent window. Must not be NULL.
nID
[in] The control ID.
Nonzero if the control has been created successfully; otherwise 0.
Usually, outlook bar tab controls are created when CMFCOutlookBar Class controls the WM_CREATE message of the process.
Specifies whether the animation that occurs during the switch between active tabs is enabled.
static void EnableAnimation(BOOL bEnable=TRUE);
bEnable
[in] Specifies whether the animation should be enabled or disabled.
Call this function to enable and disable animation. When the user opens a tab page, the page's caption slides up or down if animation is enabled. If animation is disabled, the page becomes active immediately.
By the default, the animation is enabled.
Specifies whether a user can modify the text labels on the tab page buttons of the Outlook bar.
virtual void EnableInPlaceEdit(BOOL bEnable);
bEnable
If TRUE, enable the in-place editing of the text label. If FALSE, disable the in-place editing.
Call this function to enable or disable in-place editing of text labels on tab page buttons. By default the in-place editing is disabled.
Called by the framework to enable scroll handles that allow the user to scroll through buttons on the Outlook bar pane.
void EnableScrollButtons(
BOOL bEnable = TRUE,
BOOL bIsUp = TRUE,
BOOL bIsDown = TRUE);
bEnable
[in] Determines whether the scroll buttons are displayed.
bIsUp
[in] Determines whether the top scrollbar is displayed.
bIsDown
[in] Determines whether the bottom scrollbar is displayed.
Enables the display of the scroll buttons. This method is called by the framework when the active tab changes to restore the scroll buttons.
Returns the border size of the Outlook tab control.
int GetBorderSize() const;
The border size, in pixels.
int GetVisiblePageButtons() const;
Specifies whether the animation that occurs during the switch between active tabs is enabled.
static BOOL IsAnimation();
Nonzero if the animation is enabled; otherwise 0.
Call the CMFCOutlookBarTabCtrl::EnableAnimation function to enable or disable animation.
Determines whether the Outlook bar tab control is in a mode that emulates Microsoft Outlook 2003.
BOOL IsMode2003() const;
TRUE if the Outlook bar tab control is in Outlook 2003 mode; otherwise FALSE;
This value is set by CMFCOutlookBar::SetMode2003.
Called by the framework to decrease the number of tab page buttons that are visible.
virtual void OnShowFewerPageButtons();
This method adjusts the number of visible page tab buttons when the control is resized.
Called by the framework to increase the number of tab page buttons that are visible.
virtual void OnShowMorePageButtons();
This method adjust the number of tab page buttons that are visible when the control is resized.
Displays the Navigation Pane Options dialog box.
virtual void OnShowOptions();
The Navigation Pane Options dialog box allows the user to select which tab page buttons are to be displayed, and the order in which they are displayed.
This method is called by the framework when the user selects the Navigation Pane Options menu item from the control's customization menu.
Sets the active tab. The active tab is the one that is open, with its contents visible.
virtual BOOL SetActiveTab(int iTab);
iTab
[in] The zero-based index of a tab to be opened.
Nonzero if the specified tab has been opened successfully; otherwise 0.
The visual effect of setting the active tab depends on whether you have enabled animation. For more information, see CMFCOutlookBarTabCtrl::EnableAnimation.
Sets the border size of the Outlook tab control.
void SetBorderSize(int nBorderSize);
nBorderSize
[in] Specifies the new border size in pixels.
Sets the new border size and recalculates the outlook window layout.
Sets the alignment of the text labels on the tab buttons of the Outlook bar.
void SetPageButtonTextAlign(
UINT uiAlign,
BOOL bRedraw=TRUE);
uiAlign
[in] Specifies the text alignment.
bRedraw
[in] If TRUE, the outlook window will be redrawn.
Use this function to change text alignment for page buttons.
uiAlign can be one of the following values:
Constant | Meaning |
---|---|
TA_LEFT | Left alignment |
TA_CENTER | Center alignment |
TA_RIGHT | Right alignment |
The default value is TA_CENTER.
Sets the bitmap that contains the icons that are displayed on the bottom of the Outlook bar in Outlook 2003 mode.
BOOL SetToolbarImageList(
UINT uiID,
int cx,
COLORREF clrTransp=RGB(255, 0, 255));
uiID
[in] Specifies the resource ID of the image to load.
cx
[in] Specifies the width of an image in the image list, in pixels.
clrTransp
[in] An RGB value that specifies the transparent color.
Returns TRUE if successful; otherwise returns FALSE.
Use this function to attach an image list whose images will be displayed on toolbar buttons in Microsoft Office 2003 mode. Image indexes should correspond to page indexes.
This method should not be called if not in Microsoft Office 2003 mode. For more information, see CMFCOutlookBar Class.
void SetVisiblePageButtons(int nVisiblePageButtons);
[in] nVisiblePageButtons
Hierarchy Chart
Classes
CMFCBaseTabCtrl Class
CMFCOutlookBar Class
CMFCOutlookBarPane Class