]> git.saurik.com Git - wxWidgets.git/blame_incremental - src/univ/inpcons.cpp
Warning fix.
[wxWidgets.git] / src / univ / inpcons.cpp
... / ...
CommitLineData
1/////////////////////////////////////////////////////////////////////////////
2// Name: src/univ/inpcons.cpp
3// Purpose: wxInputConsumer: mix-in class for input handling
4// Author: Vadim Zeitlin
5// Modified by:
6// Created: 14.08.00
7// RCS-ID: $Id$
8// Copyright: (c) 2000 SciTech Software, Inc. (www.scitechsoft.com)
9// Licence: wxWindows licence
10/////////////////////////////////////////////////////////////////////////////
11
12// ============================================================================
13// declarations
14// ============================================================================
15
16// ----------------------------------------------------------------------------
17// headers
18// ----------------------------------------------------------------------------
19
20#include "wx/wxprec.h"
21
22#ifdef __BORLANDC__
23 #pragma hdrstop
24#endif
25
26#include "wx/univ/renderer.h"
27#include "wx/univ/inphand.h"
28#include "wx/univ/theme.h"
29
30// ============================================================================
31// implementation
32// ============================================================================
33
34// ----------------------------------------------------------------------------
35// focus/activation handling
36// ----------------------------------------------------------------------------
37
38void wxInputConsumer::OnFocus(wxFocusEvent& event)
39{
40 if ( m_inputHandler && m_inputHandler->HandleFocus(this, event) )
41 GetInputWindow()->Refresh();
42 else
43 event.Skip();
44}
45
46void wxInputConsumer::OnActivate(wxActivateEvent& event)
47{
48 if ( m_inputHandler && m_inputHandler->HandleActivation(this, event.GetActive()) )
49 GetInputWindow()->Refresh();
50 else
51 event.Skip();
52}
53
54// ----------------------------------------------------------------------------
55// input processing
56// ----------------------------------------------------------------------------
57
58wxInputHandler *
59wxInputConsumer::DoGetStdInputHandler(wxInputHandler * WXUNUSED(handlerDef))
60{
61 return NULL;
62}
63
64void wxInputConsumer::CreateInputHandler(const wxString& inphandler)
65{
66 m_inputHandler = wxTheme::Get()->GetInputHandler(inphandler, this);
67}
68
69void wxInputConsumer::OnKeyDown(wxKeyEvent& event)
70{
71 if ( !m_inputHandler || !m_inputHandler->HandleKey(this, event, true) )
72 event.Skip();
73}
74
75void wxInputConsumer::OnKeyUp(wxKeyEvent& event)
76{
77 if ( !m_inputHandler || !m_inputHandler->HandleKey(this, event, false) )
78 event.Skip();
79}
80
81void wxInputConsumer::OnMouse(wxMouseEvent& event)
82{
83 if ( m_inputHandler )
84 {
85 if ( event.Moving() || event.Dragging() ||
86 event.Entering() || event.Leaving() )
87 {
88 if ( m_inputHandler->HandleMouseMove(this, event) )
89 return;
90 }
91 else // a click action
92 {
93 if ( m_inputHandler->HandleMouse(this, event) )
94 return;
95 }
96 }
97
98 event.Skip();
99}
100
101// ----------------------------------------------------------------------------
102// the actions
103// ----------------------------------------------------------------------------
104
105bool wxInputConsumer::PerformAction(const wxControlAction& WXUNUSED(action),
106 long WXUNUSED(numArg),
107 const wxString& WXUNUSED(strArg))
108{
109 return false;
110}
111