description | title | ms.date | f1_keywords | helpviewer_keywords | ms.assetid | ||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Learn more about: CMFCOutlookBarPane Class |
CMFCOutlookBarPane Class |
11/04/2016 |
|
|
094e2ef3-a118-487e-a4cc-27626108fe08 |
For more detail see the source code located in the VC\atlmfc\src\mfc folder of your Visual Studio installation.
A control derived from CMFCToolBar Class that can be inserted into an Outlook bar ( CMFCOutlookBar Class). The Outlook bar pane contains a column of large buttons. The user can scroll up and down the list of buttons if it is larger than the pane. When the user detaches an Outlook bar pane from the Outlook bar, it can float or dock in the main frame window.
class CMFCOutlookBarPane : public CMFCToolBar
Name | Description |
---|---|
CMFCOutlookBarPane::CMFCOutlookBarPane |
Default constructor. |
CMFCOutlookBarPane::~CMFCOutlookBarPane |
Destructor. |
Name | Description |
---|---|
CMFCOutlookBarPane::AddButton | Adds a button to the Outlook bar pane. |
CMFCOutlookBarPane::CanBeAttached | Determines whether the pane can be docked to another pane or frame window. (Overrides CBasePane::CanBeAttached.) |
CMFCOutlookBarPane::CanBeRestored |
Determines whether the system can restore a toolbar to its original state after customization. (Overrides CMFCToolBar::CanBeRestored.) |
CMFCOutlookBarPane::ClearAll | Frees the resources used by the images in the Outlook bar pane. |
CMFCOutlookBarPane::Create | Creates the Outlook bar pane. |
CMFCOutlookBarPane::CreateObject |
Used by the framework to create a dynamic instance of this class type. |
CMFCOutlookBarPane::Dock |
Called by the framework to dock the Outlook bar pane. (Overrides CPane::Dock .) |
CMFCOutlookBarPane::EnablePageScrollMode | Specifies whether the scroll arrows on the Outlook bar pane advance the list of buttons by page, or by button. |
CMFCOutlookBarPane::GetRegularColor | Returns the regular (non-selected) text color of the Outlook bar pane. |
CMFCOutlookBarPane::GetThisClass |
Used by the framework to obtain a pointer to the CRuntimeClass object that is associated with this class type. |
CMFCOutlookBarPane::IsBackgroundTexture | Determines whether there is a background image loaded for the Outlook bar pane. |
CMFCOutlookBarPane::IsChangeState |
Determines whether a floating pane may be docked. (Overrides CPane::IsChangeState .) |
CMFCOutlookBarPane::IsDrawShadedHighlight | Determines whether the button border is shaded when a button is highlighted and a background image is displayed. |
CMFCOutlookBarPane::OnBeforeFloat |
Called by the framework when a pane is about to float. (Overrides CPane::OnBeforeFloat.) |
CMFCOutlookBarPane::RemoveButton | Removes the button that has a specified command ID. |
CMFCOutlookBarPane::RestoreOriginalstate |
Restores the original state of a toolbar. (Overrides CMFCToolBar::RestoreOriginalState.) |
CMFCOutlookBarPane::SetBackColor | Sets the background color. |
CMFCOutlookBarPane::SetBackImage | Sets the background image. |
CMFCOutlookBarPane::SetDefaultState | Resets the Outlook bar pane to the original set of buttons. |
CMFCOutlookBarPane::SetExtraSpace | Sets the number of pixels of padding used around buttons in the Outlook bar pane. |
CMFCOutlookBarPane::SetTextColor | Sets the colors of regular and highlighted text in the Outlook bar pane. |
CMFCOutlookBarPane::SetTransparentColor | Sets the transparent color for the Outlook bar pane. |
CMFCOutlookBarPane::SmartUpdate |
Used internally to update the Outlook bar. (Overrides CMFCToolBar::SmartUpdate .) |
Name | Description |
---|---|
CMFCOutlookBarPane::EnableContextMenuItems | Specifies which shortcut menu items are displayed in customization mode. |
CMFCOutlookBarPane::RemoveAllButtons | Removes all the buttons from the Outlook bar pane. (Overrides CMFCToolBar::RemoveAllButtons.) |
For information about how to implement an Outlook bar, see CMFCOutlookBar Class.
For an example of an Outlook bar, see the OutlookDemo sample project.
The following example demonstrates how to use various methods of the CMFCOutlookBarPane
class. The example shows how to create an Outlook bar pane, enable the page scroll mode, enable docking, and set the background color of the Outlook bar. This code snippet is part of the Outlook Multi Views sample.
[!code-cppNVC_MFC_OutlookMultiViews#3] [!code-cppNVC_MFC_OutlookMultiViews#4]
Header: afxoutlookbarpane.h
Adds a button to the Outlook bar pane.
BOOL AddButton(
UINT uiImage,
LPCTSTR lpszLabel,
UINT iIdCommand,
int iInsertAt=-1);
BOOL AddButton(
UINT uiImage,
UINT uiLabel,
UINT iIdCommand,
int iInsertAt=-1);
BOOL AddButton(
LPCTSTR szBmpFileName,
LPCTSTR szLabel,
UINT iIdCommand,
int iInsertAt=-1);
BOOL AddButton(
HBITMAP hBmp,
LPCTSTR lpszLabel,
UINT iIdCommand,
int iInsertAt=-1);
BOOL AddButton(
HICON hIcon,
LPCTSTR lpszLabel,
UINT iIdCommand,
int iInsertAt=-1,
BOOL bAlphaBlend=FALSE);
uiImage
[in] Specifies the resource identifier of a bitmap.
lpszLabel
[in] Specifies the button's text.
iIdCommand
[in] Specifies the button control's ID.
iInsertAt
[in] Specifies the zero-based index on the outlook bar's page at which to insert the button.
uiLabel
[in] A string resource ID.
szBmpFileName
[in] Specifies the name of the disk image file to load.
szLabel
[in] Specifies the button's text.
hBmp
[in] A handle to a button's bitmap.
hIcon
[in] A handle to a buttons' icon.
TRUE if a button was added successfully; otherwise FALSE.
Use this method to insert a new button into an Outlook bar's page. The button's image can be loaded either from the application resources or from a disk file.
If the page ID specified by uiPageID is -1, the button is inserted into the first page.
If the index specified by iInsertAt is -1, the button is added at the end of the page.
For more detail see the source code located in the VC\atlmfc\src\mfc folder of your Visual Studio installation.
virtual BOOL CanBeAttached() const;
Frees the resources used by the images on the Outlook bar pane.
void ClearAll();
This method directly calls CMFCToolBarImages::Clear, which is called on the images that are used by the Outlook bar pane.
Creates the Outlook bar pane.
virtual BOOL Create(
CWnd* pParentWnd,
DWORD dwStyle=AFX_DEFAULT_TOOLBAR_STYLE,
UINT uiID=(UINT)-1,
DWORD dwControlBarStyle=0);
pParentWnd
[in] Specifies the parent window of the Outlook bar pane control. Must not be NULL.
dwStyle
[in] The window style. For a list of window styles, see Window Styles.
uiID
[in] The control ID. Must be unique to enable saving of the control's state.
dwControlBarStyle
[in] Specifies special styles that define the behavior of the Outlook bar pane control when it is detached from the Outlook bar.
TRUE if the method was successful; otherwise FALSE.
To construct a CMFCOutlookBarPane
object, first call the constructor, and then call Create
, which creates the Outlook bar pane control and attaches it to the CMFCOutlookBarPane
object.
For more information about dwControlBarStyle
see CBasePane::CreateEx.
Specifies which shortcut menu items are displayed in customization mode.
virtual BOOL EnableContextMenuItems(
CMFCToolBarButton* pButton,
CMenu* pPopup);
pButton
[in] A pointer to a toolbar button that a user clicked.
pPopup
[in] A pointer to the shortcut menu.
Returns TRUE if the shortcut menu should be displayed; otherwise FALSE.
Override this method to modify the framework standard shortcut menu that the framework displays in customization mode.
The default implementation checks the customization mode ( CMFCToolBar::IsCustomizeMode) and if it is set to TRUE, disables all the shortcut menu items except Delete. Then, it just passes the input parameters to CMFCToolBar::EnableContextMenuItems
.
Note
Context menu is a synonym for shortcut menu.
Specifies whether the scroll arrows on the Outlook bar pane advance the list of buttons page by page, or button by button.
void EnablePageScrollMode(BOOL bPageScroll=TRUE);
bPageScroll
[in] If TRUE, enable the page scroll mode. If FALSE, disable the page scroll mode.
Returns the regular (that is, non-selected) text color of the Outlook bar pane.
DECLARE_MESSAGE_MAPCOLORREF GetRegularColor() const;
The current text color as an RGB color value.
Use CMFCOutlookBarPane::SetTextColor to set the current (regular and selected) text color of the Outlook bar. You can obtain the default text color by calling the GetSysColor function with the COLOR_WINDOW index.
Determines whether there is a background image loaded for the Outlook bar pane.
BOOL IsBackgroundTexture() const;
TRUE if there is background image to display; otherwise FALSE.
You can add a background image by calling CMFCOutlookBarPane::SetBackImage function.
If there is no background image, the background is painted with a color specified by using CMFCOutlookBarPane::SetBackColor.
Determines whether the button border is shaded when a button is highlighted and a background image is displayed.
BOOL IsDrawShadedHighlight() const;
TRUE if button's borders are shaded; otherwise FALSE.
Removes all the buttons from the Outlook bar pane.
virtual void RemoveAllButtons();
Removes the button that has a specified command ID.
BOOL RemoveButton(UINT iIdCommand);
iIdCommand
[in] Specifies the command ID of a button to remove.
TRUE if the button was successfully removed; FALSE if the specified command ID is not valid.
Sets the background color of the Outlook bar.
void SetBackColor(COLORREF color);
color
[in] Specifies the new background color.
Call this function to set the current background color for the Outlook bar. The background color is used only if there is no background image.
Sets the background image.
void SetBackImage(UINT uiImageID);
uiImageID
[in] Specifies the image resource ID.
Call this method to set the Outlook bar's background image. The list of background images is managed by the embedded CMFCToolBarImages Class object.
Resets the Outlook bar pane to the original set of buttons.
void SetDefaultState();
This method restores the Outlook bar buttons to the original set. This method is like CMFCOutlookBarPane::RestoreOriginalstate
, except that it does not trigger a redraw of the Outlook bar pane.
Sets the number of pixels of padding used around buttons in the Outlook bar pane.
void SetExtraSpace()
Sets the colors of regular and highlighted text in the Outlook bar pane.
void SetTextColor(
COLORREF clrRegText,
COLORREF clrSelText=0);
clrRegText
[in] Specifies the new color for non-selected text.
clrSelText
[in] Specifies the new color for selected text.
Sets the transparent color for the Outlook bar pane.
void SetTransparentColor(COLORREF color);
color
Specifies the new transparent color.
The transparent color is required to display transparent images. Any occurrence of this color in an image is painted with the background color instead. There is no blending of background and foreground images.
Hierarchy Chart
Classes
CMFCToolBar Class
CMFCOutlookBar Class
CMFCOutlookBarTabCtrl Class