/*************************************************************************** * Copyright (C) 2007 by Torben Nielsen * * torben@t-hoerup.dk * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ #include "wxcputhrottleframe.h" #include "SysMetrix.xpm" BEGIN_EVENT_TABLE( wxCpuThrottleFrame, wxDialog ) EVT_CLOSE( wxCpuThrottleFrame::OnClose ) END_EVENT_TABLE() wxCpuThrottleFrame::wxCpuThrottleFrame( const wxString& title, const wxPoint& pos, const wxSize& size ) : wxDialog((wxDialog *)NULL, -1, title, pos, size), mIcon(SysMetrix_xpm) { SetIcon(mIcon); mTrayIcon = new TrayIcon(this); mTrayIcon->SetIcon(mIcon,wxT("wxCpuThrottle") ); } void wxCpuThrottleFrame::OnQuit( wxCommandEvent& WXUNUSED( event ) ) { delete mTrayIcon; mTrayIcon = 0; Close(TRUE); wxExit(); } void wxCpuThrottleFrame::OnClose( wxCloseEvent& WXUNUSED( event ) ) { Show(false); } void wxCpuThrottleFrame::SetPosition() { const int freeBorder = 20; wxSize screenSize = ::wxGetDisplaySize(); wxSize mySize = GetSize(); Move(screenSize.GetWidth()-mySize.GetWidth() - freeBorder, screenSize.GetHeight() - mySize.GetHeight() - freeBorder); }