FLUID: Fixes override attribute, cleanup

This commit is contained in:
Matthias Melcher 2023-07-19 17:56:18 +02:00
parent f8a3278776
commit 35728ac9ec
3 changed files with 9 additions and 56 deletions

View File

@ -1,5 +1,5 @@
//
// Widget factory code for the Fast Light Tool Kit (FLTK).
// Button type factory code for the Fast Light Tool Kit (FLTK).
//
// Type classes for most of the fltk widgets. Most of the work
// is done by code in Fl_Widget_Type.C. Also a factory instance
@ -9,7 +9,7 @@
// to a factory instance for every class (both the ones defined
// here and ones in other files)
//
// Copyright 1998-2017 by Bill Spitzak and others.
// 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
@ -24,52 +24,15 @@
#include "Fl_Button_Type.h"
#include "fluid.h"
#include "Fl_Window_Type.h"
#include "Fl_Group_Type.h"
#include "Fd_Snap_Action.h"
#include "pixmaps.h"
#include "undo.h"
#include <FL/Fl.H>
#include <FL/Fl_Adjuster.H>
#include <FL/Fl_Box.H>
#include <FL/Fl_Browser.H>
#include <FL/Fl_Button.H>
#include <FL/Fl_Check_Browser.H>
#include <FL/Fl_Check_Button.H>
#include <FL/Fl_Clock.H>
#include <FL/Fl_Counter.H>
#include <FL/Fl_Dial.H>
#include <FL/Fl_File_Browser.H>
#include <FL/Fl_File_Input.H>
#include <FL/Fl_Flex.H>
#include <FL/Fl_Group.H>
#include <FL/Fl_Help_View.H>
#include <FL/Fl_Input.H>
#include <FL/Fl_Light_Button.H>
#include <FL/Fl_Menu_Item.H>
#include <FL/Fl_Output.H>
#include <FL/Fl_Pixmap.H>
#include <FL/Fl_Progress.H>
#include <FL/Fl_Return_Button.H>
#include <FL/Fl_Repeat_Button.H>
#include <FL/Fl_Round_Button.H>
#include <FL/Fl_Roller.H>
#include <FL/Fl_Scrollbar.H>
#include <FL/Fl_Simple_Terminal.H>
#include <FL/Fl_Spinner.H>
#include <FL/Fl_Text_Display.H>
#include <FL/Fl_Text_Editor.H>
#include <FL/Fl_Tree.H>
#include <FL/Fl_Value_Slider.H>
#include <FL/Fl_Value_Input.H>
#include <FL/Fl_Value_Output.H>
#include <FL/Fl_Window.H>
#include "../src/flstring.h"
#include <stdio.h>
#include <stdlib.h>
// ---- Button Types --------------------------------------------------- MARK: -
@ -84,17 +47,17 @@ static Fl_Menu_Item buttontype_menu[] = {
{0}
};
Fl_Menu_Item *Fl_Button_Type::subtypes() FL_OVERRIDE {
Fl_Menu_Item *Fl_Button_Type::subtypes() {
return buttontype_menu;
}
void Fl_Button_Type::ideal_size(int &w, int &h) FL_OVERRIDE {
void Fl_Button_Type::ideal_size(int &w, int &h) {
h = layout->labelsize + 8;
w = layout->labelsize * 4 + 8;
Fd_Snap_Action::better_size(w, h);
}
Fl_Widget *Fl_Button_Type::widget(int x, int y, int w, int h) FL_OVERRIDE {
Fl_Widget *Fl_Button_Type::widget(int x, int y, int w, int h) {
return new Fl_Button(x, y, w, h, "Button");
}

View File

@ -1,7 +1,7 @@
//
// Widget type header file for the Fast Light Tool Kit (FLTK).
// Button type header file for the Fast Light Tool Kit (FLTK).
//
// Copyright 1998-2021 by Bill Spitzak and others.
// 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
@ -30,7 +30,7 @@ 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 *widget(int x, int y, int w, int h) FL_OVERRIDE;
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; }

View File

@ -9,7 +9,7 @@
// to a factory instance for every class (both the ones defined
// here and ones in other files)
//
// Copyright 1998-2017 by Bill Spitzak and others.
// 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
@ -25,7 +25,6 @@
#include "factory.h"
#include "fluid.h"
#include "Fl_Window_Type.h"
#include "Fl_Group_Type.h"
#include "Fd_Snap_Action.h"
#include "pixmaps.h"
@ -35,26 +34,17 @@
#include <FL/Fl_Adjuster.H>
#include <FL/Fl_Box.H>
#include <FL/Fl_Browser.H>
#include <FL/Fl_Button.H>
#include <FL/Fl_Check_Browser.H>
#include <FL/Fl_Check_Button.H>
#include <FL/Fl_Clock.H>
#include <FL/Fl_Counter.H>
#include <FL/Fl_Dial.H>
#include <FL/Fl_File_Browser.H>
#include <FL/Fl_File_Input.H>
#include <FL/Fl_Flex.H>
#include <FL/Fl_Group.H>
#include <FL/Fl_Help_View.H>
#include <FL/Fl_Input.H>
#include <FL/Fl_Light_Button.H>
#include <FL/Fl_Menu_Item.H>
#include <FL/Fl_Output.H>
#include <FL/Fl_Pixmap.H>
#include <FL/Fl_Progress.H>
#include <FL/Fl_Return_Button.H>
#include <FL/Fl_Repeat_Button.H>
#include <FL/Fl_Round_Button.H>
#include <FL/Fl_Roller.H>
#include <FL/Fl_Scrollbar.H>
#include <FL/Fl_Simple_Terminal.H>