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"
|
|
|
|
|
|
|
|
// Checkbox item (single checkbox)
|
|
|
|
class WXDLLEXPORT wxBitmap;
|
2001-07-06 17:45:11 -04:00
|
|
|
class WXDLLEXPORT wxCheckBox : public wxCheckBoxBase
|
1999-07-29 01:11:30 -04:00
|
|
|
{
|
|
|
|
public:
|
2002-01-06 19:44:31 -05:00
|
|
|
inline wxCheckBox() { }
|
|
|
|
inline wxCheckBox( wxWindow* pParent
|
|
|
|
,wxWindowID vId
|
|
|
|
,const wxString& rsLabel
|
|
|
|
,const wxPoint& rPos = wxDefaultPosition
|
|
|
|
,const wxSize& rSize = wxDefaultSize
|
|
|
|
,long lStyle = 0
|
|
|
|
#if wxUSE_VALIDATORS
|
|
|
|
,const wxValidator& rValidator = wxDefaultValidator
|
|
|
|
#endif
|
|
|
|
,const wxString& rsName = wxCheckBoxNameStr
|
|
|
|
)
|
|
|
|
{
|
|
|
|
Create( pParent
|
|
|
|
,vId
|
|
|
|
,rsLabel
|
|
|
|
,rPos
|
|
|
|
,rSize
|
|
|
|
,lStyle
|
1999-11-08 00:18:15 -05:00
|
|
|
#if wxUSE_VALIDATORS
|
2002-01-06 19:44:31 -05:00
|
|
|
,rValidator
|
1999-11-08 00:18:15 -05:00
|
|
|
#endif
|
2002-01-06 19:44:31 -05:00
|
|
|
,rsName
|
|
|
|
);
|
|
|
|
}
|
1999-07-29 01:11:30 -04:00
|
|
|
|
2002-01-06 19:44:31 -05:00
|
|
|
bool Create( wxWindow* pParent
|
|
|
|
,wxWindowID vId
|
|
|
|
,const wxString& rsLabel
|
|
|
|
,const wxPoint& rPos = wxDefaultPosition
|
|
|
|
,const wxSize& rSize = wxDefaultSize
|
|
|
|
,long lStyle = 0
|
1999-11-08 00:18:15 -05:00
|
|
|
#if wxUSE_VALIDATORS
|
2002-01-06 19:44:31 -05:00
|
|
|
,const wxValidator& rValidator = wxDefaultValidator
|
1999-11-08 00:18:15 -05:00
|
|
|
#endif
|
2002-01-06 19:44:31 -05:00
|
|
|
,const wxString& rsName = wxCheckBoxNameStr
|
|
|
|
);
|
1999-10-14 00:43:46 -04:00
|
|
|
|
2002-01-06 19:44:31 -05:00
|
|
|
virtual void SetValue(bool bValue);
|
|
|
|
virtual bool GetValue(void) const ;
|
1999-10-14 00:43:46 -04:00
|
|
|
|
2002-01-06 19:44:31 -05:00
|
|
|
virtual bool OS2Command( WXUINT uParam
|
|
|
|
,WXWORD wId
|
|
|
|
);
|
|
|
|
virtual void SetLabel(const wxString& rsLabel);
|
|
|
|
virtual void Command(wxCommandEvent& rEvent);
|
1999-10-14 00:43:46 -04:00
|
|
|
|
|
|
|
protected:
|
2002-01-06 19:44:31 -05:00
|
|
|
virtual wxSize DoGetBestSize(void) const;
|
2001-07-06 17:45:11 -04:00
|
|
|
private:
|
|
|
|
DECLARE_DYNAMIC_CLASS(wxCheckBox)
|
1999-07-29 01:11:30 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
class WXDLLEXPORT wxBitmapCheckBox: public wxCheckBox
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
|
2002-01-06 19:44:31 -05:00
|
|
|
inline wxBitmapCheckBox() { m_nCheckWidth = -1; m_nCheckHeight = -1; }
|
|
|
|
inline wxBitmapCheckBox( wxWindow* pParent
|
|
|
|
,wxWindowID vId
|
|
|
|
,const wxBitmap* pLabel
|
|
|
|
,const wxPoint& rPos = wxDefaultPosition
|
|
|
|
,const wxSize& rSize = wxDefaultSize
|
|
|
|
,long lStyle = 0
|
1999-11-08 00:18:15 -05:00
|
|
|
#if wxUSE_VALIDATORS
|
2002-01-06 19:44:31 -05:00
|
|
|
,const wxValidator& rValidator = wxDefaultValidator
|
1999-11-08 00:18:15 -05:00
|
|
|
#endif
|
2002-01-06 19:44:31 -05:00
|
|
|
,const wxString& rsName = wxCheckBoxNameStr
|
|
|
|
)
|
|
|
|
{
|
|
|
|
Create( pParent
|
|
|
|
,vId
|
|
|
|
,pLabel
|
|
|
|
,rPos
|
|
|
|
,rSize
|
|
|
|
,lStyle
|
|
|
|
,rValidator
|
|
|
|
,rsName
|
|
|
|
);
|
|
|
|
}
|
1999-07-29 01:11:30 -04:00
|
|
|
|
2002-01-06 19:44:31 -05:00
|
|
|
bool Create( wxWindow* pParent
|
|
|
|
,wxWindowID vId
|
|
|
|
,const wxBitmap* pLabel
|
|
|
|
,const wxPoint& rPos = wxDefaultPosition
|
|
|
|
,const wxSize& rSize = wxDefaultSize
|
|
|
|
,long lStyle = 0
|
1999-11-08 00:18:15 -05:00
|
|
|
#if wxUSE_VALIDATORS
|
2002-01-06 19:44:31 -05:00
|
|
|
,const wxValidator& rValidator = wxDefaultValidator
|
1999-11-08 00:18:15 -05:00
|
|
|
#endif
|
2002-01-06 19:44:31 -05:00
|
|
|
,const wxString& rsName = wxCheckBoxNameStr
|
|
|
|
);
|
|
|
|
|
|
|
|
virtual void SetLabel(const wxBitmap& rBitmap);
|
|
|
|
|
|
|
|
int m_nCheckWidth;
|
|
|
|
int m_nCheckHeight;
|
1999-10-14 00:43:46 -04:00
|
|
|
|
1999-07-29 01:11:30 -04:00
|
|
|
private:
|
2002-01-06 19:44:31 -05:00
|
|
|
|
|
|
|
virtual void SetLabel(const wxString& rsString)
|
|
|
|
{ wxCheckBox::SetLabel(rsString); };
|
|
|
|
DECLARE_DYNAMIC_CLASS(wxBitmapCheckBox)
|
1999-07-29 01:11:30 -04:00
|
|
|
};
|
|
|
|
#endif
|
|
|
|
// _WX_CHECKBOX_H_
|