]> git.saurik.com Git - wxWidgets.git/blame - src/mac/checkbox.cpp
??
[wxWidgets.git] / src / mac / checkbox.cpp
CommitLineData
e9576ca5
SC
1/////////////////////////////////////////////////////////////////////////////
2// Name: checkbox.cpp
3// Purpose: wxCheckBox
4// Author: AUTHOR
5// Modified by:
6// Created: 04/01/98
7// RCS-ID: $Id$
8// Copyright: (c) AUTHOR
9// Licence: wxWindows licence
10/////////////////////////////////////////////////////////////////////////////
11
12#ifdef __GNUG__
13#pragma implementation "checkbox.h"
14#endif
15
16#include "wx/checkbox.h"
17
e9576ca5
SC
18IMPLEMENT_DYNAMIC_CLASS(wxCheckBox, wxControl)
19IMPLEMENT_DYNAMIC_CLASS(wxBitmapCheckBox, wxCheckBox)
e9576ca5 20
519cb848
SC
21#include <wx/mac/uma.h>
22
e9576ca5
SC
23// Single check box item
24bool wxCheckBox::Create(wxWindow *parent, wxWindowID id, const wxString& label,
25 const wxPoint& pos,
26 const wxSize& size, long style,
27 const wxValidator& validator,
28 const wxString& name)
29{
519cb848
SC
30 Rect bounds ;
31 Str255 title ;
32
33 MacPreControlCreate( parent , id , label , pos , size ,style, validator , name , &bounds , title ) ;
e9576ca5 34
519cb848
SC
35 m_macControl = UMANewControl( parent->GetMacRootWindow() , &bounds , title , true , 0 , 0 , 1,
36 kControlCheckBoxProc , (long) this ) ;
37
38 MacPostControlCreate() ;
e9576ca5 39
519cb848 40 return TRUE;
e9576ca5
SC
41}
42
43void wxCheckBox::SetValue(bool val)
44{
519cb848 45 ::SetControlValue( m_macControl , val ) ;
e9576ca5
SC
46}
47
48bool wxCheckBox::GetValue() const
49{
519cb848 50 return ::GetControlValue( m_macControl ) ;
e9576ca5
SC
51}
52
53void wxCheckBox::Command (wxCommandEvent & event)
54{
55 SetValue ((event.GetInt() != 0));
56 ProcessCommand (event);
57}
58
519cb848
SC
59void wxCheckBox::MacHandleControlClick( ControlHandle control , SInt16 controlpart )
60{
61 SetValue( !GetValue() ) ;
62}
63
e9576ca5
SC
64// Bitmap checkbox
65bool wxBitmapCheckBox::Create(wxWindow *parent, wxWindowID id, const wxBitmap *label,
66 const wxPoint& pos,
67 const wxSize& size, long style,
68 const wxValidator& validator,
69 const wxString& name)
70{
71 SetName(name);
72 SetValidator(validator);
73 m_windowStyle = style;
74
75 if (parent) parent->AddChild(this);
76
77 if ( id == -1 )
78 m_windowId = NewControlId();
79 else
80 m_windowId = id;
81
82 // TODO: Create the bitmap checkbox
83
84 return FALSE;
85}
86
87void wxBitmapCheckBox::SetLabel(const wxBitmap *bitmap)
88{
89 // TODO
90}
91
92void wxBitmapCheckBox::SetSize(int x, int y, int width, int height, int sizeFlags)
93{
519cb848 94 wxControl::SetSize( x , y , width , height , sizeFlags ) ;
e9576ca5
SC
95}
96
97void wxBitmapCheckBox::SetValue(bool val)
98{
99 // TODO
100}
101
102bool wxBitmapCheckBox::GetValue() const
103{
104 // TODOD
105 return FALSE;
106}
107
108