haiku/headers/private/interface/ToolTipManager.h
Axel Dörfler 2f2f3fa042 Moved stable tool tip concept into the BToolManager class.
* This removes the fVisibleToolTip member from BView, and fixes bug #5669;
  BToolTipManager::ShowTip() now gets the owner of the tool tip as an extra
  parameter.
* Removed the work-around to hide that bug.
* Improved ToolTipTest application to include more test cases like a view that
  periodically update its tool tip via SetToolTip(const char*), and one that
  sets a new tool tip every second.
* Furthermore, added a test that shows that inner views inherit the tool tip
  of their parents.
* Fixed another bug in BToolTipManager::ShowTip() that would release an
  extra reference to the tool tip currently shown.
2012-04-28 22:14:03 +02:00

51 lines
944 B
C++

/*
* Copyright 2009, Haiku, Inc. All Rights Reserved.
* Distributed under the terms of the MIT License.
*/
#ifndef _TOOL_TIP_MANAGER_H
#define _TOOL_TIP_MANAGER_H
#include <Locker.h>
#include <Messenger.h>
#include <Point.h>
class BToolTip;
class BToolTipManager {
public:
static BToolTipManager* Manager();
void ShowTip(BToolTip* tip, BPoint point,
void* owner);
void HideTip();
void SetShowDelay(bigtime_t time);
bigtime_t ShowDelay() const;
void SetHideDelay(bigtime_t time);
bigtime_t HideDelay() const;
bool Lock() { return fLock.Lock(); }
void Unlock() { fLock.Unlock(); }
private:
BToolTipManager();
virtual ~BToolTipManager();
static void _InitSingleton();
private:
BLocker fLock;
BMessenger fWindow;
bigtime_t fShowDelay;
bigtime_t fHideDelay;
static BToolTipManager* sDefaultInstance;
};
#endif // _TOOL_TIP_MANAGER_H