共用方式為


CMFCOutlookBarPane 類別

如需詳細資訊,請參閱 Visual Studio 安裝的 VC\atlmfc\src\mfc 資料夾中的原始程式碼

衍生自 CMFCToolBar 類別 的控制項,可插入 Outlook 列 ( CMFCOutlookBar 類別 )。 Outlook 功能區窗格包含一欄大型按鈕。 如果按鈕清單比窗格還要大,使用者可以上下捲動清單。 當使用者將 Outlook 功能區窗格從 Outlook 功能區卸離時,這個窗格可以在主框架視窗中停駐或浮動。

語法

class CMFCOutlookBarPane : public CMFCToolBar

成員

公用建構函式

名稱 描述
CMFCOutlookBarPane::CMFCOutlookBarPane 預設建構函式。
CMFCOutlookBarPane::~CMFCOutlookBarPane 解構函式。

公用方法

名稱 描述
CMFCOutlookBarPane::AddButton 將按鈕新增至 Outlook 列窗格。
CMFCOutlookBarPane::CanBeAttached 判斷窗格是否可以停駐到另一個窗格或框架視窗。 (覆寫 CBasePane::CanBeAttached .)
CMFCOutlookBarPane::CanBeRestored 判斷系統是否可以在自訂之後,將工具列還原至其原始狀態。 (覆寫 CMFCToolBar::CanBeRestored .)
CMFCOutlookBarPane::ClearAll 釋放 Outlook 列窗格中影像所使用的資源。
CMFCOutlookBarPane::Create 建立 Outlook 列窗格。
CMFCOutlookBarPane::CreateObject 由建立此類別類型的動態執行個體架構所使用。
CMFCOutlookBarPane::Dock 架構呼叫以停駐 Outlook 列窗格。 (覆寫 CPane::Dock。)
CMFCOutlookBarPane::EnablePageScrollMode 指定 Outlook 列窗格上的捲動箭號會依頁面或按鈕往前推進按鈕清單。
CMFCOutlookBarPane::GetRegularColor 會傳回 Outlook 列窗格的一般(非選取)文字色彩。
CMFCOutlookBarPane::GetThisClass 由架構用來取得與這個類別類型相關聯之 CRuntimeClass 物件的指標。
CMFCOutlookBarPane::IsBackgroundTexture 判斷是否載入 Outlook 列窗格的背景影像。
CMFCOutlookBarPane::IsChangeState 判斷浮動窗格是否可停駐。 (覆寫 CPane::IsChangeState。)
CMFCOutlookBarPane::IsDrawShadedHighlight 決定是否在醒目提示按鈕和顯示背景影像時,顯示按鈕框線。
CMFCOutlookBarPane::OnBeforeFloat 當窗格即將浮動時,由架構呼叫。 (覆寫 CPane::OnBeforeFloat .)
CMFCOutlookBarPane::RemoveButton 移除具有指定命令識別碼的按鈕。
CMFCOutlookBarPane::RestoreOriginalstate 還原工具列的原始狀態。 (覆寫 CMFCToolBar::RestoreOriginalState .)
CMFCOutlookBarPane::SetBackColor 設定背景色彩。
CMFCOutlookBarPane::SetBackImage 設定背景影像。
CMFCOutlookBarPane::SetDefaultState 將 Outlook 列窗格重設為原始的按鈕集。
CMFCOutlookBarPane::SetExtraSpace 設定 Outlook 列窗格中按鈕周圍使用的邊框間距圖元數。
CMFCOutlookBarPane::SetTextColor 設定 Outlook 列窗格中一般和反白顯示的文字色彩。
CMFCOutlookBarPane::SetTransparentColor 設定 Outlook 列窗格的透明色彩。
CMFCOutlookBarPane::SmartUpdate 在內部用來更新 Outlook 列。 (覆寫 CMFCToolBar::SmartUpdate。)

受保護的方法

名稱 描述
CMFCOutlookBarPane::EnableCoNtextMenuItems 指定哪些快顯功能表項會以自訂模式顯示。
CMFCOutlookBarPane::RemoveAllButtons 從 Outlook 列窗格移除所有按鈕。 (覆寫 CMFCToolBar::RemoveAllButtons .)

備註

如需如何實作 Outlook 列的資訊,請參閱 CMFCOutlookBar 類別

如需 Outlook 列的範例,請參閱 OutlookDemo 範例專案。

範例

下列範例示範如何使用 類別的各種方法 CMFCOutlookBarPane 。 此範例示範如何建立 Outlook 列窗格、啟用頁面捲動模式、啟用停駐,以及設定 Outlook 列的背景色彩。 此程式碼片段是 Outlook 多重檢視範例 一部分。

CMFCOutlookBarPane m_wndShortcutsPane1;
CImageList images;
images.Create(IDB_SHORTCUTS, 32, 0, RGB(255, 0, 255));

// Create first page:
m_wndShortcutsPane1.Create(&m_wndShortcutsBar, AFX_DEFAULT_TOOLBAR_STYLE, ID_SHORTCUTS_PANE_1);
// The this pointer points to a CMainFrame class which extends the CFrameWnd class
m_wndShortcutsPane1.SetOwner(this);
m_wndShortcutsPane1.EnableTextLabels();
m_wndShortcutsPane1.EnableDocking(CBRS_ALIGN_ANY);
m_wndShortcutsPane1.EnablePageScrollMode();
m_wndShortcutsPane1.SetBackColor(RGB(0, 255, 0));

m_wndShortcutsPane1.AddButton(images.ExtractIcon(0), _T("View 1"), ID_SHORTCUT_1);
m_wndShortcutsPane1.AddButton(images.ExtractIcon(1), _T("View 2"), ID_SHORTCUT_2);
m_wndShortcutsPane1.AddButton(images.ExtractIcon(2), _T("View 3"), ID_SHORTCUT_3);
m_wndShortcutsPane1.AddButton(images.ExtractIcon(3), _T("View 4"), ID_SHORTCUT_4);

繼承階層架構

CObject

CCmdTarget

CWnd

CBasePane

CPane

CMFCBaseToolBar

CMFCToolBar

CMFCOutlookBarPane

需求

標頭: afxoutlookbarpane.h

CMFCOutlookBarPane::AddButton

將按鈕新增至 Outlook 列窗格。

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]指定點陣圖的資源識別碼。

lpszLabel
[in]指定按鈕的文字。

iIdCommand
[in]指定按鈕控制項的識別碼。

iInsertAt
[in]指定 Outlook 列頁面上要插入按鈕之以零起始的索引。

uiLabel
[in]字串資源識別碼。

szBmpFileName
[in]指定要載入的磁片映射檔名稱。

szLabel
[in]指定按鈕的文字。

hBmp
[in]按鈕點陣圖的控制碼。

hIcon
[in]按鈕圖示的控制碼。

傳回值

如果已成功新增按鈕,則為 TRUE;否則為 FALSE。

備註

使用這個方法,將新的按鈕插入 Outlook 列的頁面。 按鈕的映射可以從應用程式資源或磁片檔案載入。

如果 uiPageID 指定的頁面識別碼是 -1,按鈕就會插入第一頁。

如果 iInsertAt 指定的索引是 -1,則會在頁面結尾新增按鈕。

CMFCOutlookBarPane::CanBeAttached

如需詳細資訊,請參閱 Visual Studio 安裝的 VC\atlmfc\src\mfc 資料夾中的原始程式碼

virtual BOOL CanBeAttached() const;

傳回值

備註

CMFCOutlookBarPane::ClearAll

釋放 Outlook 列窗格上影像所使用的資源。

void ClearAll();

備註

這個方法會直接呼叫 CMFCToolBarImages::Clear ,這會在 Outlook 列窗格所使用的影像上呼叫。

CMFCOutlookBarPane::Create

建立 Outlook 列窗格。

virtual BOOL Create(
    CWnd* pParentWnd,
    DWORD dwStyle=AFX_DEFAULT_TOOLBAR_STYLE,
    UINT uiID=(UINT)-1,
    DWORD dwControlBarStyle=0);

參數

pParentWnd
[in]指定 Outlook 列窗格控制項的父視窗。 不得為 Null。

dwStyle
[in]視窗樣式。 如需視窗樣式的清單,請參閱 視窗樣式

uiID
[in]控制項識別碼。 必須是唯一的,才能儲存控制項的狀態。

dwControlBarStyle
[in]指定從 Outlook 列中斷連結時,定義 Outlook 列窗格控制項行為的特殊樣式。

傳回值

如果方法成功,則為 TRUE;否則為 FALSE。

備註

若要建構 CMFCOutlookBarPane 物件,請先呼叫 建構函式,然後呼叫 Create ,這會建立 Outlook 列窗格控制項,並將它附加至 CMFCOutlookBarPane 物件。

如需 CBasePane::CreateEx 的詳細資訊 dwControlBarStyle

CMFCOutlookBarPane::EnableCoNtextMenuItems

指定哪些快顯功能表項會以自訂模式顯示。

virtual BOOL EnableContextMenuItems(
    CMFCToolBarButton* pButton,
    CMenu* pPopup);

參數

pButton
[in]使用者按下之工具列按鈕的指標。

pPopup
[in]快捷方式功能表的指標。

傳回值

如果應該顯示快捷方式功能表,則傳回 TRUE;否則為 FALSE。

備註

覆寫此方法,以修改架構在自訂模式中顯示的架構標準快捷方式功能表。

預設實作會檢查自訂模式 ( CMFCToolBar::IsCustomizeMode ),如果設定為 TRUE,則會停用 Delete 以外的 所有快捷方式功能表項目。 然後,它只會將輸入參數傳遞至 CMFCToolBar::EnableContextMenuItems

注意

操作功能表是快捷方式功能表 的同義字。

CMFCOutlookBarPane::EnablePageScrollMode

指定 Outlook 列窗格上的捲動箭號會逐頁前進按鈕清單,或按按鈕。

void EnablePageScrollMode(BOOL bPageScroll=TRUE);

參數

bPageScroll
[in]如果為 TRUE,請啟用頁面捲動模式。 如果為 FALSE,請停用頁面捲動模式。

CMFCOutlookBarPane::GetRegularColor

會傳回 Outlook 列窗格的一般 (也就是未選取的) 文字色彩。

DECLARE_MESSAGE_MAPCOLORREF GetRegularColor() const;

傳回值

目前的文字色彩做為 RGB 色彩值。

備註

使用 CMFCOutlookBarPane::SetTextColor 來設定 Outlook 列的目前(一般和選取的)文字色彩。 您可以使用 COLOR_WINDOW 索引呼叫 GetSysColor 函式,以取得預設文字色彩。

CMFCOutlookBarPane::IsBackgroundTexture

判斷是否載入 Outlook 列窗格的背景影像。

BOOL IsBackgroundTexture() const;

傳回值

如果背景影像要顯示,則為 TRUE;否則為 FALSE。

備註

您可以呼叫 CMFCOutlookBarPane::SetBackImage 函式來新增背景影像。

如果沒有背景影像,背景會使用 CMFCOutlookBarPane::SetBackColor 所指定的色彩繪製。

CMFCOutlookBarPane::IsDrawShadedHighlight

決定是否在醒目提示按鈕和顯示背景影像時,顯示按鈕框線。

BOOL IsDrawShadedHighlight() const;

傳回值

如果按鈕的框線有陰影,則為 TRUE;否則為 FALSE。

CMFCOutlookBarPane::RemoveAllButtons

從 Outlook 列窗格移除所有按鈕。

virtual void RemoveAllButtons();

CMFCOutlookBarPane::RemoveButton

移除具有指定命令識別碼的按鈕。

BOOL RemoveButton(UINT iIdCommand);

參數

iIdCommand
[in]指定要移除之按鈕的命令識別碼。

傳回值

如果已成功移除按鈕,則為 TRUE;如果指定的命令識別碼無效,則為 FALSE。

CMFCOutlookBarPane::SetBackColor

設定 Outlook 列的背景色彩。

void SetBackColor(COLORREF color);

參數

color
[in]指定新的背景色彩。

備註

呼叫此函式以設定 Outlook 列目前的背景色彩。 只有在沒有背景影像時,才會使用背景色彩。

CMFCOutlookBarPane::SetBackImage

設定背景影像。

void SetBackImage(UINT uiImageID);

參數

uiImageID
[in]指定映射資源識別碼。

備註

呼叫此方法以設定 Outlook 列的背景影像。 背景影像清單是由內嵌 的 CMFCToolBarImages 類別 物件所管理。

CMFCOutlookBarPane::SetDefaultState

將 Outlook 列窗格重設為原始的按鈕集。

void SetDefaultState();

備註

這個方法會將 Outlook 列按鈕還原至原創組。 這個方法就像 CMFCOutlookBarPane::RestoreOriginalstate ,不同之處在于它不會觸發 Outlook 列窗格的重繪。

CMFCOutlookBarPane::SetExtraSpace

設定 Outlook 列窗格中按鈕周圍使用的邊框間距圖元數。

void SetExtraSpace()

CMFCOutlookBarPane::SetTextColor

設定 Outlook 列窗格中一般和反白顯示的文字色彩。

void SetTextColor(
    COLORREF clrRegText,
    COLORREF clrSelText=0);

參數

clrRegText
[in]指定非選取文字的新色彩。

clrSelText
[in]指定所選文字的新色彩。

CMFCOutlookBarPane::SetTransparentColor

設定 Outlook 列窗格的透明色彩。

void SetTransparentColor(COLORREF color);

參數

color
指定新的透明色彩。

備註

顯示透明影像需要透明色彩。 影像中出現此色彩的任何專案,會改為使用背景色彩繪製。 沒有背景和前景影像的混合。

另請參閱

階層架構圖表
類別
CMFCToolBar 類別
CMFCOutlookBar 類別
CMFCOutlookBarTabCtrl 類別