]> git.saurik.com Git - wxWidgets.git/blame - src/mac/carbon/control.cpp
Remove my binary compatibility stuff from HEAD. Patch #1367014 used for reference.
[wxWidgets.git] / src / mac / carbon / control.cpp
CommitLineData
e9576ca5
SC
1/////////////////////////////////////////////////////////////////////////////
2// Name: control.cpp
3// Purpose: wxControl class
a31a5f85 4// Author: Stefan Csomor
e9576ca5 5// Modified by:
a31a5f85 6// Created: 1998-01-01
e9576ca5 7// RCS-ID: $Id$
a31a5f85 8// Copyright: (c) Stefan Csomor
65571936 9// Licence: wxWindows licence
e9576ca5
SC
10/////////////////////////////////////////////////////////////////////////////
11
3d1a4878 12#include "wx/wxprec.h"
d8c736e5 13
e9576ca5 14#include "wx/control.h"
03e11df5
GD
15#include "wx/panel.h"
16#include "wx/app.h"
5fde6fcc 17#include "wx/dc.h"
456c94e1 18#include "wx/dcclient.h"
519cb848
SC
19#include "wx/notebook.h"
20#include "wx/tabctrl.h"
2f1ae414 21#include "wx/radiobox.h"
519cb848 22#include "wx/spinbutt.h"
03e11df5
GD
23#include "wx/scrolbar.h"
24#include "wx/button.h"
25#include "wx/dialog.h"
26#include "wx/statbox.h"
27#include "wx/sizer.h"
28#include "wx/stattext.h"
e9576ca5 29
8208e181 30IMPLEMENT_ABSTRACT_CLASS(wxControl, wxWindow)
e9576ca5 31
d497dca4 32#include "wx/mac/uma.h"
7372fd0a 33#include "wx/mac/private.h"
519cb848 34
e9576ca5 35// Item members
519cb848 36
e9576ca5
SC
37wxControl::wxControl()
38{
e9576ca5
SC
39}
40
2f1ae414
SC
41bool wxControl::Create(wxWindow *parent, wxWindowID id,
42 const wxPoint& pos,
43 const wxSize& size, long style,
44 const wxValidator& validator,
45 const wxString& name)
46{
2f1ae414 47 bool rval = wxWindow::Create(parent, id, pos, size, style, name);
facd6764
SC
48
49#if 0
50 // no automatic inheritance as we most often need transparent backgrounds
327788ac
SC
51 if ( parent )
52 {
53 m_backgroundColour = parent->GetBackgroundColour() ;
54 m_foregroundColour = parent->GetForegroundColour() ;
55 }
facd6764
SC
56#endif
57
58 if (rval)
59 {
2f1ae414
SC
60#if wxUSE_VALIDATORS
61 SetValidator(validator);
62#endif
63 }
64 return rval;
65}
66
e9576ca5
SC
67wxControl::~wxControl()
68{
e7549107 69 m_isBeingDeleted = TRUE;
e9576ca5
SC
70}
71
e7549107 72bool wxControl::ProcessCommand (wxCommandEvent & event)
e9576ca5 73{
a3bf7524
VS
74 // Tries:
75 // 1) OnCommand, starting at this window and working up parent hierarchy
76 // 2) OnCommand then calls ProcessEvent to search the event tables.
77 return GetEventHandler()->ProcessEvent(event);
e9576ca5
SC
78}
79
519cb848
SC
80void wxControl::OnKeyDown( wxKeyEvent &event )
81{
21fd5529 82 if ( m_peer == NULL || !m_peer->Ok() )
89ebf1c9
RR
83 return ;
84
e40298d5
JS
85 char charCode ;
86 UInt32 keyCode ;
c5c9378c
SC
87 UInt32 modifiers ;
88
e40298d5
JS
89 GetEventParameter( (EventRef) wxTheApp->MacGetCurrentEvent(), kEventParamKeyMacCharCodes, typeChar, NULL,sizeof(char), NULL,&charCode );
90 GetEventParameter( (EventRef) wxTheApp->MacGetCurrentEvent(), kEventParamKeyCode, typeUInt32, NULL, sizeof(UInt32), NULL, &keyCode );
91 GetEventParameter((EventRef) wxTheApp->MacGetCurrentEvent(), kEventParamKeyModifiers, typeUInt32, NULL, sizeof(UInt32), NULL, &modifiers);
c5c9378c 92
5ca0d812 93 m_peer->HandleKey( keyCode , charCode , modifiers ) ;
519cb848
SC
94}
95