2016-10-01 23:18:49 +02:00
|
|
|
// File: ftooltip.h
|
|
|
|
// Provides: class FTooltip
|
|
|
|
//
|
|
|
|
// Inheritance diagram
|
|
|
|
// ═══════════════════
|
|
|
|
//
|
|
|
|
// ▕▔▔▔▔▔▔▔▔▔▏ ▕▔▔▔▔▔▔▔▔▔▏
|
|
|
|
// ▕ FObject ▏ ▕ FTerm ▏
|
|
|
|
// ▕▁▁▁▁▁▁▁▁▁▏ ▕▁▁▁▁▁▁▁▁▁▏
|
|
|
|
// ▲ ▲
|
|
|
|
// │ │
|
|
|
|
// └─────┬─────┘
|
|
|
|
// │
|
2016-10-11 04:57:36 +02:00
|
|
|
// ▕▔▔▔▔▔▔▔▔▏
|
|
|
|
// ▕ FVTerm ▏
|
|
|
|
// ▕▁▁▁▁▁▁▁▁▏
|
|
|
|
// ▲
|
|
|
|
// │
|
2016-10-01 23:18:49 +02:00
|
|
|
// ▕▔▔▔▔▔▔▔▔▔▏
|
|
|
|
// ▕ FWidget ▏
|
|
|
|
// ▕▁▁▁▁▁▁▁▁▁▏
|
|
|
|
// ▲
|
|
|
|
// │
|
|
|
|
// ▕▔▔▔▔▔▔▔▔▔▏
|
|
|
|
// ▕ FWindow ▏
|
|
|
|
// ▕▁▁▁▁▁▁▁▁▁▏
|
|
|
|
// ▲
|
|
|
|
// │
|
|
|
|
// ▕▔▔▔▔▔▔▔▔▔▔▏
|
|
|
|
// ▕ FToolTip ▏
|
|
|
|
// ▕▁▁▁▁▁▁▁▁▁▁▏
|
|
|
|
|
2017-04-09 20:08:53 +02:00
|
|
|
#ifndef FTOOLTIP_H
|
|
|
|
#define FTOOLTIP_H
|
2016-10-01 23:18:49 +02:00
|
|
|
|
|
|
|
#include "fwindow.h"
|
|
|
|
|
|
|
|
|
|
|
|
//----------------------------------------------------------------------
|
|
|
|
// class FToolTip
|
|
|
|
//----------------------------------------------------------------------
|
|
|
|
|
|
|
|
#pragma pack(push)
|
|
|
|
#pragma pack(1)
|
|
|
|
|
|
|
|
class FToolTip : public FWindow
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
// Constructor
|
|
|
|
explicit FToolTip (FWidget* = 0);
|
|
|
|
FToolTip (const FString&, FWidget* = 0);
|
2016-11-02 00:37:58 +01:00
|
|
|
|
2016-10-01 23:18:49 +02:00
|
|
|
// Destructor
|
|
|
|
virtual ~FToolTip ();
|
|
|
|
|
2016-11-02 00:37:58 +01:00
|
|
|
// Accessors
|
2016-10-01 23:18:49 +02:00
|
|
|
const char* getClassName() const;
|
2016-11-02 00:37:58 +01:00
|
|
|
const FString getText() const;
|
|
|
|
|
|
|
|
// Mutators
|
|
|
|
void setText (const FString&);
|
|
|
|
|
|
|
|
// Methods
|
2016-10-01 23:18:49 +02:00
|
|
|
virtual void draw();
|
|
|
|
void show();
|
|
|
|
void hide();
|
2016-11-02 00:37:58 +01:00
|
|
|
|
2016-10-01 23:18:49 +02:00
|
|
|
// Event handler
|
|
|
|
void onMouseDown (FMouseEvent*);
|
2016-11-02 00:37:58 +01:00
|
|
|
|
|
|
|
private:
|
|
|
|
// Typedef
|
|
|
|
typedef std::vector<FString> textLines;
|
|
|
|
|
|
|
|
// Disable copy constructor
|
|
|
|
FToolTip (const FToolTip&);
|
|
|
|
|
|
|
|
// Disable assignment operator (=)
|
|
|
|
FToolTip& operator = (const FToolTip&);
|
|
|
|
|
|
|
|
// Methods
|
|
|
|
void init();
|
|
|
|
void calculateDimensions();
|
|
|
|
virtual void adjustSize();
|
|
|
|
|
|
|
|
// Data Members
|
|
|
|
FString text;
|
|
|
|
FString* text_components;
|
|
|
|
textLines text_split;
|
|
|
|
uInt max_line_width;
|
|
|
|
uInt text_num_lines;
|
2016-10-01 23:18:49 +02:00
|
|
|
};
|
|
|
|
#pragma pack(pop)
|
|
|
|
|
|
|
|
|
|
|
|
// FToolTip inline functions
|
|
|
|
//----------------------------------------------------------------------
|
|
|
|
inline const char* FToolTip::getClassName() const
|
|
|
|
{ return "FToolTip"; }
|
|
|
|
|
|
|
|
|
2017-04-09 20:08:53 +02:00
|
|
|
#endif // FTOOLTIP_H
|