// $Revision: 1.4 $ // Copyright (c) 1994-1995 Taligent, Inc. All rights reserved. #ifndef TaligentSamples_KEYINPUTVIEW #define TaligentSamples_KEYINPUTVIEW #ifndef Taligent_ACTIVATIBLEVIEW #include #endif #ifndef Taligent_KEYBOARDINPUT #include #endif class TInteractor; class TKeyInputView : public TContentView, public MKeyEventHandler { public: MCollectibleDeclarationsMacro(TKeyInputView); TKeyInputView(); TKeyInputView(const TGPoint& size, const TGPoint& location = TGPoint::kOrigin); virtual ~TKeyInputView(); virtual void HandleAfterConnectionToViewRoot(); virtual void HandleBeforeDisconnectionFromViewRoot(); virtual void HandleActivate(); virtual void HandleDeactivate(); virtual void AddInteractor(TInteractor*); virtual void RemoveInteractor(const TInteractor&); virtual void DrawContents(TGrafPort&) const; virtual bool KeyDown(TKeyDownEvent&); virtual void ToggleColor(); protected: virtual void HandleAllocatedAreaChanged(const TGArea&); private: TVirtualKeyCode::EVirtualKey fLastKey; bool fColorIsLight; TInteractor* fInteractorAlias; enum EVersion { kOriginalVersion }; }; #endif // TaligentSamples_KEYINPUTVIEW