Use factory function for wxTaskBarButton creation.

This allows to encapsulate checking for errors, which should be handled when
using this class as task bar buttons API is not available under Windows XP.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77705 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2014-09-14 23:58:22 +00:00
parent 76aa6d5db7
commit 03e245091f
4 changed files with 19 additions and 5 deletions

View File

@@ -106,7 +106,10 @@ private:
class WXDLLIMPEXP_CORE wxTaskBarButton
{
public:
wxTaskBarButton() { }
// Factory function, may return NULL if task bar buttons are not supported
// by the current system.
static wxTaskBarButton* New(wxWindow* parent);
virtual ~wxTaskBarButton() { }
// Operations:
@@ -127,6 +130,9 @@ public:
virtual wxThumbBarButton* RemoveThumbBarButton(wxThumbBarButton *button) = 0;
virtual wxThumbBarButton* RemoveThumbBarButton(int id) = 0;
protected:
wxTaskBarButton() { }
private:
wxDECLARE_NO_COPY_CLASS(wxTaskBarButton);
};