]>
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 // ============================================================================
17 #pragma implementation "inpcons.h"
20 // ----------------------------------------------------------------------------
22 // ----------------------------------------------------------------------------
24 #include "wx/wxprec.h"
30 #include "wx/univ/renderer.h"
31 #include "wx/univ/inphand.h"
32 #include "wx/univ/theme.h"
34 // ============================================================================
36 // ============================================================================
38 // ----------------------------------------------------------------------------
39 // focus/activation handling
40 // ----------------------------------------------------------------------------
42 void wxInputConsumer::OnFocus(wxFocusEvent
& event
)
44 if ( m_inputHandler
&& m_inputHandler
->HandleFocus(this, event
) )
45 GetInputWindow()->Refresh();
50 void wxInputConsumer::OnActivate(wxActivateEvent
& event
)
52 if ( m_inputHandler
&& m_inputHandler
->HandleActivation(this, event
.GetActive()) )
53 GetInputWindow()->Refresh();
58 // ----------------------------------------------------------------------------
60 // ----------------------------------------------------------------------------
62 void wxInputConsumer::CreateInputHandler(const wxString
& inphandler
)
64 m_inputHandler
= wxTheme::Get()->GetInputHandler(inphandler
);
67 void wxInputConsumer::OnKeyDown(wxKeyEvent
& event
)
69 if ( !m_inputHandler
|| !m_inputHandler
->HandleKey(this, event
, TRUE
) )
73 void wxInputConsumer::OnKeyUp(wxKeyEvent
& event
)
75 if ( !m_inputHandler
|| !m_inputHandler
->HandleKey(this, event
, FALSE
) )
79 void wxInputConsumer::OnMouse(wxMouseEvent
& event
)
83 if ( event
.Moving() || event
.Entering() || event
.Leaving() )
85 if ( m_inputHandler
->HandleMouseMove(this, event
) )
88 else // a click action
90 if ( m_inputHandler
->HandleMouse(this, event
) )
98 // ----------------------------------------------------------------------------
100 // ----------------------------------------------------------------------------
102 bool wxInputConsumer::PerformAction(const wxControlAction
& WXUNUSED(action
),
103 long WXUNUSED(numArg
),
104 const wxString
& WXUNUSED(strArg
))