]>
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 #if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
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 wxInputConsumer::wxInputConsumer()
40 m_inputHandler
= NULL
;
43 // ----------------------------------------------------------------------------
44 // focus/activation handling
45 // ----------------------------------------------------------------------------
47 void wxInputConsumer::OnFocus(wxFocusEvent
& event
)
49 if ( m_inputHandler
&& m_inputHandler
->HandleFocus(this, event
) )
50 GetInputWindow()->Refresh();
55 void wxInputConsumer::OnActivate(wxActivateEvent
& event
)
57 if ( m_inputHandler
&& m_inputHandler
->HandleActivation(this, event
.GetActive()) )
58 GetInputWindow()->Refresh();
63 // ----------------------------------------------------------------------------
65 // ----------------------------------------------------------------------------
67 void wxInputConsumer::CreateInputHandler(const wxString
& inphandler
)
69 m_inputHandler
= wxTheme::Get()->GetInputHandler(inphandler
);
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
.Entering() || event
.Leaving() )
90 if ( m_inputHandler
->HandleMouseMove(this, event
) )
93 else // a click action
95 if ( m_inputHandler
->HandleMouse(this, event
) )
103 // ----------------------------------------------------------------------------
105 // ----------------------------------------------------------------------------
107 bool wxInputConsumer::PerformAction(const wxControlAction
& WXUNUSED(action
),
108 long WXUNUSED(numArg
),
109 const wxString
& WXUNUSED(strArg
))