]>
git.saurik.com Git - wxWidgets.git/blob - src/univ/inpcons.cpp
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: src/univ/inpcons.cpp
3 // Purpose: wxInputConsumer: mix-in class for input handling
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"
26 #include "wx/univ/renderer.h"
27 #include "wx/univ/inphand.h"
28 #include "wx/univ/theme.h"
30 // ============================================================================
32 // ============================================================================
34 // ----------------------------------------------------------------------------
35 // focus/activation handling
36 // ----------------------------------------------------------------------------
38 void wxInputConsumer::OnFocus(wxFocusEvent
& event
)
40 if ( m_inputHandler
&& m_inputHandler
->HandleFocus(this, event
) )
41 GetInputWindow()->Refresh();
46 void wxInputConsumer::OnActivate(wxActivateEvent
& event
)
48 if ( m_inputHandler
&& m_inputHandler
->HandleActivation(this, event
.GetActive()) )
49 GetInputWindow()->Refresh();
54 // ----------------------------------------------------------------------------
56 // ----------------------------------------------------------------------------
59 wxInputConsumer::DoGetStdInputHandler(wxInputHandler
* WXUNUSED(handlerDef
))
64 void wxInputConsumer::CreateInputHandler(const wxString
& inphandler
)
66 m_inputHandler
= wxTheme::Get()->GetInputHandler(inphandler
, this);
69 void wxInputConsumer::OnKeyDown(wxKeyEvent
& event
)
71 if ( !m_inputHandler
|| !m_inputHandler
->HandleKey(this, event
, true) )
75 void wxInputConsumer::OnKeyUp(wxKeyEvent
& event
)
77 if ( !m_inputHandler
|| !m_inputHandler
->HandleKey(this, event
, false) )
81 void wxInputConsumer::OnMouse(wxMouseEvent
& event
)
85 if ( event
.Moving() || event
.Dragging() ||
86 event
.Entering() || event
.Leaving() )
88 if ( m_inputHandler
->HandleMouseMove(this, event
) )
91 else // a click action
93 if ( m_inputHandler
->HandleMouse(this, event
) )
101 // ----------------------------------------------------------------------------
103 // ----------------------------------------------------------------------------
105 bool wxInputConsumer::PerformAction(const wxControlAction
& WXUNUSED(action
),
106 long WXUNUSED(numArg
),
107 const wxString
& WXUNUSED(strArg
))