Ardour
9.0-pre0-582-g084a23a80d
persistent_tooltip.h
Go to the documentation of this file.
1
/*
2
* Copyright (C) 2013-2015 Paul Davis <paul@linuxaudiosystems.com>
3
* Copyright (C) 2015-2016 Robin Gareus <robin@gareus.org>
4
*
5
* This program is free software; you can redistribute it and/or modify
6
* it under the terms of the GNU General Public License as published by
7
* the Free Software Foundation; either version 2 of the License, or
8
* (at your option) any later version.
9
*
10
* This program is distributed in the hope that it will be useful,
11
* but WITHOUT ANY WARRANTY; without even the implied warranty of
12
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
* GNU General Public License for more details.
14
*
15
* You should have received a copy of the GNU General Public License along
16
* with this program; if not, write to the Free Software Foundation, Inc.,
17
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
18
*/
19
20
#ifndef gtkmm2ext_persistent_tooltip_h
21
#define gtkmm2ext_persistent_tooltip_h
22
23
#include <sigc++/trackable.h>
24
25
#include <gtkmm.h>
26
#include "
gtkmm2ext/visibility.h
"
27
28
namespace
Gtkmm2ext
{
29
33
class
LIBGTKMM2EXT_API
PersistentTooltip
:
public
sigc::trackable
34
{
35
public
:
36
PersistentTooltip
(
Gtk::Widget
*,
bool
draggable =
false
,
int
margin_y = 0);
37
virtual
~PersistentTooltip
();
38
39
void
set_tip
(std::string);
40
void
set_font
(Pango::FontDescription font);
41
void
set_center_alignment
(
bool
align_to_center);
42
43
virtual
bool
dragging
()
const
;
44
static
void
set_tooltips_enabled
(
bool
en) { _tooltips_enabled = en; }
45
static
bool
tooltips_enabled
() {
return
_tooltips_enabled; }
46
47
private
:
48
static
bool
_tooltips_enabled
;
49
static
unsigned
int
_tooltip_timeout
;
50
bool
timeout
();
51
void
show
();
52
void
hide
();
53
bool
enter
(
GdkEventCrossing
*);
54
bool
leave
(
GdkEventCrossing
*);
55
bool
press
(
GdkEventButton
*);
56
bool
release
(
GdkEventButton
*);
57
59
Gtk::Widget
*
_target
;
61
Gtk::Window
*
_window
;
63
Gtk::Label
*
_label
;
64
67
bool
_draggable
;
71
bool
_maybe_dragging
;
73
sigc::connection
_timeout
;
75
std::string
_tip
;
76
Pango::FontDescription
_font
;
77
bool
_align_to_center
;
78
int
_margin_y
;
79
};
80
81
}
82
83
#endif
Gtk::Label
Definition:
label.h:55
Gtk::Widget
Definition:
tk/ytkmm/ytkmm/gtkmm/widget.h:336
Gtk::Window
Definition:
ytkmm/ytkmm/gtkmm/window.h:159
Gtkmm2ext::PersistentTooltip
Definition:
persistent_tooltip.h:34
Gtkmm2ext::PersistentTooltip::_align_to_center
bool _align_to_center
Definition:
persistent_tooltip.h:77
Gtkmm2ext::PersistentTooltip::release
bool release(GdkEventButton *)
Gtkmm2ext::PersistentTooltip::timeout
bool timeout()
Gtkmm2ext::PersistentTooltip::leave
bool leave(GdkEventCrossing *)
Gtkmm2ext::PersistentTooltip::_maybe_dragging
bool _maybe_dragging
Definition:
persistent_tooltip.h:71
Gtkmm2ext::PersistentTooltip::_timeout
sigc::connection _timeout
Definition:
persistent_tooltip.h:73
Gtkmm2ext::PersistentTooltip::hide
void hide()
Gtkmm2ext::PersistentTooltip::set_center_alignment
void set_center_alignment(bool align_to_center)
Gtkmm2ext::PersistentTooltip::PersistentTooltip
PersistentTooltip(Gtk::Widget *, bool draggable=false, int margin_y=0)
Gtkmm2ext::PersistentTooltip::_margin_y
int _margin_y
Definition:
persistent_tooltip.h:78
Gtkmm2ext::PersistentTooltip::_tooltip_timeout
static unsigned int _tooltip_timeout
Definition:
persistent_tooltip.h:49
Gtkmm2ext::PersistentTooltip::_draggable
bool _draggable
Definition:
persistent_tooltip.h:67
Gtkmm2ext::PersistentTooltip::press
bool press(GdkEventButton *)
Gtkmm2ext::PersistentTooltip::dragging
virtual bool dragging() const
Gtkmm2ext::PersistentTooltip::tooltips_enabled
static bool tooltips_enabled()
Definition:
persistent_tooltip.h:45
Gtkmm2ext::PersistentTooltip::enter
bool enter(GdkEventCrossing *)
Gtkmm2ext::PersistentTooltip::~PersistentTooltip
virtual ~PersistentTooltip()
Gtkmm2ext::PersistentTooltip::set_tooltips_enabled
static void set_tooltips_enabled(bool en)
Definition:
persistent_tooltip.h:44
Gtkmm2ext::PersistentTooltip::_tooltips_enabled
static bool _tooltips_enabled
Definition:
persistent_tooltip.h:48
Gtkmm2ext::PersistentTooltip::_label
Gtk::Label * _label
Definition:
persistent_tooltip.h:63
Gtkmm2ext::PersistentTooltip::_font
Pango::FontDescription _font
Definition:
persistent_tooltip.h:76
Gtkmm2ext::PersistentTooltip::set_tip
void set_tip(std::string)
Gtkmm2ext::PersistentTooltip::_target
Gtk::Widget * _target
Definition:
persistent_tooltip.h:59
Gtkmm2ext::PersistentTooltip::_tip
std::string _tip
Definition:
persistent_tooltip.h:75
Gtkmm2ext::PersistentTooltip::set_font
void set_font(Pango::FontDescription font)
Gtkmm2ext::PersistentTooltip::show
void show()
Gtkmm2ext::PersistentTooltip::_window
Gtk::Window * _window
Definition:
persistent_tooltip.h:61
visibility.h
LIBGTKMM2EXT_API
#define LIBGTKMM2EXT_API
Definition:
gtkmm2ext/gtkmm2ext/visibility.h:39
Gtkmm2ext
Definition:
editor.h:82
_GdkEventButton
Definition:
gdkevents.h:321
_GdkEventCrossing
Definition:
gdkevents.h:383
libs
gtkmm2ext
gtkmm2ext
persistent_tooltip.h
Generated on Wed Dec 25 2024 05:44:44 for Ardour by
1.9.1