1998-09-18 10:19:10 +00:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Name: checkbox.h
|
|
|
|
// Purpose: wxCheckBox class
|
|
|
|
// Author: Julian Smart
|
|
|
|
// Modified by:
|
|
|
|
// Created: 17/09/98
|
|
|
|
// RCS-ID: $Id$
|
|
|
|
// Copyright: (c) Julian Smart
|
|
|
|
// Licence: wxWindows licence
|
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
#ifndef _WX_CHECKBOX_H_
|
|
|
|
#define _WX_CHECKBOX_H_
|
|
|
|
|
|
|
|
#ifdef __GNUG__
|
|
|
|
#pragma interface "checkbox.h"
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#include "wx/control.h"
|
|
|
|
|
|
|
|
WXDLLEXPORT_DATA(extern const char*) wxCheckBoxNameStr;
|
|
|
|
|
|
|
|
// Checkbox item (single checkbox)
|
|
|
|
class WXDLLEXPORT wxBitmap;
|
|
|
|
class WXDLLEXPORT wxCheckBox: public wxControl
|
|
|
|
{
|
|
|
|
DECLARE_DYNAMIC_CLASS(wxCheckBox)
|
|
|
|
|
|
|
|
public:
|
|
|
|
inline wxCheckBox() { }
|
|
|
|
inline wxCheckBox(wxWindow *parent, wxWindowID id, const wxString& 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);
|
|
|
|
}
|
|
|
|
|
|
|
|
bool Create(wxWindow *parent, wxWindowID id, const wxString& label,
|
|
|
|
const wxPoint& pos = wxDefaultPosition,
|
|
|
|
const wxSize& size = wxDefaultSize, long style = 0,
|
|
|
|
const wxValidator& validator = wxDefaultValidator,
|
|
|
|
const wxString& name = wxCheckBoxNameStr);
|
|
|
|
virtual void SetValue(bool);
|
|
|
|
virtual bool GetValue() const ;
|
|
|
|
virtual void Command(wxCommandEvent& event);
|
1998-10-21 21:43:20 +00:00
|
|
|
|
|
|
|
// Implementation
|
1998-10-26 17:10:25 +00:00
|
|
|
virtual void ChangeFont(bool keepOriginalSize = TRUE);
|
1998-10-21 21:43:20 +00:00
|
|
|
virtual void ChangeBackgroundColour();
|
|
|
|
virtual void ChangeForegroundColour();
|
1998-09-18 10:19:10 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
class WXDLLEXPORT wxBitmapCheckBox: public wxCheckBox
|
|
|
|
{
|
|
|
|
DECLARE_DYNAMIC_CLASS(wxBitmapCheckBox)
|
|
|
|
|
|
|
|
public:
|
|
|
|
int checkWidth ;
|
|
|
|
int checkHeight ;
|
|
|
|
|
|
|
|
inline wxBitmapCheckBox() { checkWidth = -1; checkHeight = -1; }
|
|
|
|
inline wxBitmapCheckBox(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);
|
|
|
|
}
|
|
|
|
|
|
|
|
bool Create(wxWindow *parent, wxWindowID id, const wxBitmap *bitmap,
|
|
|
|
const wxPoint& pos = wxDefaultPosition,
|
|
|
|
const wxSize& size = wxDefaultSize, long style = 0,
|
|
|
|
const wxValidator& validator = wxDefaultValidator,
|
|
|
|
const wxString& name = wxCheckBoxNameStr);
|
1998-11-28 13:38:40 +00:00
|
|
|
|
1998-09-18 10:19:10 +00:00
|
|
|
virtual void SetValue(bool);
|
|
|
|
virtual bool GetValue() const ;
|
1998-11-28 13:38:40 +00:00
|
|
|
|
1998-09-18 10:19:10 +00:00
|
|
|
virtual void SetSize(int x, int y, int width, int height, int sizeFlags = wxSIZE_AUTO);
|
1998-11-28 13:38:40 +00:00
|
|
|
virtual void SetSize(const wxRect& rect, int sizeFlags = wxSIZE_AUTO)
|
|
|
|
{ wxWindow::SetSize(rect, sizeFlags); }
|
|
|
|
virtual void SetSize(const wxSize& size) { wxWindow::SetSize(size); }
|
1999-01-26 11:51:12 +00:00
|
|
|
virtual void SetSize(int width, int height) { SetSize(-1, -1, width, height, wxSIZE_USE_EXISTING); }
|
1998-11-28 13:38:40 +00:00
|
|
|
|
1999-02-04 11:14:41 +00:00
|
|
|
virtual void SetLabel(const wxBitmap& bitmap);
|
|
|
|
virtual void SetLabel(const wxString& label) { wxControl::SetLabel(label); };
|
1998-09-18 10:19:10 +00:00
|
|
|
};
|
|
|
|
#endif
|
|
|
|
// _WX_CHECKBOX_H_
|