]>
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
7 // Copyright: (c) 2000 SciTech Software, Inc. (www.scitechsoft.com)
8 // Licence: wxWindows licence
9 /////////////////////////////////////////////////////////////////////////////
11 // ============================================================================
13 // ============================================================================
15 // ----------------------------------------------------------------------------
17 // ----------------------------------------------------------------------------
19 #include "wx/wxprec.h"
26 #include "wx/window.h"
29 #include "wx/univ/renderer.h"
30 #include "wx/univ/inphand.h"
31 #include "wx/univ/theme.h"
33 // ============================================================================
35 // ============================================================================
37 // ----------------------------------------------------------------------------
38 // focus/activation handling
39 // ----------------------------------------------------------------------------
41 void wxInputConsumer::OnFocus(wxFocusEvent
& event
)
43 if ( m_inputHandler
&& m_inputHandler
->HandleFocus(this, event
) )
44 GetInputWindow()->Refresh();
49 void wxInputConsumer::OnActivate(wxActivateEvent
& event
)
51 if ( m_inputHandler
&& m_inputHandler
->HandleActivation(this, event
.GetActive()) )
52 GetInputWindow()->Refresh();
57 // ----------------------------------------------------------------------------
59 // ----------------------------------------------------------------------------
62 wxInputConsumer::DoGetStdInputHandler(wxInputHandler
* WXUNUSED(handlerDef
))
67 void wxInputConsumer::CreateInputHandler(const wxString
& inphandler
)
69 m_inputHandler
= wxTheme::Get()->GetInputHandler(inphandler
, this);
72 void wxInputConsumer::OnKeyDown(wxKeyEvent
& event
)
74 if ( !m_inputHandler
|| !m_inputHandler
->HandleKey(this, event
, true) )
78 void wxInputConsumer::OnKeyUp(wxKeyEvent
& event
)
80 if ( !m_inputHandler
|| !m_inputHandler
->HandleKey(this, event
, false) )
84 void wxInputConsumer::OnMouse(wxMouseEvent
& event
)
88 if ( event
.Moving() || event
.Dragging() ||
89 event
.Entering() || event
.Leaving() )
91 if ( m_inputHandler
->HandleMouseMove(this, event
) )
94 else // a click action
96 if ( m_inputHandler
->HandleMouse(this, event
) )
104 // ----------------------------------------------------------------------------
106 // ----------------------------------------------------------------------------
108 bool wxInputConsumer::PerformAction(const wxControlAction
& WXUNUSED(action
),
109 long WXUNUSED(numArg
),
110 const wxString
& WXUNUSED(strArg
))