2009-09-08 12:08:10 +00:00
|
|
|
/* PCSX2 - PS2 Emulator for PCs
|
|
|
|
* Copyright (C) 2002-2009 PCSX2 Dev Team
|
|
|
|
*
|
|
|
|
* PCSX2 is free software: you can redistribute it and/or modify it under the terms
|
|
|
|
* of the GNU Lesser General Public License as published by the Free Software Found-
|
|
|
|
* ation, either version 3 of the License, or (at your option) any later version.
|
2009-08-20 14:34:48 +00:00
|
|
|
*
|
2009-09-08 12:08:10 +00:00
|
|
|
* PCSX2 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.
|
2009-08-20 14:34:48 +00:00
|
|
|
*
|
2009-09-08 12:08:10 +00:00
|
|
|
* You should have received a copy of the GNU General Public License along with PCSX2.
|
|
|
|
* If not, see <http://www.gnu.org/licenses/>.
|
2009-08-20 14:34:48 +00:00
|
|
|
*/
|
|
|
|
|
2009-07-07 20:53:32 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <wx/wx.h>
|
2009-11-18 07:53:02 +00:00
|
|
|
#include "wxGuiTools.h"
|
2009-07-11 08:31:38 +00:00
|
|
|
|
2009-11-18 07:53:02 +00:00
|
|
|
// -------------------------------------------------------------------------------------
|
2009-11-10 17:53:22 +00:00
|
|
|
// pxCheckBox
|
|
|
|
// --------------------------------------------------------------------------------------
|
2009-11-14 08:36:57 +00:00
|
|
|
// The checkbox panel created uses the default spacer setting for adding checkboxes (see
|
|
|
|
// SizerFlags). The SetToolTip API provided by this function applies the tooltip to both
|
|
|
|
// both the checkbox and it's static subtext (if present), and performs word wrapping on
|
|
|
|
// platforms that need it (eg mswindows).
|
|
|
|
//
|
2009-11-18 07:53:02 +00:00
|
|
|
class pxCheckBox : public wxPanelWithHelpers
|
2009-11-10 17:53:22 +00:00
|
|
|
{
|
|
|
|
protected:
|
|
|
|
wxCheckBox* m_checkbox;
|
2009-11-18 07:53:02 +00:00
|
|
|
pxStaticText* m_subtext;
|
2009-11-10 17:53:22 +00:00
|
|
|
|
|
|
|
public:
|
2009-11-18 07:53:02 +00:00
|
|
|
pxCheckBox( wxWindow* parent, const wxString& label, const wxString& subtext=wxEmptyString );
|
2009-11-10 17:53:22 +00:00
|
|
|
virtual ~pxCheckBox() throw() {}
|
|
|
|
|
|
|
|
bool HasSubText() const { return m_subtext != NULL; }
|
2009-11-18 07:53:02 +00:00
|
|
|
const pxStaticText* GetSubText() const { return m_subtext; }
|
2009-11-10 17:53:22 +00:00
|
|
|
|
|
|
|
pxCheckBox& SetToolTip( const wxString& tip );
|
2009-11-11 11:36:13 +00:00
|
|
|
pxCheckBox& SetValue( bool val );
|
|
|
|
bool GetValue() const;
|
2009-11-11 14:08:42 +00:00
|
|
|
bool IsChecked() const { pxAssert( m_checkbox != NULL ); return m_checkbox->IsChecked(); }
|
2009-11-10 17:53:22 +00:00
|
|
|
|
|
|
|
operator wxCheckBox&() { pxAssert( m_checkbox != NULL ); return *m_checkbox; }
|
|
|
|
operator const wxCheckBox&() const { pxAssert( m_checkbox != NULL ); return *m_checkbox; }
|
2009-11-11 11:36:13 +00:00
|
|
|
|
|
|
|
wxCheckBox* GetWxPtr() { return m_checkbox; }
|
|
|
|
const wxCheckBox* GetWxPtr() const { return m_checkbox; }
|
2009-11-14 08:36:57 +00:00
|
|
|
|
|
|
|
wxWindowID GetId() const { pxAssert( m_checkbox != NULL ); return m_checkbox->GetId(); }
|
|
|
|
|
|
|
|
protected:
|
|
|
|
void Init( const wxString& label, const wxString& subtext );
|
2009-11-10 17:53:22 +00:00
|
|
|
};
|