1 /////////////////////////////////////////////////////////////////////////////
2 // Name: src/univ/control.cpp
3 // Purpose: universal wxControl: adds handling of mnemonics
4 // Author: Vadim Zeitlin
8 // Copyright: (c) 2000 SciTech Software, Inc. (www.scitechsoft.com)
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
12 // ============================================================================
14 // ============================================================================
16 // ----------------------------------------------------------------------------
18 // ----------------------------------------------------------------------------
20 #include "wx/wxprec.h"
28 #include "wx/control.h"
32 #include "wx/dcclient.h"
35 #include "wx/univ/renderer.h"
36 #include "wx/univ/inphand.h"
37 #include "wx/univ/theme.h"
39 // ============================================================================
41 // ============================================================================
43 IMPLEMENT_DYNAMIC_CLASS(wxControl, wxWindow)
45 BEGIN_EVENT_TABLE(wxControl, wxControlBase)
46 WX_EVENT_TABLE_INPUT_CONSUMER(wxControl)
49 WX_FORWARD_TO_INPUT_CONSUMER(wxControl)
51 // ----------------------------------------------------------------------------
53 // ----------------------------------------------------------------------------
55 void wxControl::Init()
60 bool wxControl::Create(wxWindow *parent,
65 const wxValidator& validator,
68 if ( !wxControlBase::Create(parent, id, pos, size, style, validator, name) )
70 // underlying window creation failed?
77 // ----------------------------------------------------------------------------
79 // ----------------------------------------------------------------------------
81 void wxControl::SetLabel(const wxString& label)
83 // save original label
84 wxControlBase::SetLabel(label);
86 UnivDoSetLabel(label);
89 void wxControl::UnivDoSetLabel(const wxString& label)
91 wxString labelOld = m_label;
92 m_indexAccel = FindAccelIndex(label, &m_label);
94 if ( m_label != labelOld )
100 #endif // wxUSE_CONTROLS