]>
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 // ----------------------------------------------------------------------------
58 void wxInputConsumer::CreateInputHandler(const wxString
& inphandler
)
60 m_inputHandler
= wxTheme::Get()->GetInputHandler(inphandler
);
63 void wxInputConsumer::OnKeyDown(wxKeyEvent
& event
)
65 if ( !m_inputHandler
|| !m_inputHandler
->HandleKey(this, event
, true) )
69 void wxInputConsumer::OnKeyUp(wxKeyEvent
& event
)
71 if ( !m_inputHandler
|| !m_inputHandler
->HandleKey(this, event
, false) )
75 void wxInputConsumer::OnMouse(wxMouseEvent
& event
)
79 if ( event
.Moving() || event
.Dragging() ||
80 event
.Entering() || event
.Leaving() )
82 if ( m_inputHandler
->HandleMouseMove(this, event
) )
85 else // a click action
87 if ( m_inputHandler
->HandleMouse(this, event
) )
95 // ----------------------------------------------------------------------------
97 // ----------------------------------------------------------------------------
99 bool wxInputConsumer::PerformAction(const wxControlAction
& WXUNUSED(action
),
100 long WXUNUSED(numArg
),
101 const wxString
& WXUNUSED(strArg
))