7f7f5eac6e
* Change ShowTip() point parameter name to where. * Add a parameterless ResetWindowFrame() overload that get's the current where and calls ResetWindowFrame(BPoint where) which does the actual work. FrameResized() calls this parameterless ResetWindowFrame() method instead of doing the work in that method. This is functionaly the same but allows me to call the parameterless ResetWindowFrame() elsewhere.
51 lines
944 B
C++
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 where,
|
|
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
|