1999-07-29 01:11:30 -04:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Name: checkbox.h
|
|
|
|
// Purpose: wxCheckBox class
|
1999-10-14 00:43:46 -04:00
|
|
|
// Author: David Webster
|
1999-07-29 01:11:30 -04:00
|
|
|
// Modified by:
|
1999-10-14 00:43:46 -04:00
|
|
|
// Created: 10/13/99
|
1999-07-29 01:11:30 -04:00
|
|
|
// RCS-ID: $Id$
|
1999-10-14 00:43:46 -04:00
|
|
|
// Copyright: (c) David Webster
|
|
|
|
// Licence: wxWindows licence
|
1999-07-29 01:11:30 -04:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
#ifndef _WX_CHECKBOX_H_
|
|
|
|
#define _WX_CHECKBOX_H_
|
|
|
|
|
|
|
|
#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,
|
1999-11-08 00:18:15 -05:00
|
|
|
#if wxUSE_VALIDATORS
|
1999-07-29 01:11:30 -04:00
|
|
|
const wxValidator& validator = wxDefaultValidator,
|
1999-11-08 00:18:15 -05:00
|
|
|
#endif
|
1999-07-29 01:11:30 -04:00
|
|
|
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,
|
1999-11-08 00:18:15 -05:00
|
|
|
#if wxUSE_VALIDATORS
|
1999-07-29 01:11:30 -04:00
|
|
|
const wxValidator& validator = wxDefaultValidator,
|
1999-11-08 00:18:15 -05:00
|
|
|
#endif
|
1999-07-29 01:11:30 -04:00
|
|
|
const wxString& name = wxCheckBoxNameStr);
|
1999-10-14 00:43:46 -04:00
|
|
|
|
1999-07-29 01:11:30 -04:00
|
|
|
virtual void SetValue(bool);
|
|
|
|
virtual bool GetValue() const ;
|
1999-10-14 00:43:46 -04:00
|
|
|
|
|
|
|
virtual bool OS2Command(WXUINT param, WXWORD id);
|
1999-07-29 01:11:30 -04:00
|
|
|
virtual void SetLabel(const wxString& label);
|
|
|
|
virtual void Command(wxCommandEvent& event);
|
1999-10-14 00:43:46 -04:00
|
|
|
virtual WXHBRUSH OnCtlColor(WXHDC pDC, WXHWND pWnd, WXUINT nCtlColor,
|
|
|
|
WXUINT message, WXWPARAM wParam, WXLPARAM lParam);
|
|
|
|
|
|
|
|
protected:
|
1999-11-20 20:03:00 -05:00
|
|
|
virtual wxSize DoGetBestSize() const;
|
1999-07-29 01:11:30 -04: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,
|
1999-11-08 00:18:15 -05:00
|
|
|
#if wxUSE_VALIDATORS
|
1999-07-29 01:11:30 -04:00
|
|
|
const wxValidator& validator = wxDefaultValidator,
|
1999-11-08 00:18:15 -05:00
|
|
|
#endif
|
1999-07-29 01:11:30 -04:00
|
|
|
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,
|
1999-11-08 00:18:15 -05:00
|
|
|
#if wxUSE_VALIDATORS
|
1999-07-29 01:11:30 -04:00
|
|
|
const wxValidator& validator = wxDefaultValidator,
|
1999-11-08 00:18:15 -05:00
|
|
|
#endif
|
1999-07-29 01:11:30 -04:00
|
|
|
const wxString& name = wxCheckBoxNameStr);
|
1999-10-14 00:43:46 -04:00
|
|
|
|
1999-07-29 01:11:30 -04:00
|
|
|
virtual void SetLabel(const wxBitmap& bitmap);
|
|
|
|
private:
|
1999-08-02 00:44:01 -04:00
|
|
|
virtual void SetLabel(const wxString& string)
|
|
|
|
{ wxCheckBox::SetLabel(string); };
|
1999-07-29 01:11:30 -04:00
|
|
|
};
|
|
|
|
#endif
|
|
|
|
// _WX_CHECKBOX_H_
|