]> git.saurik.com Git - wxWidgets.git/blame_incremental - src/mac/checkbox.cpp
set more event object fields for lbox dbl click events
[wxWidgets.git] / src / mac / checkbox.cpp
... / ...
CommitLineData
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
18#if !USE_SHARED_LIBRARY
19IMPLEMENT_DYNAMIC_CLASS(wxCheckBox, wxControl)
20IMPLEMENT_DYNAMIC_CLASS(wxBitmapCheckBox, wxCheckBox)
21#endif
22
23#include <wx/mac/uma.h>
24
25// Single check box item
26bool wxCheckBox::Create(wxWindow *parent, wxWindowID id, const wxString& label,
27 const wxPoint& pos,
28 const wxSize& size, long style,
29 const wxValidator& validator,
30 const wxString& name)
31{
32 Rect bounds ;
33 Str255 title ;
34
35 MacPreControlCreate( parent , id , label , pos , size ,style, validator , name , &bounds , title ) ;
36
37 m_macControl = UMANewControl( parent->GetMacRootWindow() , &bounds , title , true , 0 , 0 , 1,
38 kControlCheckBoxProc , (long) this ) ;
39
40 MacPostControlCreate() ;
41
42 return TRUE;
43}
44
45void wxCheckBox::SetValue(bool val)
46{
47 ::SetControlValue( m_macControl , val ) ;
48}
49
50bool wxCheckBox::GetValue() const
51{
52 return ::GetControlValue( m_macControl ) ;
53}
54
55void wxCheckBox::Command (wxCommandEvent & event)
56{
57 SetValue ((event.GetInt() != 0));
58 ProcessCommand (event);
59}
60
61void wxCheckBox::MacHandleControlClick( ControlHandle control , SInt16 controlpart )
62{
63 SetValue( !GetValue() ) ;
64 wxCommandEvent event(wxEVT_COMMAND_CHECKBOX_CLICKED, m_windowId );
65 event.SetInt(GetValue());
66 event.SetEventObject(this);
67 ProcessCommand(event);
68}
69
70// Bitmap checkbox
71bool wxBitmapCheckBox::Create(wxWindow *parent, wxWindowID id, const wxBitmap *label,
72 const wxPoint& pos,
73 const wxSize& size, long style,
74 const wxValidator& validator,
75 const wxString& name)
76{
77 SetName(name);
78 SetValidator(validator);
79 m_windowStyle = style;
80
81 if (parent) parent->AddChild(this);
82
83 if ( id == -1 )
84 m_windowId = NewControlId();
85 else
86 m_windowId = id;
87
88 // TODO: Create the bitmap checkbox
89
90 return FALSE;
91}
92
93void wxBitmapCheckBox::SetLabel(const wxBitmap *bitmap)
94{
95 // TODO
96}
97
98void wxBitmapCheckBox::SetSize(int x, int y, int width, int height, int sizeFlags)
99{
100 wxControl::SetSize( x , y , width , height , sizeFlags ) ;
101}
102
103void wxBitmapCheckBox::SetValue(bool val)
104{
105 // TODO
106}
107
108bool wxBitmapCheckBox::GetValue() const
109{
110 // TODOD
111 return FALSE;
112}
113
114