Revise Show/Hide, for consistency with the other classes.

Author: Chaobin Zhang

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77580 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Chaobin, Zhang 2014-09-10 09:01:39 +00:00
parent 8f3fe516ba
commit 95c8ad1012
3 changed files with 8 additions and 5 deletions

View File

@ -22,7 +22,7 @@ public:
virtual ~wxTaskBarButtonImpl(); virtual ~wxTaskBarButtonImpl();
virtual void SetProgressValue(int value) wxOVERRIDE; virtual void SetProgressValue(int value) wxOVERRIDE;
virtual void Show() wxOVERRIDE; virtual void Show(bool show = true) wxOVERRIDE;
virtual void Hide() wxOVERRIDE; virtual void Hide() wxOVERRIDE;
virtual void SetThumbnailTooltip(const wxString& tooltip) wxOVERRIDE; virtual void SetThumbnailTooltip(const wxString& tooltip) wxOVERRIDE;
virtual void SetProgressState(wxTaskBarButtonState state) wxOVERRIDE; virtual void SetProgressState(wxTaskBarButtonState state) wxOVERRIDE;

View File

@ -55,7 +55,7 @@ public:
// Operations: // Operations:
virtual void SetProgressValue(int value) = 0; virtual void SetProgressValue(int value) = 0;
virtual void Show() = 0; virtual void Show(bool show = true) = 0;
virtual void Hide() = 0; virtual void Hide() = 0;
virtual void SetThumbnailTooltip(const wxString& tooltip) = 0; virtual void SetThumbnailTooltip(const wxString& tooltip) = 0;
virtual void SetProgressState(wxTaskBarButtonState state) = 0; virtual void SetProgressState(wxTaskBarButtonState state) = 0;

View File

@ -76,14 +76,17 @@ void wxTaskBarButtonImpl::SetProgressValue(int value)
m_taskbarList->SetProgressValue(m_hwnd, value, 100); m_taskbarList->SetProgressValue(m_hwnd, value, 100);
} }
void wxTaskBarButtonImpl::Show() void wxTaskBarButtonImpl::Show(bool show)
{ {
m_taskbarList->AddTab(m_hwnd); if ( show )
m_taskbarList->AddTab(m_hwnd);
else
m_taskbarList->DeleteTab(m_hwnd);
} }
void wxTaskBarButtonImpl::Hide() void wxTaskBarButtonImpl::Hide()
{ {
m_taskbarList->DeleteTab(m_hwnd); Show(false);
} }
void wxTaskBarButtonImpl::SetThumbnailTooltip(const wxString& tooltip) void wxTaskBarButtonImpl::SetThumbnailTooltip(const wxString& tooltip)