]> git.saurik.com Git - wxWidgets.git/blame - include/wx/motif/checkbox.h
Coupled some core functionality out, to allow its use outside the wxLibrary
[wxWidgets.git] / include / wx / motif / checkbox.h
CommitLineData
9b6dbb09
JS
1/////////////////////////////////////////////////////////////////////////////
2// Name: checkbox.h
3// Purpose: wxCheckBox class
4// Author: Julian Smart
5// Modified by:
6// Created: 17/09/98
7// RCS-ID: $Id$
8// Copyright: (c) Julian Smart
9// Licence: wxWindows licence
10/////////////////////////////////////////////////////////////////////////////
11
12#ifndef _WX_CHECKBOX_H_
13#define _WX_CHECKBOX_H_
14
15#ifdef __GNUG__
16#pragma interface "checkbox.h"
17#endif
18
19#include "wx/control.h"
20
21WXDLLEXPORT_DATA(extern const char*) wxCheckBoxNameStr;
22
23// Checkbox item (single checkbox)
24class WXDLLEXPORT wxBitmap;
25class WXDLLEXPORT wxCheckBox: public wxControl
26{
27 DECLARE_DYNAMIC_CLASS(wxCheckBox)
28
29 public:
30 inline wxCheckBox() { }
31 inline wxCheckBox(wxWindow *parent, wxWindowID id, const wxString& label,
32 const wxPoint& pos = wxDefaultPosition,
33 const wxSize& size = wxDefaultSize, long style = 0,
34 const wxValidator& validator = wxDefaultValidator,
35 const wxString& name = wxCheckBoxNameStr)
36 {
37 Create(parent, id, label, pos, size, style, validator, name);
38 }
39
40 bool Create(wxWindow *parent, wxWindowID id, const wxString& label,
41 const wxPoint& pos = wxDefaultPosition,
42 const wxSize& size = wxDefaultSize, long style = 0,
43 const wxValidator& validator = wxDefaultValidator,
44 const wxString& name = wxCheckBoxNameStr);
45 virtual void SetValue(bool);
46 virtual bool GetValue() const ;
9b6dbb09 47 virtual void Command(wxCommandEvent& event);
0d57be45
JS
48
49// Implementation
4b5f3fe6 50 virtual void ChangeFont(bool keepOriginalSize = TRUE);
0d57be45
JS
51 virtual void ChangeBackgroundColour();
52 virtual void ChangeForegroundColour();
9b6dbb09
JS
53};
54
55class WXDLLEXPORT wxBitmapCheckBox: public wxCheckBox
56{
bfc6fde4 57 DECLARE_DYNAMIC_CLASS(wxBitmapCheckBox)
9b6dbb09 58
bfc6fde4
VZ
59public:
60 int checkWidth;
61 int checkHeight;
9b6dbb09 62
bfc6fde4
VZ
63 inline wxBitmapCheckBox() { checkWidth = -1; checkHeight = -1; }
64 inline wxBitmapCheckBox(wxWindow *parent, wxWindowID id, const wxBitmap *label,
65 const wxPoint& pos = wxDefaultPosition,
66 const wxSize& size = wxDefaultSize, long style = 0,
67 const wxValidator& validator = wxDefaultValidator,
68 const wxString& name = wxCheckBoxNameStr)
69 {
70 Create(parent, id, label, pos, size, style, validator, name);
71 }
9b6dbb09 72
bfc6fde4
VZ
73 bool Create(wxWindow *parent, wxWindowID id, const wxBitmap *bitmap,
74 const wxPoint& pos = wxDefaultPosition,
75 const wxSize& size = wxDefaultSize, long style = 0,
76 const wxValidator& validator = wxDefaultValidator,
77 const wxString& name = wxCheckBoxNameStr);
4fabb575 78
bfc6fde4
VZ
79 virtual void SetValue(bool value);
80 virtual bool GetValue() const;
4fabb575 81
bfc6fde4
VZ
82 virtual void SetLabel(const wxBitmap& bitmap);
83 virtual void SetLabel(const wxString& label) { wxControl::SetLabel(label); };
4fabb575 84
bfc6fde4
VZ
85protected:
86 virtual void DoSetSize(int x, int y,
87 int width, int height,
88 int sizeFlags = wxSIZE_AUTO);
9b6dbb09
JS
89};
90#endif
91 // _WX_CHECKBOX_H_