Commit Graph

1165 Commits

Author SHA1 Message Date
ManoloFLTK 18597e4f6c Avoid "#undef __APPLE__" preprocessor directive 2023-02-07 07:17:23 +01:00
Matthias Melcher 1aa6c4fed8
Fix position() methods that shadow Fl_Widget::position()
* `FL_DEPRECATED` macro to mark `position()` method that shadow `Fl_Widget::position()` #69 (#666)
2023-02-02 20:54:19 +01:00
ManoloFLTK 6276822e9e Allow cmake -DOPTION_APPLE_X11=On without -U__APPLE__ 2023-02-02 18:48:24 +01:00
Albrecht Schlosser 4e75549e7b Update dependencies and fix whitespace errors
- replace tabs with spaces
- remove trailing whitespace
2023-02-02 17:09:14 +01:00
Matthias Melcher 179771acd2
Fixing FLUID file corruption from issue #653 (#662)
Removing all globals in file writer (#653 )
Fix some static analyser complaints
Valgrind: handle width==0 in GfxDrivers on Wayland and X11
Don't use `Fl_Input_::static_value`, it accesses previous
buffer that may be deleted
Project file write encapsulated, removing globals
Encapsulating project file reader, removing states in glbals
Project i/o increased source code readability
2023-01-26 15:23:43 +01:00
wcout 2ddfd9d949
Animated GIF support (Fl_Anim_GIF_Image class) (#375) 2023-01-21 17:27:58 +01:00
Matthias Melcher 1fc269b0d4
Move global FLTK options into new app fltk-admin (#560) 2023-01-21 17:14:41 +01:00
Albrecht Schlosser 02ca05c6b2 Fix memory leak warnings by "binding" images
Although the memory "leak" is not really an issue in this demo
program (memory is returned anyway), "fixing" the leak warning
issued by valgrind and address sanitizer demonstrates the new
feature to "bind" images.
2023-01-15 20:14:35 +01:00
ManoloFLTK c76285d457 Add necessary initialisation in test/mandelbrot
Detected by valgrind :
==16102== Conditional jump or move depends on uninitialised value(s)
==16102==    at 0x449A10: Drawing_Area::idle() (mandelbrot.cxx:143)
2023-01-14 20:07:30 +01:00
Albrecht Schlosser bafd3fd3d7 Add Fl_Scheme_Choice widget and use it in test programs
This widget offers the selection of all known FLTK schemes as a simple
widget based on Fl_Choice.

Some test and demo programs use Fl_Scheme_Choice to enable the developer
or user to switch schemes quickly for comparison.

Todo:
 - add features to add new schemes during runtime (partially done)
 - update status when the scheme is changed by Fl::scheme("...")
2023-01-12 19:21:09 +01:00
Matthias Melcher f576faf2a6 Fix new warnings in CI 2023-01-10 17:07:03 +01:00
Matthias Melcher cf2d2fc5e0 Fix compiler warning in test/tabs 2023-01-10 15:20:05 +01:00
Matthias Melcher e0830305a2 Add Fl_Tabs dragging in pulldown mode 2023-01-05 23:17:02 +01:00
Matthias Melcher 9ef9bbe80e
Adding color to test/mandelbrot (#634) 2023-01-05 14:10:46 +01:00
Matthias Melcher 8826dca106
Add close buttons for individual tabs in Fl_Tabs (#628)
Add close buttons for Fl_Tabs
Introducing callback reasons
FLUID shows all FL_WHEN_... options
Adding Fl_Tabs overflow types
Improved test/tabs to show new features
2023-01-05 13:51:30 +01:00
Matthias Melcher 2c5a5ce948
FLUID support for inline image data (see #542, #592) (#604) 2022-12-30 19:20:52 +01:00
Matthias Melcher 44c874b731
Use `FL_OVERRIDE` for all overridden virtual methods (#611)
FL_OVERRIDE is defined as `override` for C++11 and higher
FL_OVERRIDE is defined as `override` for VisualC 2015 and newer
Don't interfere with Fl_Widget::override()
2022-12-30 19:14:36 +01:00
Albrecht Schlosser 78cf29ba29 Improve and extend fl_contrast() (#370)
- Add internal fl_contrast_cielab() as the new default.
- Keep old function as internal fl_contrast_legacy().
- Add fl_contrast_mode() to switch between fl_contrast() functions.
- Add fl_contrast_level() to fine tune fl_contrast() per mode.
- Add option to register and use a custom contrast function.
- Add test/contrast.cxx test program.
- Move all fl_contrast() related code to a new file src/fl_contrast.cxx.
- Add fl_lightness() convenience function for perceived lightness.
- Add fl_luminance() convenience function for physical luminance.
2022-12-28 18:16:23 +01:00
Albrecht Schlosser 6518e2d1f1 Fix merge error in animated.cxx (sorry for the noise) 2022-12-28 16:24:28 +01:00
Albrecht Schlosser 03389d1931 Replace an enum with 'const' variables in test/animated.cxx
- replace enum value 'FRAMES' with 'const unsigned int frames'
- replace enum value 'DIM' with 'const unsigned int dim'
- remove commented statements that have never been used.

Note: this also changes uppercase enum values to lowercase constants.
2022-12-28 16:00:22 +01:00
ManoloFLTK 72b8054ecc Fix compiler warnings on Windows with mingw-w64 CMAKE_CXX_STANDARD=20 (#615) 2022-12-28 09:32:01 +01:00
Matthias Melcher 08f6741d7b
Make unittest conform to CMP (#597)
Update unittest README
2022-12-17 13:16:57 +01:00
Albrecht Schlosser 44a2547394
Rename some Fl_Flex methods for FLTK compliance (#594)
Change some method names to comply with FLTK style as discussed
in fltk.coredev, thread "Fl_Flex method name question".

* Rename Fl_Flex::margins(...) to Fl_Flex::margin(...)
  (use singular form for all margin related methods)

* Remove Fl_Flex::setSize() and isSetSize() "backwards compatibility" methods

* Rename Fl_Flex::set_size(...) to fixed(...)

Note: the latter affects existing (pre-release) fluid (.fl) files: you may
  want to edit and replace "set_size_tuples" with "fixed_size_tuples"
2022-12-15 16:46:40 +01:00
Albrecht Schlosser 64d8c913be Fix trailing whitespace and dependencies 2022-12-13 15:58:56 +01:00
Greg Ercolano 6a047855db Move utf-8 box drawing string into .cxx
It was decided today it is ok to use utf-8 strings in source,
so consolidating.
2022-12-11 11:00:08 -08:00
Greg Ercolano 821d2fdf82 Added Unicode Boxes unittest and README-unittests.txt
This test helps check for issues with multiline widgets
drawing text properly.

The README-unittests.txt was added to help developers
add new unit tests easily.
2022-12-11 10:18:06 -08:00
ManoloFLTK 36cd0a397c New Fl_ICO_Image class to read Windows .ico icon files
Many thanks to @darealshinji for contributing all the code
for this new FLTK image class (see branch Fl_ICO_Image of https://github.com/darealshinji/fltk).
2022-12-09 10:43:20 +01:00
Albrecht Schlosser 823dc5acc4 Fix compilation warning, update dependencies
Warning: variable ‘j’ set but not used [-Wunused-but-set-variable]
2022-12-08 19:09:18 +01:00
ian fca63db4ab Minor update to unittest_text to add support for showing the text baseline in testing. 2022-12-07 11:17:55 +00:00
Matthias Melcher 9f92972729
Implement fl_complex_polygon() for OpenGL (#570) 2022-12-05 19:27:12 +01:00
Matthias Melcher bf825f8ebd
Add a unit test for drawing complex shapes (#565) 2022-11-30 22:40:52 +01:00
Matthias Melcher 130a504a39
Add i18n to test/preferences (#555)
To test the output of FLUID code and demonstrate
i18n, preferences emulates GNU gettext.
2022-11-25 16:58:50 +01:00
Albrecht Schlosser b1ba37c5ba Add "Oxy" scheme (STR 2675, STR 3477)
This commit is similar to the patch given in STR 3477, oxy_v5.diff:
https://www.fltk.org/strfiles/3477/oxy_v5.diff

... with modifications, and updated to current FLTK code.
2022-11-25 00:00:48 +01:00
Albrecht Schlosser 624eda17bc Fix whitespace errors and dependencies
(no code changes)
2022-11-16 21:10:14 +01:00
Albrecht Schlosser 8d636d931e Fix Visual Studio compiler warnings 2022-11-11 19:27:00 +01:00
Matthias Melcher e6c3cae6f2 Testing emojis in test/utf8. 2022-11-08 23:55:33 +01:00
Matthias Melcher 51ce2b9235 Removed i18n from test/preferences.fl 2022-11-07 09:36:33 +01:00
Greg Ercolano b663e272e7 Speed up test/table open time
Only showing table's callbacks after table is initialized.
We're only interested in user interaction.
2022-11-06 21:37:50 -08:00
Matthias Melcher c4bb4e192e Fixing _define before _include. 2022-11-06 16:19:53 +01:00
ManoloFLTK 2ffd4e4f1a Replace all calls to sprintf() by calls to snprintf(). 2022-09-26 16:12:18 +02:00
Greg Ercolano 0fd10e9fde Updated fltk logo for docs and help_dialog using logo from the website. 2022-09-23 12:46:35 -07:00
Albrecht Schlosser 64548e2f3a Improve layout, fix resizing of test/demo
Add an invisible box as resizable() to 'demogrp' to avoid bad resizing
behavior while the debug terminal is enabled. The old version would
disable some buttons including the 'exit' button if the window was
resized to a smaller size.

Simplify the popup menu (remove strcmp()).
2022-08-08 17:35:56 +02:00
Albrecht Schlosser a5b9cc888b Add option to test Fl_Flex in test/pack.cxx
This new feature demonstrates that Fl_Flex can be used (almost) as
a drop-in replacement of Fl_Pack.

Add missing file to examples/.gitignore.
2022-08-08 11:07:40 +02:00
Albrecht Schlosser 713d276b1c Fl_Flex: support different margin sizes, improve docs
Support different margin sizes on all four edges. Default margin
  and gap size is now 0 (compatible with Fl_Pack).

Doxygen: move the description from the constructor to the class
  declaration which constitutes a "description".

Make some methods virtual and/or 'const'.

Clarify demo programs, make them even more "FLTK style".
2022-08-07 16:00:41 +02:00
Albrecht Schlosser f37aca15e9 Add Fl_Flex widget from Karsten Pedersen (issue #255)
This work is based on the repository and latest commit:
  https://github.com/osen/FL_Flex.git

  commit 36e4ed75a00daac825b87e81295818b4650991f5
  Author: Karsten Pedersen <...>
  Date:   Fri Apr 23 12:06:16 2021 +0000

    Added Fltk (LGPL) license.

This widget is similar to Fl_Pack and supports either one row or one
column of widgets but has some more features. Test and demo programs
are included:

  test/flex_login.cxx: simple "login window" demo program
  test/flex_demo.cxx:  slightly more complex demo program

The original demo programs can still be compiled and built with
the new widget provided you '#include <FL/Fl_Flex.H>'.
Backwards compatible methods are included (except debug()).

The original widget has been modified to match FLTK standards and
enhanced in several ways, including:

- support box frames
- add HORIZONTAL and VERTICAL enum values (as in Fl_Pack)
- add horizontal() method (as in Fl_Pack)
- use type() rather than internal 'direction' variable
- add standard widget constructor (x, y, w, h, label)
- add margin and gap accessors rather than hard coding constants
- improve test and demo programs
- add documentation
- replace <vector> with array as required by FLTK CMP
- rename camelCase method names, keeping old names for compatibility:
  - change 'setSize(Fl_Widget*, int)'   to 'set_size(Fl_Widget*, int)'
  - change 'bool isSetSize(Fl_Widget*)' to 'int set_size(Fl_Widget*)'
- remove debug() method
- add a way to "unset" fixed size: set_size(Fl_Widget *, 0)
- add layout() method to force recalculation of children
- unify resizeRow() and resizeCol() methods to avoid code duplication
- improve widget size calculation.
2022-08-01 15:33:20 +02:00
Albrecht Schlosser 15bbfeb975 Configure/make: update dependencies 2022-07-27 19:45:08 +02:00
Albrecht Schlosser a2fe4f5910 test/buttons: reorder buttons, remove unnecessary includes
Reorder buttons in the expected <tab> order (left to right, top down),
make window resizable, and remove unnecessary #include statements.
2022-07-27 19:44:37 +02:00
Albrecht Schlosser 6f883d87d7 Add active/inactive button to unittest_schemes.cxx
... to test the deactivated status of integrated widgets.
2022-07-27 19:07:36 +02:00
ManoloFLTK fad867a5d3 Modify test/cairo_test.cxx to show roles of OPTION_CAIRO and OPTION_CAIROEXT.
Also make clear that these options require, for now, Fl_Double_Window to work cross-platform.
2022-04-12 09:20:34 +02:00
Albrecht Schlosser 9e147fe8c0 Fix build of test/unittests with shared libraries
- set variables UNITTEST_LIBS and UNITTEST_LIBS_SHARED appropriately
- use these variables in build instructions

This includes normal and shared builds with and w/o OpenGL.
2022-04-09 17:19:20 +02:00