1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: wxControl class
4 // Author: Stefan Csomor
8 // Copyright: (c) Stefan Csomor
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
12 #if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
13 #pragma implementation "control.h"
16 #include "wx/wxprec.h"
18 #include "wx/control.h"
22 #include "wx/dcclient.h"
23 #include "wx/notebook.h"
24 #include "wx/tabctrl.h"
25 #include "wx/radiobox.h"
26 #include "wx/spinbutt.h"
27 #include "wx/scrolbar.h"
28 #include "wx/button.h"
29 #include "wx/dialog.h"
30 #include "wx/statbox.h"
32 #include "wx/stattext.h"
34 IMPLEMENT_ABSTRACT_CLASS(wxControl
, wxWindow
)
36 #include "wx/mac/uma.h"
37 #include "wx/mac/private.h"
41 wxControl::wxControl()
45 bool wxControl::Create(wxWindow
*parent
, wxWindowID id
,
47 const wxSize
& size
, long style
,
48 const wxValidator
& validator
,
51 bool rval
= wxWindow::Create(parent
, id
, pos
, size
, style
, name
);
54 // no automatic inheritance as we most often need transparent backgrounds
57 m_backgroundColour
= parent
->GetBackgroundColour() ;
58 m_foregroundColour
= parent
->GetForegroundColour() ;
65 SetValidator(validator
);
71 wxControl::~wxControl()
73 m_isBeingDeleted
= TRUE
;
76 bool wxControl::ProcessCommand (wxCommandEvent
& event
)
79 // 1) OnCommand, starting at this window and working up parent hierarchy
80 // 2) OnCommand then calls ProcessEvent to search the event tables.
81 return GetEventHandler()->ProcessEvent(event
);
84 void wxControl::OnKeyDown( wxKeyEvent
&event
)
86 if ( m_peer
== NULL
|| !m_peer
->Ok() )
93 GetEventParameter( (EventRef
) wxTheApp
->MacGetCurrentEvent(), kEventParamKeyMacCharCodes
, typeChar
, NULL
,sizeof(char), NULL
,&charCode
);
94 GetEventParameter( (EventRef
) wxTheApp
->MacGetCurrentEvent(), kEventParamKeyCode
, typeUInt32
, NULL
, sizeof(UInt32
), NULL
, &keyCode
);
95 GetEventParameter((EventRef
) wxTheApp
->MacGetCurrentEvent(), kEventParamKeyModifiers
, typeUInt32
, NULL
, sizeof(UInt32
), NULL
, &modifiers
);
97 m_peer
->HandleKey( keyCode
, charCode
, modifiers
) ;