1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: wxControl class
4 // Author: Stefan Csomor
8 // Copyright: (c) Stefan Csomor
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
12 #include "wx/wxprec.h"
14 #include "wx/control.h"
18 #include "wx/dcclient.h"
19 #include "wx/notebook.h"
20 #include "wx/tabctrl.h"
21 #include "wx/radiobox.h"
22 #include "wx/spinbutt.h"
23 #include "wx/scrolbar.h"
24 #include "wx/button.h"
25 #include "wx/dialog.h"
26 #include "wx/statbox.h"
28 #include "wx/stattext.h"
30 IMPLEMENT_ABSTRACT_CLASS(wxControl
, wxWindow
)
32 #include "wx/mac/uma.h"
33 #include "wx/mac/private.h"
37 wxControl::wxControl()
41 bool wxControl::Create(wxWindow
*parent
, wxWindowID id
,
43 const wxSize
& size
, long style
,
44 const wxValidator
& validator
,
47 bool rval
= wxWindow::Create(parent
, id
, pos
, size
, style
, name
);
50 // no automatic inheritance as we most often need transparent backgrounds
53 m_backgroundColour
= parent
->GetBackgroundColour() ;
54 m_foregroundColour
= parent
->GetForegroundColour() ;
61 SetValidator(validator
);
67 wxControl::~wxControl()
69 m_isBeingDeleted
= TRUE
;
72 bool wxControl::ProcessCommand (wxCommandEvent
& event
)
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
);
80 void wxControl::OnKeyDown( wxKeyEvent
&event
)
82 if ( m_peer
== NULL
|| !m_peer
->Ok() )
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
);
93 m_peer
->HandleKey( keyCode
, charCode
, modifiers
) ;