Rename access method of custom categories.

Author: Chaobin Zhang

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77621 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Bryan Petty
2014-09-10 14:54:51 +00:00
parent 2b8c76daff
commit e464ed176f
4 changed files with 23 additions and 20 deletions

View File

@@ -81,9 +81,9 @@ public:
const wxTaskBarJumpListCategory& GetRecentCategory();
const wxTaskBarJumpListCategories& GetCustomCategories() const;
void AddCategory(wxTaskBarJumpListCategory* category);
wxTaskBarJumpListCategory* RemoveCategory(const wxString& title);
void DeleteCategory(const wxString& title);
void AddCustomCategory(wxTaskBarJumpListCategory* category);
wxTaskBarJumpListCategory* RemoveCustomCategory(const wxString& title);
void DeleteCustomCategory(const wxString& title);
void Update();
private:

View File

@@ -224,9 +224,10 @@ public:
const wxTaskBarJumpListCategory& GetRecentCategory() const;
const wxTaskBarJumpListCategories& GetCustomCategories() const;
void AddCategory(wxTaskBarJumpListCategory* category);
wxTaskBarJumpListCategory* RemoveCategory(const wxString& title);
void DeleteCategory(const wxString& title);
void AddCustomCategory(wxTaskBarJumpListCategory* category);
wxTaskBarJumpListCategory* RemoveCustomCategory(const wxString& title);
void DeleteCustomCategory(const wxString& title);
void Update();
private:

View File

@@ -139,6 +139,7 @@ bool MyApp::OnInit()
{
if ( !wxApp::OnInit() )
return false;
wxTaskBarJumpList jumpList;
wxTaskBarJumpListItem *item1 = new wxTaskBarJumpListItem(
wxTASKBAR_JUMP_LIST_TASK,
@@ -165,16 +166,16 @@ bool MyApp::OnInit()
wxTaskBarJumpListItem* item3 = new wxTaskBarJumpListItem(
wxTASKBAR_JUMP_LIST_DESTIONATION,
wxT("Custom Item - Help"),
wxT("Help"),
wxStandardPaths::Get().GetExecutablePath(),
wxT("--help"),
wxT("Test Custom Category."),
wxT("wxTaskBarButton help."),
wxStandardPaths::Get().GetExecutablePath(),
0);
wxTaskBarJumpListCategory* customCategory =
new wxTaskBarJumpListCategory(wxT("Custom"));
customCategory->Append(item3);
jumpList.AddCategory(customCategory);
jumpList.AddCustomCategory(customCategory);
jumpList.Update();

View File

@@ -919,7 +919,6 @@ wxTaskBarJumpListItem::wxTaskBarJumpListItem(wxTaskBarJumpListItemType type,
{
}
wxTaskBarJumpListItemType wxTaskBarJumpListItem::GetType() const
{
return m_type;
@@ -1129,20 +1128,20 @@ wxTaskBarJumpList::GetCustomCategories() const
return m_jumpListImpl->GetCustomCategories();
}
void wxTaskBarJumpList::AddCategory(wxTaskBarJumpListCategory* category)
void wxTaskBarJumpList::AddCustomCategory(wxTaskBarJumpListCategory* category)
{
m_jumpListImpl->AddCategory(category);
m_jumpListImpl->AddCustomCategory(category);
}
wxTaskBarJumpListCategory* wxTaskBarJumpList::RemoveCategory(
wxTaskBarJumpListCategory* wxTaskBarJumpList::RemoveCustomCategory(
const wxString& title)
{
return m_jumpListImpl->RemoveCategory(title);
return m_jumpListImpl->RemoveCustomCategory(title);
}
void wxTaskBarJumpList::DeleteCategory(const wxString& title)
void wxTaskBarJumpList::DeleteCustomCategory(const wxString& title)
{
m_jumpListImpl->DeleteCategory(title);
m_jumpListImpl->DeleteCustomCategory(title);
}
void wxTaskBarJumpList::Update()
@@ -1251,13 +1250,15 @@ wxTaskBarJumpListImpl::GetCustomCategories() const
return m_customCategories;
}
void wxTaskBarJumpListImpl::AddCategory(wxTaskBarJumpListCategory *category)
void
wxTaskBarJumpListImpl::AddCustomCategory(wxTaskBarJumpListCategory *category)
{
wxASSERT_MSG( category != NULL, "Invalid category." );
m_customCategories.push_back(category);
}
wxTaskBarJumpListCategory*
wxTaskBarJumpListImpl::RemoveCategory(const wxString& title)
wxTaskBarJumpListImpl::RemoveCustomCategory(const wxString& title)
{
for ( wxTaskBarJumpListCategories::iterator it = m_customCategories.begin();
it != m_customCategories.end();
@@ -1273,9 +1274,9 @@ wxTaskBarJumpListImpl::RemoveCategory(const wxString& title)
return NULL;
}
void wxTaskBarJumpListImpl::DeleteCategory(const wxString& title)
void wxTaskBarJumpListImpl::DeleteCustomCategory(const wxString& title)
{
wxTaskBarJumpListCategory* category = RemoveCategory(title);
wxTaskBarJumpListCategory* category = RemoveCustomCategory(title);
if ( category )
delete category;
}