* Also hide tool tips if a key has been pressed.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@36885 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler 2010-05-21 12:32:58 +00:00
parent b70311a396
commit d2717a34c6
1 changed files with 11 additions and 2 deletions

View File

@ -1,5 +1,5 @@
/*
* Copyright 2009, Axel Dörfler, axeld@pinc-software.de.
* Copyright 2009-2010, Axel Dörfler, axeld@pinc-software.de.
* Copyright 2009, Stephan Aßmus <superstippi@gmx.de>.
* All rights reserved. Distributed under the terms of the MIT License.
*/
@ -42,6 +42,7 @@ public:
virtual void FrameResized(float width, float height);
virtual void MouseMoved(BPoint where, uint32 transit,
const BMessage* dragMessage);
virtual void KeyDown(const char* bytes, int32 numBytes);
void HideTip();
void ShowTip();
@ -82,7 +83,7 @@ ToolTipView::~ToolTipView()
void
ToolTipView::AttachedToWindow()
{
SetEventMask(B_POINTER_EVENTS, 0);
SetEventMask(B_POINTER_EVENTS | B_KEYBOARD_EVENTS, 0);
fToolTip->AttachedToWindow();
}
@ -127,6 +128,14 @@ ToolTipView::MouseMoved(BPoint where, uint32 transit,
}
void
ToolTipView::KeyDown(const char* bytes, int32 numBytes)
{
if (!fToolTip->IsSticky())
HideTip();
}
void
ToolTipView::HideTip()
{