2017-11-04 07:03:53 +01:00
|
|
|
/***********************************************************************
|
|
|
|
* ftooltip.h - Widget FToolTip *
|
|
|
|
* *
|
|
|
|
* This file is part of the Final Cut widget toolkit *
|
|
|
|
* *
|
|
|
|
* Copyright 2016-2017 Markus Gans *
|
|
|
|
* *
|
|
|
|
* The Final Cut is free software; you can redistribute it and/or *
|
|
|
|
* modify it under the terms of the GNU Lesser General Public License *
|
|
|
|
* as published by the Free Software Foundation; either version 3 of *
|
|
|
|
* the License, or (at your option) any later version. *
|
|
|
|
* *
|
|
|
|
* The Final Cut is distributed in the hope that it will be useful, *
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
|
|
|
* GNU Lesser General Public License for more details. *
|
|
|
|
* *
|
|
|
|
* You should have received a copy of the GNU Lesser General Public *
|
|
|
|
* License along with this program. If not, see *
|
|
|
|
* <http://www.gnu.org/licenses/>. *
|
|
|
|
***********************************************************************/
|
2017-10-02 07:32:33 +02:00
|
|
|
|
|
|
|
/* Inheritance diagram
|
|
|
|
* ═══════════════════
|
|
|
|
*
|
2017-10-29 14:27:50 +01:00
|
|
|
* ▕▔▔▔▔▔▔▔▔▔▏
|
|
|
|
* ▕ FTerm ▏
|
|
|
|
* ▕▁▁▁▁▁▁▁▁▁▏
|
|
|
|
* ▲
|
|
|
|
* │
|
2017-10-02 07:32:33 +02:00
|
|
|
* ▕▔▔▔▔▔▔▔▔▔▏ ▕▔▔▔▔▔▔▔▔▔▏
|
2017-10-29 14:27:50 +01:00
|
|
|
* ▕ FVTerm ▏ ▕ FObject ▏
|
2017-10-02 07:32:33 +02:00
|
|
|
* ▕▁▁▁▁▁▁▁▁▁▏ ▕▁▁▁▁▁▁▁▁▁▏
|
|
|
|
* ▲ ▲
|
|
|
|
* │ │
|
|
|
|
* └─────┬─────┘
|
|
|
|
* │
|
|
|
|
* ▕▔▔▔▔▔▔▔▔▔▏
|
|
|
|
* ▕ FWidget ▏
|
|
|
|
* ▕▁▁▁▁▁▁▁▁▁▏
|
|
|
|
* ▲
|
|
|
|
* │
|
|
|
|
* ▕▔▔▔▔▔▔▔▔▔▏
|
|
|
|
* ▕ FWindow ▏
|
|
|
|
* ▕▁▁▁▁▁▁▁▁▁▏
|
|
|
|
* ▲
|
|
|
|
* │
|
|
|
|
* ▕▔▔▔▔▔▔▔▔▔▔▏
|
|
|
|
* ▕ FToolTip ▏
|
|
|
|
* ▕▁▁▁▁▁▁▁▁▁▁▏
|
|
|
|
*/
|
2016-10-01 23:18:49 +02:00
|
|
|
|
2017-04-09 20:08:53 +02:00
|
|
|
#ifndef FTOOLTIP_H
|
|
|
|
#define FTOOLTIP_H
|
2016-10-01 23:18:49 +02:00
|
|
|
|
2017-10-31 00:41:59 +01:00
|
|
|
#if !defined (USE_FINAL_H) && !defined (COMPILE_FINAL_CUT)
|
|
|
|
#error "Only <final/final.h> can be included directly."
|
|
|
|
#endif
|
|
|
|
|
2017-09-11 03:06:02 +02:00
|
|
|
#include <vector>
|
|
|
|
|
2017-09-17 21:32:46 +02:00
|
|
|
#include "final/fwindow.h"
|
2016-10-01 23:18:49 +02:00
|
|
|
|
|
|
|
|
|
|
|
//----------------------------------------------------------------------
|
|
|
|
// class FToolTip
|
|
|
|
//----------------------------------------------------------------------
|
|
|
|
|
|
|
|
#pragma pack(push)
|
|
|
|
#pragma pack(1)
|
|
|
|
|
|
|
|
class FToolTip : public FWindow
|
|
|
|
{
|
2017-09-11 03:06:02 +02:00
|
|
|
public:
|
|
|
|
// Constructor
|
|
|
|
explicit FToolTip (FWidget* = 0);
|
|
|
|
FToolTip (const FString&, FWidget* = 0);
|
|
|
|
|
|
|
|
// Destructor
|
|
|
|
virtual ~FToolTip ();
|
|
|
|
|
|
|
|
// Accessors
|
|
|
|
const char* getClassName() const;
|
|
|
|
const FString getText() const;
|
|
|
|
|
|
|
|
// Mutators
|
|
|
|
void setText (const FString&);
|
|
|
|
|
|
|
|
// Methods
|
|
|
|
virtual void draw();
|
|
|
|
void show();
|
|
|
|
void hide();
|
|
|
|
|
|
|
|
// Event handler
|
|
|
|
void onMouseDown (FMouseEvent*);
|
|
|
|
|
|
|
|
private:
|
|
|
|
// 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;
|
2017-09-20 16:56:20 +02:00
|
|
|
FStringList text_split;
|
2017-09-11 03:06:02 +02:00
|
|
|
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
|