blob: 77ffa60e46e4a7bc21775a0ad785e3d4cf7f3fab (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
|
#ifndef __TIPWIN_HH__
#define __TIPWIN_HH__
#include <FL/Fl_Menu_Window.H>
#include <FL/Fl_Button.H>
/*
* Custom tooltip window
*/
class TipWin : public Fl_Menu_Window {
char tip[256];
int bgcolor, recent;
void *cur_widget;
public:
TipWin();
void draw();
void value(const char *s);
void do_show(void *wid);
void do_hide();
void recent_tooltip(int val);
void cancel(void *wid) {
if (wid == cur_widget) { cur_widget = NULL; do_hide(); }
}
};
extern TipWin *my_tipwin(void);
/*
* A Button sharing a custom tooltip window
*/
class TipWinButton : public Fl_Button {
char *mytooltip;
TipWin *tipwin;
public:
TipWinButton(int x, int y, int w, int h, const char *l = 0);
~TipWinButton();
virtual int handle(int e);
void set_tooltip(const char *s);
};
/*
* A button that highlights on mouse over
*/
class CustButton : public TipWinButton {
Fl_Color norm_color, light_color;
public:
CustButton(int x, int y, int w, int h, const char *l=0);
virtual int handle(int e);
void hl_color(Fl_Color col);
};
#endif // __TIPWIN_HH__
|