Add a second wxTaskBarIcon that uses the Dock (wxCocoa only)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@29912 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -64,6 +64,9 @@ MyDialog::MyDialog(wxWindow* parent, const wxWindowID id, const wxString& title,
|
|||||||
MyDialog::~MyDialog()
|
MyDialog::~MyDialog()
|
||||||
{
|
{
|
||||||
delete m_taskBarIcon;
|
delete m_taskBarIcon;
|
||||||
|
#if defined(__WXCOCOA__)
|
||||||
|
delete m_dockIcon;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void MyDialog::OnOK(wxCommandEvent& WXUNUSED(event))
|
void MyDialog::OnOK(wxCommandEvent& WXUNUSED(event))
|
||||||
@@ -94,6 +97,9 @@ void MyDialog::Init(void)
|
|||||||
Centre(wxBOTH);
|
Centre(wxBOTH);
|
||||||
|
|
||||||
m_taskBarIcon = new MyTaskBarIcon();
|
m_taskBarIcon = new MyTaskBarIcon();
|
||||||
|
#if defined(__WXCOCOA__)
|
||||||
|
m_dockIcon = new MyTaskBarIcon(wxTaskBarIcon::DOCK);
|
||||||
|
#endif
|
||||||
if (!m_taskBarIcon->SetIcon(wxICON(sample), wxT("wxTaskBarIcon Sample")))
|
if (!m_taskBarIcon->SetIcon(wxICON(sample), wxT("wxTaskBarIcon Sample")))
|
||||||
wxMessageBox(wxT("Could not set icon."));
|
wxMessageBox(wxT("Could not set icon."));
|
||||||
}
|
}
|
||||||
|
@@ -12,7 +12,13 @@
|
|||||||
class MyTaskBarIcon: public wxTaskBarIcon
|
class MyTaskBarIcon: public wxTaskBarIcon
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
MyTaskBarIcon() {};
|
#if defined(__WXCOCOA__)
|
||||||
|
MyTaskBarIcon(wxTaskBarIconType iconType = DEFAULT_TYPE)
|
||||||
|
: wxTaskBarIcon(iconType)
|
||||||
|
#else
|
||||||
|
MyTaskBarIcon()
|
||||||
|
#endif
|
||||||
|
{}
|
||||||
|
|
||||||
void OnLeftButtonDClick(wxTaskBarIconEvent&);
|
void OnLeftButtonDClick(wxTaskBarIconEvent&);
|
||||||
void OnMenuRestore(wxCommandEvent&);
|
void OnMenuRestore(wxCommandEvent&);
|
||||||
@@ -46,6 +52,9 @@ public:
|
|||||||
|
|
||||||
protected:
|
protected:
|
||||||
MyTaskBarIcon *m_taskBarIcon;
|
MyTaskBarIcon *m_taskBarIcon;
|
||||||
|
#if defined(__WXCOCOA__)
|
||||||
|
MyTaskBarIcon *m_dockIcon;
|
||||||
|
#endif
|
||||||
|
|
||||||
DECLARE_EVENT_TABLE()
|
DECLARE_EVENT_TABLE()
|
||||||
};
|
};
|
||||||
|
Reference in New Issue
Block a user