]> git.saurik.com Git - wxWidgets.git/blame - src/mac/checkbox.cpp
added url of Fink Unix to Mac OS X porting instructions
[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
d8c736e5
GD
16#include "wx/defs.h"
17
e9576ca5
SC
18#include "wx/checkbox.h"
19
2f1ae414 20#if !USE_SHARED_LIBRARY
e9576ca5
SC
21IMPLEMENT_DYNAMIC_CLASS(wxCheckBox, wxControl)
22IMPLEMENT_DYNAMIC_CLASS(wxBitmapCheckBox, wxCheckBox)
2f1ae414 23#endif
e9576ca5 24
d497dca4 25#include "wx/mac/uma.h"
519cb848 26
e9576ca5
SC
27// Single check box item
28bool wxCheckBox::Create(wxWindow *parent, wxWindowID id, const wxString& label,
29 const wxPoint& pos,
30 const wxSize& size, long style,
31 const wxValidator& validator,
32 const wxString& name)
33{
519cb848
SC
34 Rect bounds ;
35 Str255 title ;
36
37 MacPreControlCreate( parent , id , label , pos , size ,style, validator , name , &bounds , title ) ;
e9576ca5 38
76a5e5d2 39 m_macControl = ::NewControl( MAC_WXHWND(parent->MacGetRootWindow()) , &bounds , title , false , 0 , 0 , 1,
519cb848
SC
40 kControlCheckBoxProc , (long) this ) ;
41
42 MacPostControlCreate() ;
e9576ca5 43
519cb848 44 return TRUE;
e9576ca5
SC
45}
46
47void wxCheckBox::SetValue(bool val)
48{
76a5e5d2 49 ::SetControlValue( (ControlHandle) m_macControl , val ) ;
73969f3f 50 MacRedrawControl() ;
e9576ca5
SC
51}
52
53bool wxCheckBox::GetValue() const
54{
76a5e5d2 55 return ::GetControlValue( (ControlHandle) m_macControl ) ;
e9576ca5
SC
56}
57
58void wxCheckBox::Command (wxCommandEvent & event)
59{
60 SetValue ((event.GetInt() != 0));
61 ProcessCommand (event);
62}
63
76a5e5d2 64void wxCheckBox::MacHandleControlClick( WXWidget control , wxInt16 controlpart )
519cb848
SC
65{
66 SetValue( !GetValue() ) ;
8208e181
SC
67 wxCommandEvent event(wxEVT_COMMAND_CHECKBOX_CLICKED, m_windowId );
68 event.SetInt(GetValue());
69 event.SetEventObject(this);
70 ProcessCommand(event);
519cb848
SC
71}
72
e9576ca5
SC
73// Bitmap checkbox
74bool wxBitmapCheckBox::Create(wxWindow *parent, wxWindowID id, const wxBitmap *label,
75 const wxPoint& pos,
76 const wxSize& size, long style,
77 const wxValidator& validator,
78 const wxString& name)
79{
80 SetName(name);
81 SetValidator(validator);
82 m_windowStyle = style;
83
84 if (parent) parent->AddChild(this);
85
86 if ( id == -1 )
87 m_windowId = NewControlId();
88 else
89 m_windowId = id;
90
91 // TODO: Create the bitmap checkbox
92
93 return FALSE;
94}
95
96void wxBitmapCheckBox::SetLabel(const wxBitmap *bitmap)
97{
98 // TODO
99}
100
101void wxBitmapCheckBox::SetSize(int x, int y, int width, int height, int sizeFlags)
102{
519cb848 103 wxControl::SetSize( x , y , width , height , sizeFlags ) ;
e9576ca5
SC
104}
105
106void wxBitmapCheckBox::SetValue(bool val)
107{
108 // TODO
109}
110
111bool wxBitmapCheckBox::GetValue() const
112{
113 // TODOD
114 return FALSE;
115}
116
117