From 0dc6da2d7df15f9e09065459ceb42b536443e7e9 Mon Sep 17 00:00:00 2001 From: =?utf8?q?V=C3=A1clav=20Slav=C3=ADk?= Date: Mon, 31 May 2004 22:04:58 +0000 Subject: [PATCH] show icon changing on all platforms git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@27538 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- samples/taskbar/smile.xpm | 49 ++++++++++++++++++++++++++++++++++++++ samples/taskbar/tbtest.cpp | 15 ++++-------- 2 files changed, 53 insertions(+), 11 deletions(-) create mode 100644 samples/taskbar/smile.xpm diff --git a/samples/taskbar/smile.xpm b/samples/taskbar/smile.xpm new file mode 100644 index 0000000000..165e738a95 --- /dev/null +++ b/samples/taskbar/smile.xpm @@ -0,0 +1,49 @@ +/* XPM */ +static char * smile_xpm[] = { +"24 24 22 1", +" c None", +". c #404000", +"+ c #333300", +"@ c #7F7F00", +"# c #FFFF00", +"$ c #000000", +"% c #CFCF00", +"& c #9F9F00", +"* c #DFDF00", +"= c #303000", +"- c #808000", +"; c #BFBF00", +"> c #202000", +", c #707000", +"' c #606000", +") c #EFEF00", +"! c #9F1000", +"~ c #603000", +"{ c #DF0000", +"] c #FF0000", +"^ c #804000", +"/ c #800000", +" ...... ", +" +@@######@@+ ", +" $%##########%$ ", +" &##############& ", +" &################& ", +" $##################$ ", +" +%####*==*##*==*####%+ ", +" -#####-$$-##-$$-#####- ", +" -#####-$$-##-$$-#####- ", +".######-$$-##-$$-######.", +".######;>>;##;>>;######.", +".#####,#%%####%%#,#####.", +".####%,##########,%####.", +".##-->############>--##.", +".##;;;,##########,;;;##.", +" -####;')######)';####- ", +" -####*.'&####&'.*####- ", +" +%####*=!....!=*####%+ ", +" $######~{]]{~######$ ", +" &#####*^//^*#####& ", +" &#####*;;*#####& ", +" $%##########%$ ", +" +--######--+ ", +" ...... "}; diff --git a/samples/taskbar/tbtest.cpp b/samples/taskbar/tbtest.cpp index d84bf01373..44042da02f 100644 --- a/samples/taskbar/tbtest.cpp +++ b/samples/taskbar/tbtest.cpp @@ -25,6 +25,8 @@ #include "../sample.xpm" #endif +#include "smile.xpm" + #include "wx/taskbar.h" #include "tbtest.h" @@ -91,7 +93,6 @@ void MyDialog::Init(void) (new wxButton(this, wxID_OK, _T("Hide me"), wxPoint(100, 230), wxSize(80, 25)))->SetDefault(); Centre(wxBOTH); - m_taskBarIcon = new MyTaskBarIcon(); if (!m_taskBarIcon->SetIcon(wxICON(sample), wxT("wxTaskBarIcon Sample"))) wxMessageBox(wxT("Could not set icon.")); @@ -130,12 +131,10 @@ void MyTaskBarIcon::OnMenuExit(wxCommandEvent& ) void MyTaskBarIcon::OnMenuSetNewIcon(wxCommandEvent&) { -#ifdef __WXMSW__ - wxIcon icon(wxT("wxDEFAULT_FRAME")); + wxIcon icon(smile_xpm); - if (!SetIcon(icon, wxT("wxTaskBarIcon Sample"))) + if (!SetIcon(icon, wxT("wxTaskBarIcon Sample - a different icon"))) wxMessageBox(wxT("Could not set new icon.")); -#endif } // Overridables @@ -144,9 +143,7 @@ void MyTaskBarIcon::OnRButtonUp(wxEvent&) wxMenu menu; menu.Append(PU_RESTORE, _T("&Restore TBTest")); -#ifdef __WXMSW__ menu.Append(PU_NEW_ICON,_T("&Set New Icon")); -#endif menu.Append(PU_EXIT, _T("E&xit")); PopupMenu(&menu); @@ -156,7 +153,3 @@ void MyTaskBarIcon::OnLButtonDClick(wxEvent&) { dialog->Show(true); } - - - - -- 2.47.2