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:
David Elliott 2004-10-16 02:15:48 +00:00
parent b9242cc700
commit a5593369fc
2 changed files with 16 additions and 1 deletions

View File

@ -64,6 +64,9 @@ MyDialog::MyDialog(wxWindow* parent, const wxWindowID id, const wxString& title,
MyDialog::~MyDialog()
{
delete m_taskBarIcon;
#if defined(__WXCOCOA__)
delete m_dockIcon;
#endif
}
void MyDialog::OnOK(wxCommandEvent& WXUNUSED(event))
@ -94,6 +97,9 @@ void MyDialog::Init(void)
Centre(wxBOTH);
m_taskBarIcon = new MyTaskBarIcon();
#if defined(__WXCOCOA__)
m_dockIcon = new MyTaskBarIcon(wxTaskBarIcon::DOCK);
#endif
if (!m_taskBarIcon->SetIcon(wxICON(sample), wxT("wxTaskBarIcon Sample")))
wxMessageBox(wxT("Could not set icon."));
}

View File

@ -12,7 +12,13 @@
class MyTaskBarIcon: public wxTaskBarIcon
{
public:
MyTaskBarIcon() {};
#if defined(__WXCOCOA__)
MyTaskBarIcon(wxTaskBarIconType iconType = DEFAULT_TYPE)
: wxTaskBarIcon(iconType)
#else
MyTaskBarIcon()
#endif
{}
void OnLeftButtonDClick(wxTaskBarIconEvent&);
void OnMenuRestore(wxCommandEvent&);
@ -46,6 +52,9 @@ public:
protected:
MyTaskBarIcon *m_taskBarIcon;
#if defined(__WXCOCOA__)
MyTaskBarIcon *m_dockIcon;
#endif
DECLARE_EVENT_TABLE()
};