Refactor: create src/univ/anybutton.cpp.

Extract and pull the common functions from wxButton and wxToggleButton to
wxAnyButton in wxUniv too.

Also make wxToggleButton inherit from wxToggleButtonBase correctly

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77759 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2014-09-23 17:38:47 +00:00
parent 16601713a4
commit 43c99ef613
12 changed files with 497 additions and 386 deletions

View File

@@ -11,20 +11,17 @@
#ifndef _WX_UNIV_TGLBTN_H_
#define _WX_UNIV_TGLBTN_H_
#include "wx/button.h"
// ----------------------------------------------------------------------------
// wxToggleButton: a push button
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_CORE wxToggleButton: public wxButton
class WXDLLIMPEXP_CORE wxToggleButton: public wxToggleButtonBase
{
public:
wxToggleButton();
wxToggleButton(wxWindow *parent,
wxWindowID id,
const wxBitmap& bitmap,
const wxString& label = wxEmptyString,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
@@ -32,16 +29,15 @@ public:
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxCheckBoxNameStr);
wxToggleButton(wxWindow *parent,
wxWindowID id,
const wxString& label = wxEmptyString,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = 0,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxCheckBoxNameStr);
virtual ~wxToggleButton();
// Create the control
bool Create(wxWindow *parent,
wxWindowID id,
const wxString& lbl = wxEmptyString,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = 0,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxCheckBoxNameStr);
virtual bool IsPressed() const wxOVERRIDE { return m_isPressed || m_value; }