diff options
| author | Matthias Melcher <github@matthiasm.com> | 2023-07-19 17:44:44 +0200 |
|---|---|---|
| committer | Matthias Melcher <github@matthiasm.com> | 2023-07-19 17:45:28 +0200 |
| commit | f8a327877699a8565d36b2f0b1cbe074f224fba4 (patch) | |
| tree | 00673ec9887fa97a108a56910c97df6b37c6ff8c /fluid/Fl_Button_Type.h | |
| parent | 9ee8cdc727e7c510c28b51318b953d82aa1dd936 (diff) | |
FLUID: emulated RTTI for all types
Complete type hierarchy in Fl_Types doc
Window now derives correctly from Group
Menu Items now correctly (functionally in FLUID) derived form Button
Menu Buttons have a better hierarchy
Fixing two possible crash bugs where Input_Choice was assumed to be a Menu_
Hoping I have not degraded the original code!
Diffstat (limited to 'fluid/Fl_Button_Type.h')
| -rw-r--r-- | fluid/Fl_Button_Type.h | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/fluid/Fl_Button_Type.h b/fluid/Fl_Button_Type.h new file mode 100644 index 000000000..f80a60beb --- /dev/null +++ b/fluid/Fl_Button_Type.h @@ -0,0 +1,43 @@ +// +// Widget type header file for the Fast Light Tool Kit (FLTK). +// +// Copyright 1998-2021 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 _FLUID_FACTORY_H +#define _FLUID_FACTORY_H + +#include "Fl_Widget_Type.h" + +/** + \brief A handler for the simple push button and a base class for all other buttons. + */ +class Fl_Button_Type : public Fl_Widget_Type +{ + typedef Fl_Widget_Type super; + Fl_Menu_Item *subtypes() FL_OVERRIDE; +public: + void ideal_size(int &w, int &h) FL_OVERRIDE; + const char *type_name() FL_OVERRIDE { return "Fl_Button"; } + const char *alt_type_name() FL_OVERRIDE { return "fltk::Button"; } + Fl_Widget *widget(int x, int y, int w, int h); + Fl_Widget_Type *_make() FL_OVERRIDE { return new Fl_Button_Type(); } + int is_button() const FL_OVERRIDE { return 1; } + ID id() const FL_OVERRIDE { return ID_Button; } + bool is_a(ID inID) FL_OVERRIDE { return (inID==ID_Button) ? true : super::is_a(inID); } +}; + +extern Fl_Button_Type Fl_Button_type; + + +#endif // _FLUID_FACTORY_H |
