CMFCTasksPane Class
This topic is included for completeness. For more detail see the source code located in the VC\atlmfc\src\mfc folder of your Visual Studio installation.
The CMFCTasksPane class implements a list of clickable items (tasks).
class CMFCTasksPane : public CDockablePane
Members
Public Constructors
Name |
Description |
---|---|
Constructs a CMFCTasksPane object. |
Public Methods
Name |
Description |
---|---|
Adds a new group of tasks to the task pane control. |
|
Adds a new static label into the specified task group. |
|
Adds tasks specified by a Most Recently Used (MRU) file list into a group. |
|
Adds a new page to the task pane. |
|
|
|
Adds a new task to the specified task group. |
|
Adds a child window to the task pane. |
|
|
|
Programmatically collapses a group. |
|
(Overrides CPane::CreateDefaultMiniframe.) |
|
Called by the framework to create a menu for the Other Tasks Panes menu button. |
|
Enables or disables animation while collapsing or expanding task groups. |
|
Specifies whether tasks groups can be collapsed. |
|
Enables or disables drop-down menus in Next and Previous navigation buttons. |
|
Enables or disables the navigation toolbar. |
|
|
|
Enables scroll buttons instead of a scrollbar. |
|
Enables or disables word wrapping for labels. |
|
Enables or disables word wrapping for tasks. |
|
Returns the zero-based index for the active page. |
|
Returns the height of the group captions. |
|
Returns the current offset of a group caption from the left and right edges of the task pane. |
|
Returns the current offset of a group caption from the top and bottom edges of the task pane. |
|
Returns the total number of groups. |
|
Returns the internal group index for a given group. |
|
Returns the vertical offset of a group. |
|
Returns the horizontal spacing between a task pane and the edges of the client area. |
|
|
|
Retrieves the page index for a specified group. |
|
Returns the number of pages. |
|
|
|
(Overrides CWnd::GetScrollBarCtrl.) |
|
Retrieves a task. |
|
Returns the number of task items in a specified group. |
|
Returns a task group for a given group index. |
|
Returns the group and the index for a given task. |
|
Returns the horizontal offset of tasks from the left and right edges of their parent groups. |
|
|
|
|
|
Returns the vertical spacing between a task pane and the edges of the client area. |
|
(Overrides CDockablePane::IsAccessibilityCompatible.) |
|
Indicates whether animation is enabled. |
|
Indicates whether the back button is enabled. |
|
Indicates whether the forward button is enabled. |
|
|
|
Indicates whether the Next and Previous navigation buttons have drop-down menus. |
|
Indicates whether the navigation toolbar is enabled. |
|
|
|
Indicates whether the task pane wraps words in labels. |
|
Indicates whether the task pane wraps words in tasks. |
|
(Overrides CDockablePane::LoadState.) |
|
|
|
Called by the framework when the user clicks an item in the task pane. |
|
|
|
Called by the framework when the user clicks the back button. |
|
Called by the framework when the user clicks the forward navigation button. |
|
Called by the framework when the user clicks the home navigation button |
|
|
|
(Overrides CBasePane::OnSetAccData.) |
|
(Overrides CDockablePane::OnUpdateCmdUI.) |
|
(Overrides CDockablePane::PreTranslateMessage.) |
|
(Overrides CPane::RecalcLayout.) |
|
Removes all groups on the specified page. |
|
Removes all pages from the task pane except the default (first) page. |
|
Removes all tasks from the group. |
|
Removes a group. |
|
Removes a specified page from the task pane. |
|
Removes a task from a task group. |
|
(Overrides CDockablePane::SaveState.) |
|
(Overrides CDockablePane::Serialize.) |
|
Activates a specified page in the task pane. |
|
Sets the caption name of a task pane. |
|
Sets the height of a group caption. |
|
Sets the horizontal offset of a group caption. |
|
Sets the vertical offset of a group caption. |
|
Sets a group name. |
|
Sets the text color for a group caption. |
|
Sets the vertical offset for a group. |
|
Sets the horizontal spacing between a task pane and the edges of the client area. |
|
Sets the image list associated with tasks. |
|
Sets the caption text for a task pane page. |
|
Sets the name for a task. |
|
|
|
|
|
Sets the text color for a task. |
|
Sets the horizontal offset of tasks from the left and right edges of their parent groups. |
|
Sets the vertical spacing between a task pane and the edges of the client area. |
|
Sets the height for a window. |
|
|
|
Shows or hides a task. |
|
Shows or hides a task based on its command ID. |
|
Updates the GUI elements that belong to a task pane. |
Protected Methods
Name |
Description |
---|---|
Called by the framework when a new task pane page is activated. |
Remarks
The CMFCTasksPane class implements the following functionality:
Items can be grouped and each item grouping can have an associated caption.
Item groupings can be collapsed or expanded.
An icon can be assigned to each item in the task pane.
Individual items can be associated with a command ID which executes when a user clicks the item. When the click occurs, the WM_COMMAND message is sent to the owner of the task pane control.
To use the CMFCTasksPane control in your application, follow these steps:
Embed a CMFCTasksPane object into the main frame window class.
When processing the WM_CREATE message, call the Create method. You can use the regular CControlBar styles. For more information, see CControlBar::Create.
Call the CMFCTasksPane::AddGroup method to add various groups.
Call the CMFCTasksPane::AddTask, CMFCTasksPane::AddLabel or CMFCTasksPane::AddMRUFilesList member functions to add new items (tasks) to each group.
Call CMFCTasksPane::EnableGroupCollapse to specify whether item groups can collapse.
The following illustration shows a typical task pane control. The first group is a special group and its caption is a darker color. The third group is collapsed. The last group is aligned to the bottom of the task pane and has no caption, and the last task in the group is a simple label:
You can customize the appearance of the task pane by adjusting various margins and offsets. The following illustration clarifies the meaning of these variables:
Example
The following example demonstrates how to construct a CMFCTasksPane object and use various methods in the CMFCTasksPane class. The example shows how to enable the collapsing of task groups, enable the drop-down menus on the Next and Previous navigation buttons, enable the scroll buttons instead of a scroll bar, enable the word wrapping for the text in labels, set the caption name of the task pane, set the text color for a group caption, and set the horizontal and vertical margins.
CMFCTasksPane* tPane = new CMFCTasksPane();
tPane->EnableGroupCollapse(true);
tPane->EnableHistoryMenuButtons(true);
tPane->EnableScrollButtons(true);
tPane->EnableWrapLabels(true);
tPane->SetCaption(_T("Task Pane"));
tPane->SetGroupTextColor(0,RGB(0,0,128));
tPane->SetHorzMargin(15);
tPane->SetVertMargin(15);
tPane->Update();
Inheritance Hierarchy
Requirements
Header: afxTasksPane.h