FLTK 1.4.0
Loading...
Searching...
No Matches
Fl_Shortcut_Button.H
1//
2// Shortcut Button header file for the Fast Light Tool Kit (FLTK).
3//
4// Copyright 1998-2023 by Bill Spitzak and others.
5//
6// This library is free software. Distribution and use rights are outlined in
7// the file "COPYING" which should have been included with this file. If this
8// file is missing or damaged, see the license at:
9//
10// https://www.fltk.org/COPYING.php
11//
12// Please see the following page on how to report bugs and issues:
13//
14// https://www.fltk.org/bugs.php
15//
16
17#ifndef Fl_Shortcut_Button_H
18#define Fl_Shortcut_Button_H
19
20#include <FL/Fl_Button.H>
21
22class FL_EXPORT Fl_Shortcut_Button : public Fl_Button {
23private:
24 bool hot_, pre_hot_, default_set_, handle_default_button_;
25 Fl_Shortcut pre_esc_;
26 Fl_Shortcut default_shortcut_;
27protected:
28 Fl_Shortcut shortcut_value;
29 void do_end_hot_callback();
30 int handle(int) FL_OVERRIDE;
31 void draw() FL_OVERRIDE;
32public:
33 Fl_Shortcut_Button(int X,int Y,int W,int H, const char* l = 0);
34 void value(Fl_Shortcut shortcut);
36#if 0
37 // Default shortcut settings are disabled until successful review of the UI
38 void default_value(Fl_Shortcut shortcut);
39 Fl_Shortcut default_value();
40 void default_clear();
41#endif
42};
43
44#endif // Fl_Shortcut_Button_H
45
Buttons generate callbacks when they are clicked by the user.
Definition Fl_Button.H:76
int handle(int) FL_OVERRIDE
Handles the specified event.
Definition Fl_Button.cxx:104
void draw() FL_OVERRIDE
Draws the widget.
Definition Fl_Button.cxx:68
int value(int v)
Sets the current value of the button.
Definition Fl_Button.cxx:40
A button that allows the user to type a key combination to create shortcuts.
Definition Fl_Shortcut_Button.H:22
#define FL_OVERRIDE
This macro makes it safe to use the C++11 keyword override with older compilers.
Definition fl_attr.h:46
unsigned int Fl_Shortcut
16-bit Unicode character + 8-bit indicator for keyboard flags.
Definition fl_types.h:55