osx_cocoa supports both kind of taskbaricons in the menubar (standard) and as function of the dock (type DOCK)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@67081 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -125,9 +125,6 @@ MyDialog::MyDialog(const wxString& title)
|
|||||||
Centre();
|
Centre();
|
||||||
|
|
||||||
m_taskBarIcon = new MyTaskBarIcon();
|
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
|
// we should be able to show up to 128 characters on recent Windows versions
|
||||||
// (and 64 on Win9x)
|
// (and 64 on Win9x)
|
||||||
@@ -139,6 +136,14 @@ MyDialog::MyDialog(const wxString& title)
|
|||||||
{
|
{
|
||||||
wxLogError(wxT("Could not set icon."));
|
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()
|
MyDialog::~MyDialog()
|
||||||
@@ -258,7 +263,7 @@ wxMenu *MyTaskBarIcon::CreatePopupMenu()
|
|||||||
submenu->AppendSeparator();
|
submenu->AppendSeparator();
|
||||||
submenu->Append(PU_SUB2, wxT("Another submenu"));
|
submenu->Append(PU_SUB2, wxT("Another submenu"));
|
||||||
menu->Append(PU_SUBMAIN, wxT("Submenu"), submenu);
|
menu->Append(PU_SUBMAIN, wxT("Submenu"), submenu);
|
||||||
#ifndef __WXMAC_OSX__ /*Mac has built-in quit menu*/
|
#ifndef __WXOSX__ /*Mac has built-in quit menu*/
|
||||||
menu->AppendSeparator();
|
menu->AppendSeparator();
|
||||||
menu->Append(PU_EXIT, wxT("E&xit"));
|
menu->Append(PU_EXIT, wxT("E&xit"));
|
||||||
#endif
|
#endif
|
||||||
|
@@ -12,7 +12,7 @@
|
|||||||
class MyTaskBarIcon : public wxTaskBarIcon
|
class MyTaskBarIcon : public wxTaskBarIcon
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
#if defined(__WXCOCOA__)
|
#if defined(__WXOSX__) && wxOSX_USE_COCOA
|
||||||
MyTaskBarIcon(wxTaskBarIconType iconType = DEFAULT_TYPE)
|
MyTaskBarIcon(wxTaskBarIconType iconType = DEFAULT_TYPE)
|
||||||
: wxTaskBarIcon(iconType)
|
: wxTaskBarIcon(iconType)
|
||||||
#else
|
#else
|
||||||
@@ -53,7 +53,7 @@ protected:
|
|||||||
void OnCloseWindow(wxCloseEvent& event);
|
void OnCloseWindow(wxCloseEvent& event);
|
||||||
|
|
||||||
MyTaskBarIcon *m_taskBarIcon;
|
MyTaskBarIcon *m_taskBarIcon;
|
||||||
#if defined(__WXCOCOA__)
|
#if defined(__WXOSX__) && wxOSX_USE_COCOA
|
||||||
MyTaskBarIcon *m_dockIcon;
|
MyTaskBarIcon *m_dockIcon;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user