X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/9a83f860948059b0273b5cc6d9e43fadad3ebfca..e0dec8753abaf97e006ea1185bfb6775b28df0a8:/samples/taskbar/tbtest.cpp diff --git a/samples/taskbar/tbtest.cpp b/samples/taskbar/tbtest.cpp index a9abff2cb1..f5f8312666 100644 --- a/samples/taskbar/tbtest.cpp +++ b/samples/taskbar/tbtest.cpp @@ -29,7 +29,7 @@ #endif // the application icon (under Windows and OS/2 it is in resources) -#if defined(__WXGTK__) || defined(__WXMOTIF__) || defined(__WXMAC__) || defined(__WXMGL__) || defined(__WXX11__) +#ifndef wxHAS_IMAGES_IN_RESOURCES #include "../sample.xpm" #endif @@ -125,9 +125,6 @@ MyDialog::MyDialog(const wxString& title) Centre(); m_taskBarIcon = new MyTaskBarIcon(); -#if defined(__WXCOCOA__) - m_dockIcon = new MyTaskBarIcon(wxTaskBarIcon::DOCK); -#endif // we should be able to show up to 128 characters on recent Windows versions // (and 64 on Win9x) @@ -139,6 +136,14 @@ MyDialog::MyDialog(const wxString& title) { wxLogError(wxT("Could not set icon.")); } + +#if defined(__WXOSX__) && wxOSX_USE_COCOA + m_dockIcon = new MyTaskBarIcon(wxTaskBarIcon::DOCK); + if ( !m_dockIcon->SetIcon(wxICON(sample)) ) + { + wxLogError(wxT("Could not set icon.")); + } +#endif } MyDialog::~MyDialog() @@ -258,10 +263,14 @@ wxMenu *MyTaskBarIcon::CreatePopupMenu() submenu->AppendSeparator(); submenu->Append(PU_SUB2, wxT("Another submenu")); menu->Append(PU_SUBMAIN, wxT("Submenu"), submenu); -#ifndef __WXMAC_OSX__ /*Mac has built-in quit menu*/ - menu->AppendSeparator(); - menu->Append(PU_EXIT, wxT("E&xit")); + /* OSX has built-in quit menu for the dock menu, but not for the status item */ +#ifdef __WXOSX__ + if ( OSXIsStatusItem() ) #endif + { + menu->AppendSeparator(); + menu->Append(PU_EXIT, wxT("E&xit")); + } return menu; }