Added wxToggleBitmapButton (it compiles).

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@26131 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robert Roebling
2004-03-07 16:46:36 +00:00
parent 8471ea9033
commit 4f85606724
4 changed files with 468 additions and 2 deletions

View File

@@ -13,11 +13,14 @@
#ifndef _WX_GTK_TOGGLEBUTTON_H_
#define _WX_GTK_TOGGLEBUTTON_H_
#include "wx/bitmap.h"
//-----------------------------------------------------------------------------
// classes
//-----------------------------------------------------------------------------
class wxToggleButton;
class wxToggleBitmapButton;
//-----------------------------------------------------------------------------
// global data
@@ -25,6 +28,59 @@ class wxToggleButton;
extern const wxChar *wxCheckBoxNameStr;
//-----------------------------------------------------------------------------
// wxToggleBitmapButton
//-----------------------------------------------------------------------------
class wxToggleBitmapButton: public wxControl
{
public:
// construction/destruction
wxToggleBitmapButton() {}
wxToggleBitmapButton(wxWindow *parent,
wxWindowID id,
const wxBitmap& label,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = 0,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxCheckBoxNameStr)
{
Create(parent, id, label, pos, size, style, validator, name);
}
// Create the control
bool Create(wxWindow *parent,
wxWindowID id,
const wxBitmap& label,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize, long style = 0,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxCheckBoxNameStr);
// Get/set the value
void SetValue(bool state);
bool GetValue() const;
// Set the label
void SetLabel(const wxBitmap& label);
bool Enable(bool enable = TRUE);
// implementation
bool m_blockEvent;
wxBitmap m_bitmap;
void OnSetBitmap();
void ApplyWidgetStyle();
bool IsOwnGtkWindow(GdkWindow *window);
virtual void OnInternalIdle();
virtual wxSize DoGetBestSize() const;
private:
DECLARE_DYNAMIC_CLASS(wxToggleBitmapButton)
};
//-----------------------------------------------------------------------------
// wxToggleButton
//-----------------------------------------------------------------------------