summaryrefslogtreecommitdiff
path: root/FL/Fl_Shortcut_Button.H
blob: 2baa55f3aa2310a2fcbc661242c992196b01e1f1 (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
//
// Shortcut Button header file for the Fast Light Tool Kit (FLTK).
//
// Copyright 1998-2023 by Bill Spitzak and others.
//
// This library is free software. Distribution and use rights are outlined in
// the file "COPYING" which should have been included with this file.  If this
// file is missing or damaged, see the license at:
//
//     https://www.fltk.org/COPYING.php
//
// Please see the following page on how to report bugs and issues:
//
//     https://www.fltk.org/bugs.php
//

#ifndef Fl_Shortcut_Button_H
#define Fl_Shortcut_Button_H

#include <FL/Fl_Button.H>

class FL_EXPORT Fl_Shortcut_Button : public Fl_Button {
private:
  bool hot_, pre_hot_, default_set_, handle_default_button_;
  Fl_Shortcut pre_esc_;
  Fl_Shortcut default_shortcut_;
protected:
  Fl_Shortcut shortcut_value;
  void do_end_hot_callback();
  int handle(int) override;
  void draw() override;
public:
  Fl_Shortcut_Button(int X,int Y,int W,int H, const char* l = 0);
  void value(Fl_Shortcut shortcut);
  Fl_Shortcut value();
#if 0
  // Default shortcut settings are disabled until successful review of the UI
  void default_value(Fl_Shortcut shortcut);
  Fl_Shortcut default_value();
  void default_clear();
#endif
};

#endif // Fl_Shortcut_Button_H