00001 00005 /*************************************************************************** 00006 * Copyright (C) 2006 by Peter Marquardt * 00007 * p_marquardt@users.sourceforge.net * 00008 * * 00009 * This program is free software; you can redistribute it and/or modify * 00010 * it under the terms of the GNU General Public License as published by * 00011 * the Free Software Foundation; either version 2 of the License, or * 00012 * (at your option) any later version. * 00013 * * 00014 * This program is distributed in the hope that it will be useful, * 00015 * but WITHOUT ANY WARRANTY; without even the implied warranty of * 00016 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 00017 * GNU General Public License for more details. * 00018 * * 00019 * You should have received a copy of the GNU General Public License * 00020 * along with this program; if not, write to the * 00021 * Free Software Foundation, Inc., * 00022 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * 00023 ***************************************************************************/ 00024 #include "mytaskbaricon.h" 00025 extern vdr_remoteFrame *frame; 00026 BEGIN_EVENT_TABLE(MyTaskbarIcon, wxTaskBarIcon) 00027 EVT_TASKBAR_LEFT_DOWN (MyTaskbarIcon::OnLeftButtonClick) 00028 END_EVENT_TABLE() 00029 DECLARE_APP(vdr_remoteapp) 00030 MyTaskbarIcon::MyTaskbarIcon() 00031 { 00032 00033 } 00034 00035 00036 MyTaskbarIcon::~MyTaskbarIcon() 00037 { 00038 } 00039 00040 void MyTaskbarIcon::OnLeftButtonClick(wxTaskBarIconEvent&) 00041 { 00042 if (frame->IsIconized()) 00043 { 00044 frame->Iconize(false); 00045 frame->Show(); 00046 #ifdef __WXMSW__ 00047 //This brings the Window to the front but breaks the hiding of the taskbar entry on MS Windows 00048 frame->Raise(); 00049 #endif 00050 00051 } 00052 else 00053 { 00054 frame->Iconize(true); 00055 frame->Hide(); 00056 } 00057 return; 00058 } 00059